Skip to main content

Create Workflow Definition

Endpoint: POST /api/metadata/workflow

Creates a new workflow definition.

Query parameters

ParameterDescriptionTypeRequired/ Optional
overwriteWhether to overwrite the existing definition with the same name. Default is false. Set to true to overwrite an existing definition.booleanOptional.
newVersionWhether to create a new version for the workflow definition. Default is false. Set to true to create a new version.booleanOptional.

Request body

ParameterDescriptionTypeRequired/ Optional
nameA unique name for the workflow definition.
  • For v4.0.1 and prior: Only letters, digits, hyphens (-), and underscores (_) are allowed.
  • For v4.0.2 and later: Only letters, digits, spaces, hyphens (-), underscores (_), and certain special characters (<, >, {, }, #) are allowed.
Note: It is recommended to use alphanumeric characters for workflow names. While special characters are allowed for backward compatibility, they are not fully supported and may cause unexpected behavior.
stringRequired.
descriptionA description of the workflow.stringOptional.
versionThe version of the workflow definition. Defaults to 0 if not specified.integerOptional.
tasksThe task configurations to be included in the workflow.array of objectsRequired.
inputParametersThe input keys for the workflow.array of stringsOptional.
outputParametersThe JSON template used to generate the workflow output. If unspecified, the workflow output is defined as the output of the last executed task.objectOptional.
enforceSchemaWhether to enforce input schema validation. Set to true to enable validation or false to disable.booleanOptional.
inputSchemaThe schema parameters to be used as input schema for the workflow definition. Learn more about creating and using schemas.objectRequired if enforceSchema is set to true.
schemaVersionThe current version of the Conductor schema. Must be 2.integerRequired.
restartableWhether the workflow can be restarted after completion. Set to false if restarting could impact workflow functionality.booleanOptional.
timeoutSecondsTime (in seconds), after which the workflow will be set as TIMED_OUT if it hasn't reached a terminal state. No timeout occurs if the value is set to 0.integerRequired.
timeoutPolicyThe policy for handling workflow timeout. Supported values:
  • TIME_OUT_WF-The workflow is set to TIMED_OUT and is terminated.
  • ALERT_ONLY-Increments the counter to check the workflow status when it times out and logs relevant messages.
stringOptional.
rateLimitConfigA map of the workflow rate limit configuration.objectOptional.
rateLimitConfig. rateLimitKeyA unique identifier to group workflow executions for rate limiting.
Can be a fixed value (for example, "max") or a dynamic variable from the workflow input (for example, ${workflow.input.correlationId}).
stringOptional.
rateLimitConfig. concurrentExecLimitThe number of workflow executions that can run concurrently for a given key.integerOptional.
workflowStatusListenerEnabledWhether to enable status callback for workflow state changes. Learn more about enabling CDC.booleanOptional.
workflowStatusListenerSinkThe sink where workflow state changes are sent.stringRequired if workflowStatusListener is set to true.
failureWorkflowThe compensation workflow to trigger upon failure of the current workflow execution.stringOptional.
tagsA key-value map to add tags to the workflow definition. Each tag consists of a key associated with a corresponding value.objectOptional.
ownerEmailThe email address of the user creating the workflow definition.stringRequired.

Examples

Create a new workflow definition

Request

curl -X 'POST' \
'https://<YOUR_CLUSTER>/api/metadata/workflow?overwrite=false&newVersion=false' \
-H 'accept: */*' \
-H 'X-Authorization: <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"name": "api-test",
"description": "Sample workflow created using API",
"version": 1,
"tasks": [
{
"name": "event",
"taskReferenceName": "event_ref",
"type": "EVENT",
"sink": "sqs:internal_event_name",
"inputParameters": {}
}
],
"inputParameters": [],
"outputParameters": {},
"schemaVersion": 2,
"restartable": true,
"workflowStatusListenerEnabled": false,
"ownerEmail": "john.doe@acme.com",
"timeoutPolicy": "ALERT_ONLY",
"timeoutSeconds": 0
}'

Response

Returns 200 OK, indicating that the workflow definition has been created successfully.