Skip to main content

Start Workflow Execution (Async)

Endpoint: POST /api/workflow/{name}

Starts a workflow execution asynchronously. This method returns immediately with the workflow ID without waiting for the workflow to be completed.

Path parameters

ParameterDescriptionTypeRequired/ Optional
nameThe name of the workflow to be started.stringRequired.

Query parameters

ParameterDescriptionTypeRequired/ Optional
versionThe workflow version. If unspecified, the latest version will be used.integerOptional.
correlationIdA unique identifier used to correlate the current workflow execution with other executions of the same workflow.stringOptional.
priorityPriority of the workflow execution. Supported values: 0-99.

Default is 0, which means workflows are completed in a first-in-first-out order.
integerOptional.

Request body

Contains the workflow inputs. Format the request as an object containing key-value pairs.

Example

{
"someKey": "someValue",
"anotherKey": {}
}

Header parameters

ParameterDescriptionTypeRequired/ Optional
X-Idempotency-keyA unique, user-generated key to prevent duplicate workflow executions. Idempotency data is retained for the life of the workflow execution.stringOptional.
X-on-conflictThe idempotency strategy for handling duplicate requests. Supported values:
  • RETURN_EXISTING—Return the workflowId of the workflow instance with the same idempotency key.
  • FAIL—Start a new workflow instance only if there are no workflow executions with the same idempotency key.
  • FAIL_ON_RUNNING—Start a new workflow instance only if there are no RUNNING or PAUSED workflows with the same idempotency key. Completed workflows can run again.
stringRequired if X-Idempotency-key is specified.

Response

Returns the workflow ID of the started workflow.

Examples

Start a workflow

Request

curl -X 'POST' \
'https://<YOUR_CLUSTER>/api/workflow/compensationWorkflow?priority=0' \
-H 'accept: text/plain' \
-H 'X-Authorization: <TOKEN>' \
-d '{
"input1": "someValue"
}'

Response

c0933afc-d3f4-11ef-87b1-b2b27c52ebde