Skip to main content

Test Workflow Synchronously

Endpoint: POST /api/workflow/test/sync

Tests a workflow using mock data and blocks until the workflow completes or reaches a specified task. Unlike POST /workflow/test, this endpoint supports mocking HTTP (system) tasks in addition to worker tasks.

Query parameter

ParameterDescriptionTypeRequired/ Optional
requestIdA user-generated request ID, which can be used to track the API request. Auto-generated if not provided. In most cases, this does not need to be set explicitly.stringOptional.
waitUntilTaskRefThe reference name of the task to wait for before returning a response.stringOptional.
waitForSecondsThe duration in seconds to wait before returning a response. Default is 10.integerOptional.
consistencySpecifies how the workflow start request is persisted and replicated before execution begins. Supported values:
  • SYNCHRONOUS: Executes the workflow directly from memory without persisting the request. The workflow is evaluated with minimal state synchronization during execution. This mode provides the lowest latency but is non-durable.
  • DURABLE: The request is stored in persistence before the workflow execution. Workflow state is synchronized during execution.
  • REGION_DURABLE: The request is replicated across regions before the workflow execution. This method provides the highest level of durability and fault tolerance but may introduce additional latency.
Default is DURABLE.
stringOptional.
returnStrategyDetermines what is returned in the response. Supported values:
  • TARGET_WORKFLOW: Returns the state of the originally triggered workflow.
  • BLOCKING_WORKFLOW: Returns the state of the workflow that is currently blocking the execution, which may be a sub-workflow.
  • BLOCKING_TASK: Returns the execution status of the task that is currently blocking workflow execution.
  • BLOCKING_TASK_INPUT: Returns the input of the task that is currently blocking workflow execution. Useful for introspecting runtime behavior or debugging.
Default is TARGET_WORKFLOW.
stringOptional.

Request body

Format the request as an object containing the following parameters.

ParameterDescriptionTypeRequired/ Optional
nameThe name of the workflow to be tested.stringRequired.
versionThe version of the workflow to be tested. If unspecified, the latest version will be used.integerOptional.
inputThe workflow inputs for the test request.objectRequired if there are workflow inputs specified.
workflowDefThe workflow definition JSON of the workflow to be tested.objectRequired if you don’t want to use the JSON from the Conductor server.
taskRefToMockOutputAccepts mock outputs for both worker tasks and HTTP tasks. If no mock is provided for an HTTP task, the task executes against the real endpoint.

Each key is a task reference name, and each value is an array of mock outputs applied in order per execution attempt.

Example for HTTP task "taskRefToMockOutput": { "myHttpTask_ref": [{ "status": "COMPLETED", "output": { "response": { "statusCode": 200, "body": "ok" } }, "executionTime": 0, "queueWaitTime": 0 }] }
objectRequired if there are HTTP/Worker tasks.
subWorkflowTestRequestThe sub-workflow test request for mocking outputs in the sub-workflow’s Worker tasks.objectRequired if there are sub-workflows containing Worker tasks.
correlationIdA unique identifier used to correlate the current workflow execution with other executions of the same workflow.stringOptional.
idempotencyKeyA unique, user-generated key to prevent duplicate workflow executions. Idempotency data is retained for the life of the workflow execution.stringOptional.
idempotencyStrategyThe 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 idempotencyKey is used.
taskToDomainA mapping of task reference names to domain-specific values to route the task to defined workers.objectOptional.

Response

Returns the execution JSON of the tested workflow.

Examples

Test workflow using remote workflow definition

Request

curl -X 'POST' \
'https://<YOUR-SERVER-URL>/api/workflow/test/sync?consistency=SYNCHRONOUS&returnStrategy=TARGET_WORKFLOW' \
-H 'accept: application/json' \
-H 'X-Authorization: <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"name": "http",
"version": 1
}'

Response

The workflow execution details are returned for the http workflow using the definition stored on the Conductor server.

