Skip to main content

Execute Workflow Asynchronously

Endpoint: POST /api/workflow/{name}

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

Path parameters

ParameterDescriptionTypeRequired/ Optional
nameThe name of the workflow to execute.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.

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.

Request body

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

Example

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

Response

Returns the workflow execution ID of the started workflow. Returns 404 if an invalid workflow name is provided.

Examples

Start a workflow asynchronously

Request

curl -X 'POST' \
'https://<YOUR-SERVER-URL>/api/workflow/DemoWorkflow?priority=0' \
-H 'accept: text/plain' \
-H 'X-Authorization: <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{"input1": "someValue"}'

Response

86e6cce1-0599-11f1-913a-226156badb04