Workflow Execution

The /workflows/execute endpoint allows you to execute workflows directly by name.

Execute Workflow

Endpoint: /workflows/execute/<WORKFLOW_NAME>

Method: POST

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>
Content-Typeapplication/json

Path Parameters

ParameterDescription
<WORKFLOW_NAME>The name of the workflow to execute.

Input Parameters

ParameterData TypeDescription
varsRecord<string, any>(Optional) Parameters to pass to the workflow.
objectIdsstring[](Optional) Array of document IDs to process.
uniqueboolean(Optional) Make the workflow ID unique by adding a random token. Default: false.
custom_idstring(Optional) Custom ID to use for the workflow execution instead of the generated one.
task_queuestring(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"
}'

Was this page helpful?