{
"responseType": "TARGET_WORKFLOW",
"targetWorkflowId": "55d430cb-22a9-11f1-a31d-7a59f946460e",
"targetWorkflowStatus": "COMPLETED",
"workflowId": "55d430cb-22a9-11f1-a31d-7a59f946460e",
"input": {},
"output": {
"response": {
"headers": {
"content-length": [
"182"
],
"content-type": [
"application/json"
],
"date": [
"Wed, 18 Mar 2026 09:03:31 GMT"
],
"strict-transport-security": [
"max-age=15724800; includeSubDomains"
]
},
"reasonPhrase": "",
"body": {
"randomString": "iwodbexhwlgpyompxace",
"randomInt": 9986,
"hostName": "orkes-api-sampler-67dfc8cf58-6xqr4",
"apiRandomDelay": "0 ms",
"sleepFor": "0 ms",
"statusCode": "200",
"queryParams": {}
},
"statusCode": 200
}
},
"signalTimeout": false,
"priority": 0,
"variables": {},
"tasks": [
{
"taskType": "HTTP",
"status": "COMPLETED",
"inputData": {
"encode": true,
"method": "GET",
"asyncComplete": false,
"_createdBy": "john.doe@acme.com",
"uri": "https://orkes-api-tester.orkesconductor.com/api",
"contentType": "application/json",
"accept": "application/json"
},
"referenceTaskName": "http_ref",
"retryCount": 0,
"seq": 1,
"pollCount": 0,
"taskDefName": "http",
"scheduledTime": 1773824611179,
"startTime": 1773824611191,
"endTime": 1773824611433,
"updateTime": 1773824611476,
"startDelayInSeconds": 0,
"retried": false,
"executed": true,
"callbackFromWorker": true,
"responseTimeoutSeconds": 0,
"workflowInstanceId": "55d430cb-22a9-11f1-a31d-7a59f946460e",
"workflowType": "http",
"taskId": "55e48484-22a9-11f1-a31d-7a59f946460e",
"callbackAfterSeconds": 0,
"workerId": "orkes-conductor-deployment-69cc8c86fc-27d7x",
"outputData": {
"response": {
"headers": {
"content-length": [
"182"
],
"content-type": [
"application/json"
],
"date": [
"Wed, 18 Mar 2026 09:03:31 GMT"
],
"strict-transport-security": [
"max-age=15724800; includeSubDomains"
]
},
"reasonPhrase": "",
"body": {
"randomString": "iwodbexhwlgpyompxace",
"randomInt": 9986,
"hostName": "orkes-api-sampler-67dfc8cf58-6xqr4",
"apiRandomDelay": "0 ms",
"sleepFor": "0 ms",
"statusCode": "200",
"queryParams": {}
},
"statusCode": 200
}
},
"workflowTask": {
"name": "http",
"taskReferenceName": "http_ref",
"inputParameters": {
"uri": "https://orkes-api-tester.orkesconductor.com/api",
"method": "GET",
"accept": "application/json",
"contentType": "application/json",
"encode": true,
"asyncComplete": false
},
"type": "HTTP",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"onStateChange": {},
"permissive": false
},
"rateLimitPerFrequency": 0,
"rateLimitFrequencyInSeconds": 0,
"workflowPriority": 0,
"iteration": 0,
"subworkflowChanged": false,
"firstStartTime": 0,
"loopOverTask": false,
"taskDefinition": null,
"queueWaitTime": 12
}
],
"createdBy": "john.doe@acme.com",
"createTime": 1773824611096,
"status": "COMPLETED",
"updateTime": 1773824611482
}
Test workflow using local workflow definition

Request

