Test Workflow
Endpoint: POST /api/workflow/test
Tests a workflow execution using mock data. This endpoint can be used for unit tests.
When unit-testing workflows, only Worker tasks can be mocked to isolate external dependencies on workers. All other system tasks and operators cannot be mocked and will be executed against the server. Refer to Unit and Regression Tests for a guide on how to conduct unit tests
Request body
Format the request as an object containing the following parameters.
| Parameter | Description | Type | Required/ Optional |
|---|---|---|---|
| name | The name of the workflow to be tested. | string | Required. |
| version | The version of the workflow to be tested. If unspecified, the latest version will be used. | integer | Optional. |
| input | The workflow inputs for the test request. | object | Required if there are workflow inputs specified. |
| workflowDef | The workflow definition JSON of the workflow to be tested. | object | Required if you don’t want to use the JSON from the Conductor server. |
| taskRefToMockOutput | The mock output and status for Worker tasks, with the task reference name as the key. Example "taskRefToMockOutput": { "myTask_ref": [ { "status":"COMPLETED", "output": { "greet": "Hello, user." } } ] } | object | Required if there are Worker tasks. |
| subWorkflowTestRequest | The sub-workflow test request for mocking outputs in the sub-workflow’s Worker tasks. | object | Required if there are sub-workflows containing Worker tasks. |
| correlationId | A unique identifier used to correlate the current workflow execution with other executions of the same workflow. | string | Optional. |
| idempotencyKey | A unique, user-generated key to prevent duplicate workflow executions. Idempotency data is retained for the life of the workflow execution. | string | Optional. |
| idempotencyStrategy | The idempotency strategy for handling duplicate requests. Supported values:
| string | Required if idempotencyKey is used. |
| taskToDomain | A mapping of task reference names to domain-specific values to route the task to defined workers. | object | Optional. |
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' \
-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, showing the test execution of the http workflow using the workflow definition already stored in the Conductor server.
{
"ownerApp": "",
"createTime": 1770709155763,
"updateTime": 1770709155814,
"createdBy": "john.doe@acme.com",
"updatedBy": "john.doe@acme.com",
"status": "COMPLETED",
"endTime": 1770709155804,
"workflowId": "99cda0e3-0653-11f1-9b1b-c6f35360b671",
"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": 1770709155775,
"startTime": 1770709155775,
"endTime": 1770709155797,
"updateTime": 1770709155802,
"startDelayInSeconds": 0,
"retried": false,
"executed": true,
"callbackFromWorker": true,
"responseTimeoutSeconds": 0,
"workflowInstanceId": "99cda0e3-0653-11f1-9b1b-c6f35360b671",
"workflowType": "http",
"taskId": "99ceb25c-0653-11f1-9b1b-c6f35360b671",
"callbackAfterSeconds": 0,
"workerId": "orkes-conductor-deployment-584f9458c9-c2ttq",
"outputData": {
"response": {
"headers": {
"content-length": [
"182"
],
"content-type": [
"application/json"
],
"date": [
"Tue, 10 Feb 2026 07:39:15 GMT"
],
"strict-transport-security": [
"max-age=15724800; includeSubDomains"
]
},
"reasonPhrase": "",
"body": {
"randomString": "hjacazkrqrwqrukjjemd",
"randomInt": 4075,
"hostName": "orkes-api-sampler-67dfc8cf58-4lt28",
"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": 0
}
],
"input": {},
"output": {
"response": {
"headers": {
"content-length": [
"182"
],
"content-type": [
"application/json"
],
"date": [
"Tue, 10 Feb 2026 07:39:15 GMT"
],
"strict-transport-security": [
"max-age=15724800; includeSubDomains"
]
},
"reasonPhrase": "",
"body": {
"randomString": "hjacazkrqrwqrukjjemd",
"randomInt": 4075,
"hostName": "orkes-api-sampler-67dfc8cf58-4lt28",
"apiRandomDelay": "0 ms",
"sleepFor": "0 ms",
"statusCode": "200",
"queryParams": {}
},
"statusCode": 200
}
},
"taskToDomain": {
"*": "5b88f704-f090-47cc-9854-b8841ae4780f"
},
"failedReferenceTaskNames": [],
"workflowDefinition": {
"createTime": 1770651831951,
"updateTime": 1770707162316,
"name": "http",
"description": "http",
"version": 1,
"tasks": [
{
"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
}
],
"inputParameters": [],
"outputParameters": {},
"failureWorkflow": "",
"schemaVersion": 2,
"restartable": true,
"workflowStatusListenerEnabled": false,
"ownerEmail": "john.doe@acme.com",
"timeoutPolicy": "ALERT_ONLY",
"timeoutSeconds": 0,
"variables": {},
"inputTemplate": {},
"enforceSchema": true,
"metadata": {},
"maskedFields": []
},
"priority": 0,
"variables": {},
"lastRetriedTime": 0,
"failedTaskNames": [],
"history": [],
"rateLimited": false,
"startTime": 1770709155763,
"workflowName": "http",
"workflowVersion": 1
}
Test workflow using local workflow definition
Request
curl -X 'POST' \
'https://<YOUR-SERVER-URL>/api/workflow/test' \
-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": {},
"failureWorkflow": "",
"schemaVersion": 2,
"timeoutPolicy": "ALERT_ONLY",
"timeoutSeconds": 60,
"enforceSchema": false,
"metadata": {}
}
}'
Response
The workflow execution details are returned, showing the test execution using the local workflow definition provided in the request body.
{
"ownerApp": "",
"createTime": 1770714098807,
"updateTime": 1770714098807,
"createdBy": "john.doe@acme.com",
"status": "RUNNING",
"endTime": 0,
"workflowId": "1c164561-065f-11f1-9c6e-ba084417949a",
"tasks": [
{
"taskType": "HTTP",
"status": "SCHEDULED",
"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": 1770714098817,
"startTime": 0,
"endTime": 0,
"updateTime": 1770714098817,
"startDelayInSeconds": 0,
"retried": false,
"executed": false,
"callbackFromWorker": true,
"responseTimeoutSeconds": 0,
"workflowInstanceId": "1c164561-065f-11f1-9c6e-ba084417949a",
"workflowType": "myFirstWorkflow",
"taskId": "1c17cc0a-065f-11f1-9c6e-ba084417949a",
"callbackAfterSeconds": 0,
"outputData": {},
"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
}
],
"input": {},
"output": {},
"taskToDomain": {
"*": "d12d9688-2241-4746-8354-3e3420ad1035"
},
"failedReferenceTaskNames": [],
"workflowDefinition": {
"createTime": 0,
"updateTime": 0,
"name": "myFirstWorkflow",
"version": 1,
"tasks": [
{
"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
}
],
"inputParameters": [],
"outputParameters": {},
"failureWorkflow": "",
"schemaVersion": 2,
"restartable": true,
"workflowStatusListenerEnabled": false,
"timeoutPolicy": "ALERT_ONLY",
"timeoutSeconds": 60,
"variables": {},
"inputTemplate": {},
"enforceSchema": false,
"metadata": {},
"maskedFields": []
},
"priority": 0,
"variables": {},
"lastRetriedTime": 0,
"failedTaskNames": [],
"history": [],
"rateLimited": false,
"startTime": 1770714098807,
"workflowName": "myFirstWorkflow",
"workflowVersion": 1
}
Test workflow with mock Worker tasks
Request
curl -X 'POST' \
'https://<YOUR-SERVER-URL>/api/workflow/test' \
-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"
},
{
"name": "myTask",
"taskReferenceName": "myTask_ref",
"inputParameters": {
"name": "${get-user_ref.output.response.body.results[0].name.first}"
},
"type": "SIMPLE"
}
],
"inputParameters": [],
"outputParameters": {},
"failureWorkflow": "",
"schemaVersion": 2,
"timeoutPolicy": "ALERT_ONLY",
"timeoutSeconds": 60,
"enforceSchema": false,
"metadata": {}
},
"taskRefToMockOutput": {
"myTask_ref": [
{
"status":"COMPLETED",
"output": {
"greet": "Hello, user."
}
}
]
}
}
'
Response
The workflow execution details are returned with the Worker task (myTask_ref) showing the mocked output instead of executing the actual worker.
{
"ownerApp": "",
"createTime": 1770709472215,
"updateTime": 1770709472298,
"createdBy": "john.doe@acme.com",
"updatedBy": "john.doe@acme.com",
"status": "COMPLETED",
"endTime": 1770709472296,
"workflowId": "566c403f-0654-11f1-9b1b-c6f35360b671",
"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": 1770709472239,
"startTime": 1770709472239,
"endTime": 1770709472260,
"updateTime": 1770709472272,
"startDelayInSeconds": 0,
"retried": false,
"executed": true,
"callbackFromWorker": true,
"responseTimeoutSeconds": 0,
"workflowInstanceId": "566c403f-0654-11f1-9b1b-c6f35360b671",
"workflowType": "myFirstWorkflow",
"taskId": "566dedf8-0654-11f1-9b1b-c6f35360b671",
"callbackAfterSeconds": 0,
"workerId": "orkes-conductor-deployment-584f9458c9-c2ttq",
"outputData": {
"response": {
"headers": {
"alt-svc": [
"h3=\":443\"; ma=86400"
],
"cf-cache-status": [
"DYNAMIC"
],
"cf-ray": [
"9cb9fb5988ce64aa-IAD"
],
"content-type": [
"application/json"
],
"date": [
"Tue, 10 Feb 2026 07:44:32 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=PaWZxyT4tdHG8P904rkHOK6srGgtcJGmRjB7LOoCgJEld4SBbrL5%2FcNwC9JsnjvboDLBQxqk5GQpZkC9T2cRTmlTPMkFVYwUtSbBRu8%3D\"}]}"
],
"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
},
{
"taskType": "myTask",
"status": "COMPLETED",
"inputData": {
"name": null,
"_createdBy": "john.doe@acme.com"
},
"referenceTaskName": "myTask_ref",
"retryCount": 0,
"seq": 2,
"pollCount": 0,
"taskDefName": "myTask",
"scheduledTime": 1770709472265,
"startTime": 0,
"endTime": 1770709472285,
"updateTime": 1770709472294,
"startDelayInSeconds": 0,
"retried": false,
"executed": true,
"callbackFromWorker": true,
"responseTimeoutSeconds": 3600,
"workflowInstanceId": "566c403f-0654-11f1-9b1b-c6f35360b671",
"workflowType": "myFirstWorkflow",
"taskId": "5673ba65-0654-11f1-9b1b-c6f35360b671",
"callbackAfterSeconds": 0,
"outputData": {
"greet": "Hello, user."
},
"workflowTask": {
"name": "myTask",
"taskReferenceName": "myTask_ref",
"inputParameters": {
"name": "${get-user_ref.output.response.body.results[0].name.first}"
},
"type": "SIMPLE",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"taskDefinition": {
"createTime": 0,
"updateTime": 0,
"name": "myTask",
"retryCount": 3,
"timeoutSeconds": 0,
"inputKeys": [],
"outputKeys": [],
"timeoutPolicy": "TIME_OUT_WF",
"retryLogic": "FIXED",
"retryDelaySeconds": 60,
"responseTimeoutSeconds": 3600,
"inputTemplate": {},
"rateLimitPerFrequency": 0,
"rateLimitFrequencyInSeconds": 1,
"backoffScaleFactor": 1,
"totalTimeoutSeconds": 0,
"enforceSchema": false
},
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"onStateChange": {},
"permissive": false
},
"domain": "9b030f7c-3424-4463-a17a-2d710019a1ec",
"rateLimitPerFrequency": 0,
"rateLimitFrequencyInSeconds": 1,
"workflowPriority": 0,
"iteration": 0,
"subworkflowChanged": false,
"firstStartTime": 0,
"loopOverTask": false,
"taskDefinition": {
"createTime": 0,
"updateTime": 0,
"name": "myTask",
"retryCount": 3,
"timeoutSeconds": 0,
"inputKeys": [],
"outputKeys": [],
"timeoutPolicy": "TIME_OUT_WF",
"retryLogic": "FIXED",
"retryDelaySeconds": 60,
"responseTimeoutSeconds": 3600,
"inputTemplate": {},
"rateLimitPerFrequency": 0,
"rateLimitFrequencyInSeconds": 1,
"backoffScaleFactor": 1,
"totalTimeoutSeconds": 0,
"enforceSchema": false
},
"queueWaitTime": 0
}
],
"input": {},
"output": {
"greet": "Hello, user."
},
"taskToDomain": {
"*": "9b030f7c-3424-4463-a17a-2d710019a1ec"
},
"failedReferenceTaskNames": [],
"workflowDefinition": {
"createTime": 0,
"updateTime": 0,
"name": "myFirstWorkflow",
"version": 1,
"tasks": [
{
"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
},
{
"name": "myTask",
"taskReferenceName": "myTask_ref",
"inputParameters": {
"name": "${get-user_ref.output.response.body.results[0].name.first}"
},
"type": "SIMPLE",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"taskDefinition": {
"createTime": 0,
"updateTime": 0,
"name": "myTask",
"retryCount": 3,
"timeoutSeconds": 0,
"inputKeys": [],
"outputKeys": [],
"timeoutPolicy": "TIME_OUT_WF",
"retryLogic": "FIXED",
"retryDelaySeconds": 60,
"responseTimeoutSeconds": 3600,
"inputTemplate": {},
"rateLimitPerFrequency": 0,
"rateLimitFrequencyInSeconds": 1,
"backoffScaleFactor": 1,
"totalTimeoutSeconds": 0,
"enforceSchema": false
},
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"onStateChange": {},
"permissive": false
}
],
"inputParameters": [],
"outputParameters": {},
"failureWorkflow": "",
"schemaVersion": 2,
"restartable": true,
"workflowStatusListenerEnabled": false,
"timeoutPolicy": "ALERT_ONLY",
"timeoutSeconds": 60,
"variables": {},
"inputTemplate": {},
"enforceSchema": false,
"metadata": {},
"maskedFields": []
},
"priority": 0,
"variables": {},
"lastRetriedTime": 0,
"failedTaskNames": [],
"history": [],
"rateLimited": false,
"startTime": 1770709472215,
"workflowName": "myFirstWorkflow",
"workflowVersion": 1
}