The workflow command group provides operations for managing workflow executions throughout their lifecycle.
Command Overview
cadence workflow [command] [flags]
Short alias: wf
cadence wf list # Same as: cadence workflow list
Starting Workflows
Start a new workflow execution without waiting for completion.
cadence workflow start \
--workflow_type MyWorkflow \
--tasklist my-tasklist \
--execution_timeout 3600 \
--input '{"name": "value"}'
Name of the workflow type to execute
Task list name for workflow execution
Unique workflow ID. Auto-generated if not provided
Workflow input as JSON string
Workflow execution timeout in seconds (0 = no timeout)
Decision task timeout in seconds
Cron schedule for periodic workflow execution
Workflow ID reuse policy: AllowDuplicate, AllowDuplicateFailedOnly, RejectDuplicate
Start a workflow and wait for completion, showing progress.
cadence workflow run \
--workflow_type MyWorkflow \
--tasklist my-tasklist \
--input '{"count": 10}'
Same parameters as start, plus automatically shows workflow result.
Querying Workflows
List open or closed workflow executions.
# List closed workflows
cadence workflow list --open=false
# Filter by workflow type
cadence workflow list --workflow_type MyWorkflow
# Custom query
cadence workflow list --query "WorkflowType='MyWorkflow' AND StartTime > '2024-01-01'"
List open workflows (true) or closed workflows (false)
Number of results per page
SQL-like query for advanced filtering
listall
List all workflows without pagination.
cadence workflow listall --query "WorkflowType='MyWorkflow'"
Fast scan of workflow executions (requires ElasticSearch).
cadence workflow scan --query "WorkflowType='MyWorkflow'"
The scan command is faster than listall but results are not sorted. Requires ElasticSearch to be enabled on the Cadence server.
Count workflow executions matching a query.
cadence workflow count --query "WorkflowType='MyWorkflow' AND CloseStatus='Completed'"
Inspecting Workflows
describe
Show detailed information about a workflow execution.
cadence workflow describe -w my-workflow-id
# With run ID for specific execution
cadence workflow describe -w my-workflow-id -r abc123
Run ID for specific execution (defaults to current/latest)
describeid
Shortcut for describe using positional arguments.
cadence workflow describeid my-workflow-id
# With run ID
cadence workflow describeid my-workflow-id abc123
Display workflow execution history.
cadence workflow show -w my-workflow-id
# Save history to file
cadence workflow show -w my-workflow-id --output_filename history.json
# Print with timestamps
cadence workflow show -w my-workflow-id --print_datetime
# Show specific event
cadence workflow show -w my-workflow-id --event_id 5
Print timestamps for events
Print raw Unix timestamps
Show specific event by ID
Shortcut for show using positional arguments.
cadence workflow showid my-workflow-id
observe
Continuously watch workflow execution progress.
cadence workflow observe -w my-workflow-id
Shows real-time updates as the workflow progresses.
Signaling Workflows
Send a signal to a running workflow.
cadence workflow signal \
-w my-workflow-id \
--signal_name UpdateConfig \
--input '{"setting": "value"}'
Specific run ID (defaults to current)
signalwithstart
Signal an existing workflow or start a new one if it doesn’t exist.
cadence workflow signalwithstart \
-w my-workflow-id \
--workflow_type MyWorkflow \
--tasklist my-tasklist \
--signal_name ProcessData \
--input '{"data": "value"}'
Combines parameters from both start and signal commands.
Querying Workflow State
Query workflow state without affecting execution.
cadence workflow query \
-w my-workflow-id \
--query_type GetStatus
# With query arguments
cadence workflow query \
-w my-workflow-id \
--query_type GetDetails \
--input '{"field": "name"}'
Name of the query handler
query-types
List available query types for a workflow.
cadence workflow query-types -w my-workflow-id
Get workflow stack trace using the built-in __stack_trace query.
cadence workflow stack -w my-workflow-id
Stopping Workflows
Gracefully stop a workflow, allowing cleanup.
cadence workflow cancel -w my-workflow-id
# With reason
cadence workflow cancel -w my-workflow-id --reason "User requested cancellation"
Cancel allows the workflow to run cleanup code. Use terminate for immediate stop.
terminate
Force-stop a workflow without cleanup.
cadence workflow terminate -w my-workflow-id
# With reason
cadence workflow terminate -w my-workflow-id --reason "Invalid state detected"
Terminate immediately stops the workflow without running cleanup logic. Use cancel for graceful shutdown.
Workflow Reset
Reset a workflow to a specific event.
# Reset to specific event ID
cadence workflow reset \
-w my-workflow-id \
--event_id 15 \
--reason "Recovering from bad deployment"
# Reset to last decision
cadence workflow reset \
-w my-workflow-id \
--reset_type LastDecisionCompleted \
--reason "Reprocessing from checkpoint"
Event ID to reset to (exclusive)
Reset type: FirstDecisionCompleted, LastDecisionCompleted, BadBinary, DecisionCompletedTime
Reason for reset (required for tracking)
--reset_bad_binary_checksum
Binary checksum for BadBinary reset type
Earliest time for DecisionCompletedTime reset. Formats: RFC3339, Unix nano, or time range (e.g., ‘15m’)
Skip reapplying signals after reset point
reset-batch
Reset multiple workflows from a file or query.
# From file
cadence workflow reset-batch \
--input_file workflows.txt \
--reset_type LastDecisionCompleted \
--reason "Bulk recovery"
# From query
cadence workflow reset-batch \
--query "WorkflowType='MyWorkflow' AND CloseStatus='Failed'" \
--reset_type LastDecisionCompleted \
--reason "Recovering failed workflows"
File with workflow IDs (one per line, format: workflowID [runID])
Query to select workflows for reset
Number of parallel reset operations
Preview reset without executing
restart
Restart a completed workflow execution.
cadence workflow restart -w my-workflow-id
refresh-tasks
Refresh workflow tasks to resume progress.
cadence workflow refresh-tasks -w my-workflow-id
Activity Operations
activity complete
Manually complete an activity.
cadence workflow activity complete \
-w my-workflow-id \
--activity_id my-activity \
--result '{"status": "done"}'
activity fail
Manually fail an activity.
cadence workflow activity fail \
-w my-workflow-id \
--activity_id my-activity \
--reason "External system unavailable"
Batch Operations
See the Batch Commands page for batch operation details.
Examples
Start a workflow with cron schedule
cadence workflow start \
--workflow_type DailyReport \
--tasklist reports \
--cron "0 9 * * *" \
--input '{"report_type": "daily"}'
Query workflow status
cadence workflow query \
-w order-12345 \
--query_type GetOrderStatus
Reset failed workflows
cadence workflow reset-batch \
--query "CloseStatus='Failed' AND StartTime > '2024-01-01'" \
--reset_type LastDecisionCompleted \
--reason "Recovering from outage" \
--parallelism 10
Watch workflow progress
cadence workflow observe -w long-running-workflow
Output Examples
Workflow List
WORKFLOW TYPE | WORKFLOW ID | RUN ID | START TIME | EXECUTION TIME
MyWorkflow | wf-001 | abc123 | 2024-01-15 | 2m 30s
MyWorkflow | wf-002 | def456 | 2024-01-15 | 1m 45s
Workflow Describe
{
"executionConfiguration" : {
"taskList" : { "name" : "my-tasklist" },
"executionStartToCloseTimeoutSeconds" : 3600 ,
"taskStartToCloseTimeoutSeconds" : 10
},
"workflowExecutionInfo" : {
"execution" : {
"workflowId" : "my-workflow-id" ,
"runId" : "abc123"
},
"type" : { "name" : "MyWorkflow" },
"startTime" : "2024-01-15T10:00:00Z" ,
"closeStatus" : "COMPLETED"
}
}
Next Steps
Domain Commands Configure workflow domains
Batch Commands Bulk workflow operations
Task List Commands Monitor task lists
Workflow Concepts Learn about workflows