For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
GuidesAPI ReferenceChangelogModel Versioning
GuidesAPI ReferenceChangelogModel Versioning
    • Getting Started
    • Authentication
    • API Versioning
    • SDKs
    • Deployments
  • Processor Endpoints
    • POSTRun Processor
    • GETGet Processor Run
    • GETList Processor Runs
    • POSTCancel Processor Run
    • DELDelete Processor Run
    • GETGet Batch Processor Run
    • GETList Processors
    • POSTCreate Processor
    • POSTUpdate Processor
    • POSTPublish Processor Version
    • GETGet Processor Version
    • GETList Processor Versions
  • Parse Endpoints
    • POSTParse File
    • POSTParse File Async
    • GETGet Parser Run
    • DELDelete Parser Run
  • Workflow Endpoints
    • POSTRun Workflow
    • GETGet Workflow Run
    • GETList Workflow Runs
    • POSTUpdate Workflow Run
    • POSTCancel Workflow Run
    • DELDelete Workflow Run
    • POSTCreate Workflow
    • POSTBatch Run Workflow
    • POSTCorrect Workflow Run Outputs
  • File Endpoints
    • POSTUpload File
    • GETGet File
    • DELDelete File
    • GETList Files
    • POSTCreate File
  • Edit Endpoints
    • POSTEdit File
    • POSTEdit File Async
    • POSTGenerate Edit Schema
    • GETGet Edit Run
    • DELDelete Edit Run
    • GETGet Edit Template
  • Evaluation Set Endpoints
    • GETGet Evaluation Set
    • GETList Evaluation Sets
    • POSTCreate Evaluation Set
    • GETList Evaluation Set Items
    • POSTCreate Evaluation Set Item
    • POSTUpdate Evaluation Set Item
    • DELDelete Evaluation Set Item
    • POSTBulk Create Evaluation Set Items
LogoLogo
Workflow Endpoints

Run Workflow

POST
https://api.extend.ai/workflow_runs
POST
/workflow_runs
1import { ExtendClient } from "extend-ai";
2
3const client = new ExtendClient({ token: "YOUR_TOKEN" });
4await client.workflowRuns.create({
5 workflow: {
6 id: "wf_1234567890"
7 },
8 file: {
9 url: "https://example.com/invoice.pdf"
10 }
11});
1{
2 "success": true,
3 "workflowRuns": [
4 {
5 "object": "workflow_run",
6 "id": "workflow_run_TcgplCsALH1I-cvG93mWa",
7 "name": "My Workflow Run",
8 "url": "https://dashboard.extend.ai/workflows/workflow_YH1ZEST4sxgUT7w84KBGa?workflowRunId=workflow_run_TcgplCsALH1I-cvG93mWa",
9 "status": "PENDING",
10 "metadata": {},
11 "files": [
12 {
13 "object": "file",
14 "id": "file_v8gqaWzgTnSyIMZfrlEba",
15 "name": "My File",
16 "metadata": {},
17 "createdAt": "2025-05-12T21:34:54.455000+00:00",
18 "updatedAt": "2025-05-12T21:34:54.483000+00:00",
19 "type": "PDF"
20 }
21 ],
22 "initialRunAt": "2025-05-12T21:34:54.477000+00:00",
23 "reviewed": false,
24 "outputs": [],
25 "stepRuns": [],
26 "workflow": {
27 "object": "workflow",
28 "id": "workflow_YH1ZEST4sxgUT7w84KBGa",
29 "version": "1",
30 "name": "My Workflow"
31 },
32 "batchId": "batch_kCz2ht2a"
33 }
34 ]
35}
Run a Workflow with files. A Workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome. A WorkflowRun will be created for each file processed. A WorkflowRun represents a single execution of a workflow against a file.
Was this page helpful?
Previous

Get Workflow Run

Next
Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Headers

x-extend-api-version"2025-04-21"Optional
API version to use for the request. If you do not specify a version, you will either receive a `400 Bad Request` or be set to a previous legacy version. See [API Versioning](https://docs.extend.ai/2025-04-21/developers/api-versioning) for more details.

Request

This endpoint expects an object.
workflowIdstringRequired

The ID of the workflow to run.

Example: "workflow_BMdfq_yWM3sT-ZzvCnA3f"

fileslist of objectsOptional
An array of files to process through the workflow. Either the `files` array or `rawTexts` array must be provided. Supported file types can be found [here](https://docs.extend.ai/2025-04-21/product/general/supported-file-types). There is a limit if 50 files that can be processed at once using this endpoint. If you wish to process more at a time, consider using the [Batch Run Workflow](https://docs.extend.ai/2025-04-21/developers/api-reference/workflow-endpoints/batch-run-workflow) endpoint.
rawTextslist of stringsOptional

An array of raw strings. Can be used in place of files when passing raw data. The raw data will be converted to .txt files and run through the workflow. If the data follows a specific format, it is recommended to use the files parameter instead. Either files or rawTexts must be provided.

versionstringOptional
An optional version of the workflow that files will be run through. This number can be found when viewing the workflow on the Extend platform. When a version number is not supplied, the most recent published version of the workflow will be used. If no published versions exist, the draft version will be used. To run the `"draft"` version of a workflow, use `"draft"` as the version. Examples: - `"3"` - Run version 3 of the workflow - `"draft"` - Run the draft version of the workflow
priorityintegerOptional1-100Defaults to 50
An optional value used to determine the relative order of WorkflowRuns when rate limiting is in effect. Lower values will be prioritized before higher values.
metadatamap from strings to anyOptional
An optional metadata object that can be assigned to a specific WorkflowRun to help identify it. It will be returned in the response and webhooks. You can place any arbitrary `key : value` pairs in this object. To categorize workflow runs for billing and usage tracking, include `extend:usage_tags` with an array of string values (e.g., `{"extend:usage_tags": ["production", "team-eng", "customer-123"]}`). Tags must contain only alphanumeric characters, hyphens, and underscores; any special characters will be automatically removed.

Response

Successfully created workflow runs
successboolean
workflowRunslist of objects
An array of WorkflowRun objects, with each WorkflowRun corresponding to a single File that was passed in.

Errors

400
Bad Request Error
401
Unauthorized Error

API version to use for the request. If you do not specify a version, you will either receive a 400 Bad Request or be set to a previous legacy version. See API Versioning for more details.

An array of files to process through the workflow. Either the files array or rawTexts array must be provided. Supported file types can be found here. There is a limit if 50 files that can be processed at once using this endpoint. If you wish to process more at a time, consider using the Batch Run Workflow endpoint.

An optional version of the workflow that files will be run through. This number can be found when viewing the workflow on the Extend platform. When a version number is not supplied, the most recent published version of the workflow will be used. If no published versions exist, the draft version will be used. To run the "draft" version of a workflow, use "draft" as the version.

Examples:

  • "3" - Run version 3 of the workflow
  • "draft" - Run the draft version of the workflow

An optional metadata object that can be assigned to a specific WorkflowRun to help identify it. It will be returned in the response and webhooks. You can place any arbitrary key : value pairs in this object.

To categorize workflow runs for billing and usage tracking, include extend:usage_tags with an array of string values (e.g., {"extend:usage_tags": ["production", "team-eng", "customer-123"]}). Tags must contain only alphanumeric characters, hyphens, and underscores; any special characters will be automatically removed.