Skip to main content

Creating Workflow Definition

Workflow can be defined as the collection of tasks and operators that specifies the order and execution of the defined tasks. This API is used to create workflow definitions in Orkes Conductor.

Input Payload

You can configure workflow definition directly via UI and using API. The workflow definition include the following parameters:

nameProvide a unique name to identify the workflow. This field is mandatory.
descriptionInclude a description to indicate the purpose of the workflow. This field is optional.
versionYou can give versions to the workflow to keep track of the changes. By default, the value is 1.
tasksYou can provide the tasks to be executed in the workflow here. If the task type is an operator or a system task, it is handled by the Conductor server. For user-defined/worker tasks, a worker running outside the Conductor environment is required.
inputParametersIndicates the input values for the workflow.
outputParametersIndicates the output values of the workflow.
schemaVersionIndicates the version number of the workflow definition schema.
restartableSet this value to true to restart a completed workflow. If restarting a completed workflow can impact the functioning, set this value to false.
workflowStatusListenerEnabledSetting this value to true, will enable workflow status change events to sink if configured. For more information workflow status change events
ownerEmailThis field will be auto-populated with the user’s email address.
timeoutSecondsTime (in seconds), after which the workflow is marked as TIMED_OUT if not completed after transitioning to IN_PROGRESS status for the first time. No timeout occurs if the value is set to 0.
timeoutPolicyIndicates the condition at which the workflow should time out. It can take any of the following values:
  • TIME_OUT_WF - The workflow status is marked as TIMEOUT and is terminated.
  • ALERT_ONLY - Registers a counter.
failureWorkflowProvide the workflow name to be triggered upon a failure of the execution of this workflow.

API Endpoint

POST /api/metadata/workflow

When a workflow definition is updated via API, it automatically increments the workflow version to the latest.

Client SDK Methods

void OrkesMetadataClient.registerWorkflowDef(WorkflowDef workflowDef) throws ApiException