Workflow API
The Workflow API manages workflow executions. All endpoints use the base path /api/workflow.
For starting workflows, see Start Workflow API.
Retrieve Workflows
| Endpoint | Method | Description |
|---|---|---|
/{workflowId} |
GET |
Get workflow execution by ID |
/{workflowId}/tasks |
GET |
Get tasks for a workflow execution (paginated) |
/running/{name} |
GET |
Get running workflow IDs by type |
/{name}/correlated/{correlationId} |
GET |
Get workflows by correlation ID |
/{name}/correlated |
POST |
Get workflows for multiple correlation IDs |
Get Workflow by ID
| Parameter | Description | Default |
|---|---|---|
workflowId |
Workflow execution ID | — |
includeTasks |
Include task details in response | true |
Response 200 OK
{
"workflowId": "3a5b8c2d-1234-5678-9abc-def012345678",
"workflowName": "order_processing",
"workflowVersion": 1,
"status": "COMPLETED",
"startTime": 1700000000000,
"endTime": 1700000005000,
"input": {"orderId": "ORD-123"},
"output": {"paymentId": "PAY-456"},
"tasks": [
{
"taskId": "task-uuid",
"taskType": "HTTP",
"referenceTaskName": "validate",
"status": "COMPLETED",
"outputData": {"response": {"statusCode": 200}}
}
],
"correlationId": "order-123"
}
Get Tasks for a Workflow
Returns a paginated list of tasks for a workflow execution.
| Parameter | Description | Default |
|---|---|---|
start |
Page offset | 0 |
count |
Number of results | 15 |
status |
Filter by task status (can specify multiple) | All statuses |
# Get first 10 tasks
curl 'http://localhost:8080/api/workflow/3a5b8c2d.../tasks?count=10'
# Get only failed tasks
curl 'http://localhost:8080/api/workflow/3a5b8c2d.../tasks?status=FAILED'
Response 200 OK
{
"totalHits": 5,
"results": [
{
"taskId": "task-uuid",
"taskType": "HTTP",
"referenceTaskName": "validate",
"status": "COMPLETED"
}
]
}
Get Running Workflows
Returns a list of workflow IDs for running workflows of the given type.
| Parameter | Description | Default |
|---|---|---|
name |
Workflow name | — |
version |
Workflow version | 1 |
startTime |
Filter by start time (epoch ms) | — |
endTime |
Filter by end time (epoch ms) | — |
Response 200 OK
Get Workflows by Correlation ID
| Parameter | Description | Default |
|---|---|---|
includeClosed |
Include completed/terminated workflows | false |
includeTasks |
Include task details | false |
Get Workflows for Multiple Correlation IDs
curl -X POST 'http://localhost:8080/api/workflow/order_processing/correlated?includeClosed=true' \
-H 'Content-Type: application/json' \
-d '["order-123", "order-456", "order-789"]'
Response 200 OK — a map of correlation ID to list of workflows.
Manage Workflows
| Endpoint | Method | Description |
|---|---|---|
/{workflowId}/pause |
PUT |
Pause a workflow |
/{workflowId}/resume |
PUT |
Resume a paused workflow |
/{workflowId}/restart |
POST |
Restart a completed workflow from the beginning |
/{workflowId}/retry |
POST |
Retry the last failed task |
/{workflowId}/rerun |
POST |
Rerun from a specific task |
/{workflowId}/skiptask/{taskReferenceName} |
PUT |
Skip a task in a running workflow |
/{workflowId}/resetcallbacks |
POST |
Reset callback times for SIMPLE tasks |
/decide/{workflowId} |
PUT |
Trigger the decider for a workflow |
/{workflowId} |
DELETE |
Terminate a running workflow |
/{workflowId}/remove |
DELETE |
Remove a workflow from the system |
/{workflowId}/terminate-remove |
DELETE |
Terminate and remove in one call |
Pause
Pauses the workflow. No further tasks will be scheduled until resumed. Currently running tasks are not affected.
Resume
Restart
Restarts a completed workflow from the beginning. Current execution history is wiped out.
| Parameter | Description | Default |
|---|---|---|
useLatestDefinitions |
Use latest workflow and task definitions | false |
Retry
Retries the last failed task in the workflow.
| Parameter | Description | Default |
|---|---|---|
resumeSubworkflowTasks |
Also resume failed sub-workflow tasks | false |
Rerun
Re-runs a completed workflow from a specific task.
curl -X POST 'http://localhost:8080/api/workflow/3a5b8c2d.../rerun' \
-H 'Content-Type: application/json' \
-d '{
"reRunFromWorkflowId": "3a5b8c2d...",
"workflowInput": {"orderId": "ORD-999"},
"reRunFromTaskId": "task-uuid",
"taskInput": {"override": true}
}'
Skip Task
Skips a task in a running workflow and continues forward. Optionally provide updated input/output:
curl -X PUT 'http://localhost:8080/api/workflow/3a5b8c2d.../skiptask/validate_ref' \
-H 'Content-Type: application/json' \
-d '{
"taskInput": {},
"taskOutput": {"skipped": true, "reason": "manual override"}
}'
Reset Callbacks
Resets callback times of all non-terminal SIMPLE tasks to 0, causing them to be re-evaluated immediately.
Decide
Manually triggers the decider for a workflow. The decider evaluates workflow state and schedules the next tasks. Normally automatic — use this for debugging.
Terminate
| Parameter | Description | Required |
|---|---|---|
reason |
Reason for termination | No |
Remove
| Parameter | Description | Default |
|---|---|---|
archiveWorkflow |
Archive before removing | true |
Warning
This permanently removes the workflow execution data. Use with caution.
Terminate and Remove
Terminates a running workflow and removes it from the system in one call.
Search Workflows
All search endpoints support the same query parameters:
| Parameter | Description | Default |
|---|---|---|
start |
Page offset | 0 |
size |
Number of results | 100 |
sort |
Sort order: <field>:ASC or <field>:DESC |
— |
freeText |
Full-text search query | * |
query |
SQL-like where clause | — |
Search (Summary)
Returns SearchResult<WorkflowSummary> — lightweight results without full workflow details.
# Find completed workflows of a specific type
curl 'http://localhost:8080/api/workflow/search?query=workflowType%3D%27order_processing%27+AND+status%3D%27COMPLETED%27&size=10'
# Free-text search
curl 'http://localhost:8080/api/workflow/search?freeText=order-123'
Response 200 OK
{
"totalHits": 42,
"results": [
{
"workflowType": "order_processing",
"version": 1,
"workflowId": "3a5b8c2d...",
"correlationId": "order-123",
"startTime": "2024-01-15T10:30:00Z",
"updateTime": "2024-01-15T10:30:05Z",
"endTime": "2024-01-15T10:30:05Z",
"status": "COMPLETED",
"executionTime": 5000
}
]
}
Search V2 (Full)
Same parameters as search, but returns SearchResult<Workflow> — full workflow objects including task details.
Search by Tasks
Search for workflows based on task-level parameters. Returns SearchResult<WorkflowSummary>.
Search by Tasks V2
Returns SearchResult<Workflow> with full workflow objects.
Query Syntax
The query parameter supports SQL-like expressions:
| Example | Description |
|---|---|
workflowType = 'order_processing' |
Filter by workflow type |
status = 'FAILED' |
Filter by status |
startTime > 1700000000000 |
Filter by start time (epoch ms) |
workflowType = 'order_processing' AND status = 'COMPLETED' |
Combine conditions |
The freeText parameter supports Elasticsearch query syntax:
| Example | Description |
|---|---|
workflowType:"order_processing" |
Match workflow type |
order-123 |
Match any field |
Test Workflow
Test a workflow execution using mock data without actually running it. Useful for validating workflow definitions and task wiring before deployment.
curl -X POST 'http://localhost:8080/api/workflow/test' \
-H 'Content-Type: application/json' \
-d '{
"name": "my_workflow",
"version": 1,
"workflowDef": {...},
"taskRefToMockOutput": {
"my_task_ref": {
"key": "mocked_value"
}
}
}'
Response 200 OK — returns the simulated workflow execution with mocked task outputs.
External Storage
Get the URI for external payload storage. See External Payload Storage.