import Morphik from 'morphik';
const client = new Morphik({
apiKey: 'My API Key',
});
const workflowRun = await client.workflows.run('document_id', { workflow_id: 'workflow_id' });
console.log(workflowRun.document_id);
{
"id": "<string>",
"workflow_id": "<string>",
"document_id": "<string>",
"user_id": "<string>",
"app_id": "<string>",
"status": "queued",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"results_per_step": [
{}
],
"final_output": {},
"error": "<string>",
"system_metadata": {}
}
Queue a workflow run and return immediately.
The heavy execution is scheduled in a BackgroundTask so the request finishes quickly, enabling the UI to update the document row to “processing” without waiting for LLM calls.
import Morphik from 'morphik';
const client = new Morphik({
apiKey: 'My API Key',
});
const workflowRun = await client.workflows.run('document_id', { workflow_id: 'workflow_id' });
console.log(workflowRun.document_id);
{
"id": "<string>",
"workflow_id": "<string>",
"document_id": "<string>",
"user_id": "<string>",
"app_id": "<string>",
"status": "queued",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"results_per_step": [
{}
],
"final_output": {},
"error": "<string>",
"system_metadata": {}
}
Successful Response
Represents a concrete execution of a Workflow against a document.
Was this page helpful?