curl -X 'POST' \
'https://<YOUR-SERVER-URL>/api/workflow/test/sync?consistency=SYNCHRONOUS&returnStrategy=TARGET_WORKFLOW' \
-H 'accept: application/json' \
-H 'X-Authorization: <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"name": "myFirstWorkflow",
"workflowDef": {
"name": "myFirstWorkflow",
"tasks": [
{
"name": "get-user_ref",
"taskReferenceName": "get-user_ref",
"inputParameters": {
"http_request": {
"uri": "https://randomuser.me/api/",
"method": "GET"
}
},
"type": "HTTP"
}
],
"inputParameters": [],
"outputParameters": {},
"schemaVersion": 2,
"timeoutPolicy": "ALERT_ONLY",
"timeoutSeconds": 60,
"enforceSchema": false
}
}'

Response

The workflow execution details are returned using the local workflow definition provided in the request body.

{
"responseType": "TARGET_WORKFLOW",
"targetWorkflowId": "52cc0e0e-22aa-11f1-bcc9-82b25f73e343",
"targetWorkflowStatus": "COMPLETED",
"workflowId": "52cc0e0e-22aa-11f1-bcc9-82b25f73e343",
"input": {},
"output": {
"response": {
"headers": {
"alt-svc": [
"h3=\":443\"; ma=86400"
],
"cf-cache-status": [
"DYNAMIC"
],
"cf-ray": [
"9de31ae88e81d680-IAD"
],
"content-type": [
"application/json"
],
"date": [
"Wed, 18 Mar 2026 09:10:35 GMT"
],
"nel": [
"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}"
],
"report-to": [
"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=wXRx%2B7e%2F7pnWzZWtf%2BKkmJ1pycZb9EmyP0YIaDEvp74FmbKZYVHPgWBfTvmqVXnwoPt4p1sZWgIlJ2h%2F2SdG691Gz4p1LIZw6dqF\"}]}"
],
"server": [
"cloudflare"
]
},
"reasonPhrase": "",
"body": {
"results": [],
"info": {
"seed": "d3adb33f",
"results": 1,
"page": 1,
"version": "1.4"
}
},
"statusCode": 200
}
},
"signalTimeout": false,
"priority": 0,
"variables": {},
"tasks": [
{
"taskType": "HTTP",
"status": "COMPLETED",
"inputData": {
"asyncComplete": false,
"http_request": {
"method": "GET",
"uri": "https://randomuser.me/api/"
},
"_createdBy": "john.doe@acme.com"
},
"referenceTaskName": "get-user_ref",
"retryCount": 0,
"seq": 1,
"pollCount": 0,
"taskDefName": "get-user_ref",
"scheduledTime": 1773825035421,
"startTime": 1773825035421,
"endTime": 1773825035616,
"updateTime": 1773825035618,
"startDelayInSeconds": 0,
"retried": false,
"executed": true,
"callbackFromWorker": true,
"responseTimeoutSeconds": 0,
"workflowInstanceId": "52cc0e0e-22aa-11f1-bcc9-82b25f73e343",
"workflowType": "myFirstWorkflow",
"taskId": "52cdbbc7-22aa-11f1-bcc9-82b25f73e343",
"callbackAfterSeconds": 0,
"workerId": "orkes-conductor-deployment-69cc8c86fc-s6bdf",
"outputData": {
"response": {
"headers": {
"alt-svc": [
"h3=\":443\"; ma=86400"
],
"cf-cache-status": [
"DYNAMIC"
],
"cf-ray": [
"9de31ae88e81d680-IAD"
],
"content-type": [
"application/json"
],
"date": [
"Wed, 18 Mar 2026 09:10:35 GMT"
],
"nel": [
"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}"
],
"report-to": [
"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=wXRx%2B7e%2F7pnWzZWtf%2BKkmJ1pycZb9EmyP0YIaDEvp74FmbKZYVHPgWBfTvmqVXnwoPt4p1sZWgIlJ2h%2F2SdG691Gz4p1LIZw6dqF\"}]}"
],
"server": [
"cloudflare"
]
},
"reasonPhrase": "",
"body": {
"results": [],
"info": {
"seed": "d3adb33f",
"results": 1,
"page": 1,
"version": "1.4"
}
},
"statusCode": 200
}
},
"workflowTask": {
"name": "get-user_ref",
"taskReferenceName": "get-user_ref",
"inputParameters": {
"http_request": {
"uri": "https://randomuser.me/api/",
"method": "GET"
},
"asyncComplete": false
},
"type": "HTTP",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"onStateChange": {},
"permissive": false
},
"rateLimitPerFrequency": 0,
"rateLimitFrequencyInSeconds": 0,
"workflowPriority": 0,
"iteration": 0,
"subworkflowChanged": false,
"firstStartTime": 0,
"loopOverTask": false,
"taskDefinition": null,
"queueWaitTime": 0
}
],
"createdBy": "john.doe@acme.com",
"createTime": 1773825035413,
"status": "COMPLETED",
"updateTime": 1773825035621
}
Test workflow with mock HTTP tasks

