Skip to main content

Update Workflow Definition

Endpoint: PUT /api/metadata/workflow

Updates an existing workflow definition.

Query parameters

ParameterDescriptionTypeRequired/ Optional
overwriteWhether to overwrite the existing definition with the same name. Default is true.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
nameThe name of the workflow definition to be updated.
  • 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 updating the workflow definition.stringRequired.

Examples

Update an existing workflow definition

Request

curl -X 'PUT' \
'https://<YOUR_CLUSTER>/api/metadata/workflow?overwrite=true&newVersion=false' \
-H 'accept: */*' \
-H 'X-Authorization: <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"createTime": 1735802320196,
"updateTime": 1735812484172,
"name": "api-test",
"description": "Sample workflow created using API",
"version": 2,
"tasks": [
{
"name": "event",
"taskReferenceName": "event_ref",
"inputParameters": {},
"type": "EVENT",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"sink": "ibm_mq:internal_event_name",
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"onStateChange": {},
"permissive": false
}
],
"inputParameters": [],
"outputParameters": {},
"failureWorkflow": "",
"schemaVersion": 2,
"restartable": false,
"workflowStatusListenerEnabled": false,
"ownerEmail": "john.doe@acme.com",
"timeoutPolicy": "ALERT_ONLY",
"timeoutSeconds": 0,
"variables": {},
"inputTemplate": {},
"rateLimitConfig":
{
"rateLimitKey": "12",
"concurrentExecLimit": 33
},
"enforceSchema": true
}'

Response

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