Workflow Execution
The /workflows/execute endpoint allows you to execute workflows directly by name.
Execute Workflow
Endpoint: /workflows/execute/<WORKFLOW_NAME>
Method: POST
Headers
| Header | Value |
|---|---|
Authorization | Bearer <YOUR_JWT_TOKEN> |
Content-Type | application/json |
Path Parameters
| Parameter | Description |
|---|---|
<WORKFLOW_NAME> | The name of the workflow to execute. |
Input Parameters
| Parameter | Data Type | Description |
|---|---|---|
vars | Record<string, any> | (Optional) Parameters to pass to the workflow. |
objectIds | string[] | (Optional) Array of document IDs to process. |
unique | boolean | (Optional) Make the workflow ID unique by adding a random token. Default: false. |
custom_id | string | (Optional) Custom ID to use for the workflow execution instead of the generated one. |
task_queue | string | (Optional) Task queue to assign the workflow to (used with custom workflow workers). |
Example Request
{
"vars": {
"target_language": "es",
"interaction": "translate"
},
"objectIds": ["doc123", "doc456"],
"unique": true,
"custom_id": "my-custom-execution-123"
}
Example Response
{
"runId": "<WORKFLOW_RUN_ID>",
"workflowId": "<WORKFLOW_ID>"
}
Note: The response includes the runId and workflowId which can be used to track the workflow execution status via the Workflow Runs API.
Code Examples
Execute Workflow
curl --location 'https://api.vertesia.io/api/v1/workflows/execute/<WORKFLOW_NAME>' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"vars": {
"target_language": "es",
"interaction": "translate"
},
"objectIds": ["doc123", "doc456"],
"unique": true,
"custom_id": "my-custom-execution-123"
}'