Request

curl -X 'POST' \
'https://<YOUR-SERVER-URL>/api/workflow/test/sync' \
-H 'accept: application/json' \
-H 'X-Authorization: <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"name": "http",
"version": 1,
"taskRefToMockOutput": {
"http_ref": [
{
"status": "COMPLETED",
"output": {
"response": {
"statusCode": 200,
"body": "ok"
}
},
"executionTime": 0,
"queueWaitTime": 0
}
]
}
}'

Response

The workflow execution details are returned with the HTTP task (http_ref) showing the mocked output instead of executing against the real endpoint.

{
"responseType": "TARGET_WORKFLOW",
"targetWorkflowId": "b5fb98e1-22aa-11f1-bcc9-82b25f73e343",
"targetWorkflowStatus": "COMPLETED",
"workflowId": "b5fb98e1-22aa-11f1-bcc9-82b25f73e343",
"input": {},
"output": {
"response": {
"statusCode": 200,
"body": "ok"
}
},
"signalTimeout": false,
"priority": 0,
"variables": {},
"tasks": [
{
"taskType": "HTTP",
"status": "COMPLETED",
"inputData": {
"encode": true,
"method": "GET",
"asyncComplete": false,
"_createdBy": "john.doe@acme.com",
"uri": "https://orkes-api-tester.orkesconductor.com/api",
"contentType": "application/json",
"accept": "application/json"
},
"referenceTaskName": "http_ref",
"retryCount": 0,
"seq": 1,
"pollCount": 0,
"taskDefName": "http",
"scheduledTime": 1773825201851,
"startTime": 1773825201851,
"endTime": 1773825201851,
"updateTime": 1773825201856,
"startDelayInSeconds": 0,
"retried": false,
"executed": true,
"callbackFromWorker": true,
"responseTimeoutSeconds": 0,
"workflowInstanceId": "b5fb98e1-22aa-11f1-bcc9-82b25f73e343",
"workflowType": "http",
"taskId": "b5ff697d-22aa-11f1-bcc9-82b25f73e343",
"callbackAfterSeconds": 0,
"outputData": {
"response": {
"statusCode": 200,
"body": "ok"
}
},
"workflowTask": {
"name": "http",
"taskReferenceName": "http_ref",
"inputParameters": {
"uri": "https://orkes-api-tester.orkesconductor.com/api",
"method": "GET",
"accept": "application/json",
"contentType": "application/json",
"encode": true,
"asyncComplete": false
},
"type": "HTTP",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"onStateChange": {},
"permissive": false
},
"rateLimitPerFrequency": 0,
"rateLimitFrequencyInSeconds": 0,
"workflowPriority": 0,
"iteration": 0,
"subworkflowChanged": false,
"firstStartTime": 0,
"loopOverTask": false,
"taskDefinition": null,
"queueWaitTime": 0
}
],
"createdBy": "john.doe@acme.com",
"createTime": 1773825201814,
"status": "COMPLETED",
"updateTime": 1773825201862
}