Overview
Workflow types define the core structures for workflow execution in Cadence. These types are used across all services to represent workflow state, decisions, and execution metadata. Source Location:common/types/shared.go
Workflow Execution Types
WorkflowExecution
Uniquely identifies a workflow execution instance.Business identifier for the workflow. Must be unique per domain according to the
WorkflowIdReusePolicy.Unique identifier for this specific run of the workflow. Generated by Cadence when the workflow starts.
WorkflowType
Identifies the workflow implementation type.Name of the workflow type, must match the registered workflow implementation.
WorkflowExecutionInfo
Contains comprehensive information about a workflow execution.Workflow execution identifier
Workflow type
Unix timestamp (nanoseconds) when workflow started
Unix timestamp (nanoseconds) when workflow closed
Final status if workflow is closed (Completed, Failed, Canceled, Terminated, ContinuedAsNew, TimedOut)
Total number of events in workflow history
Domain UUID of parent workflow if this is a child workflow
Parent workflow execution if this is a child workflow
Actual execution start time (may differ from StartTime for cron workflows)
Non-indexed workflow metadata
Indexed attributes for advanced visibility queries
Auto-generated reset points in workflow history
Task list name for decision tasks
Whether this is a cron workflow
WorkflowExecutionConfiguration
Configuration settings for a workflow execution.Task list for decision tasks
Maximum workflow execution duration in seconds
Maximum decision task duration in seconds
Workflow Close Status
WorkflowExecutionCloseStatus
Enumeration of possible workflow completion states.Workflow completed successfully
Workflow failed with an error
Workflow was canceled
Workflow was forcefully terminated
Workflow continued as a new execution
Workflow execution timed out
Decision Types
Decision
Represents a decision made by the workflow during decision task processing.DecisionType
Enumeration of decision types.Activity Types
ActivityType
Identifies an activity implementation.Name of the activity type, must match the registered activity implementation.
ScheduleActivityTaskDecisionAttributes
Attributes for scheduling an activity task.Unique identifier for this activity within the workflow
Type of activity to execute
Domain for cross-domain activities (defaults to workflow domain)
Task list to dispatch the activity to
Serialized activity input
Maximum time from schedule to completion
Maximum time from schedule until activity starts
Maximum time from start to completion
Maximum time between heartbeats
Retry policy for automatic retries
Context propagation headers
Request activity execution on same worker as decision task
Workflow Completion Types
CompleteWorkflowExecutionDecisionAttributes
Complete a workflow successfully.Serialized workflow result
FailWorkflowExecutionDecisionAttributes
Fail a workflow with an error.Error reason/message
Serialized error details
CancelWorkflowExecutionDecisionAttributes
Cancel a workflow.Serialized cancellation details
ContinueAsNewWorkflowExecutionDecisionAttributes
Continue the workflow as a new execution.Workflow type for new execution (defaults to current type)
Task list for new execution (defaults to current)
Input for new execution
Execution timeout for new run
Decision task timeout for new run
Delay before starting new execution
What triggered continue-as-new (Decider, RetryPolicy, CronSchedule)
Result from current execution
Cron schedule for new execution
Timer Types
StartTimerDecisionAttributes
Start a durable timer.Unique identifier for this timer
Duration until timer fires (in seconds)
CancelTimerDecisionAttributes
Cancel a pending timer.ID of the timer to cancel
Child Workflow Types
StartChildWorkflowExecutionDecisionAttributes
Start a child workflow execution.Domain for child workflow (defaults to parent domain)
Workflow ID for child execution
Child workflow type
What to do with child when parent closes (Abandon, RequestCancel, Terminate)
Opaque control data passed to child
Marker Types
RecordMarkerDecisionAttributes
Record a marker event in workflow history.Name of the marker
Serialized marker details
Context headers
- Side effects tracking
- Local activities
- Workflow versioning markers
- Custom instrumentation
External Workflow Types
SignalExternalWorkflowExecutionDecisionAttributes
Send a signal to another workflow.Domain of target workflow
Target workflow execution (RunID optional)
Name of signal to send
Serialized signal payload
Only signal if target is a child workflow
RequestCancelExternalWorkflowExecutionDecisionAttributes
Request cancellation of another workflow.Domain of target workflow
Workflow ID to cancel
Specific run ID to cancel (optional)
Only cancel if target is a child workflow
Search Attributes
UpsertWorkflowSearchAttributesDecisionAttributes
Update workflow search attributes.New or updated search attributes
SearchAttributes
Indexed attributes for advanced visibility.Map of attribute names to serialized values. Supported types: String, Int, Double, Bool, Datetime, Keyword.
Retry Policy
RetryPolicy
Defines automatic retry behavior.Initial retry delay
Backoff multiplier (must be >= 1.0)
Maximum retry delay cap
Maximum retry attempts (0 = unlimited)
Error reasons that should not trigger retry
Total retry window duration
Memo
Memo
Non-indexed workflow metadata.Map of field names to serialized values. Not indexed, but can be retrieved.
- Large metadata that doesn’t need indexing
- Binary data
- Structured context information
Header
Header
Context propagation headers.Map of header names to serialized values. Propagated to activities and child workflows.
- Tracing context (trace ID, span ID)
- Authentication tokens
- Request metadata
- Feature flags
Pending Execution Info
PendingActivityInfo
Information about a pending activity.PendingChildExecutionInfo
Information about a pending child workflow.PendingDecisionInfo
Information about a pending decision task.Reset Points
ResetPoints
Auto-generated reset points for workflow reset.ResetPointInfo
Information about a single reset point.Checksum of worker binary at this point
Event ID of first decision task completion
Whether workflow can be reset to this point
Workflow ID Reuse Policy
WorkflowIDReusePolicy
Policy for reusing workflow IDs.Allow starting if previous execution failed, canceled, or terminated
Allow starting regardless of previous execution status
Reject if any previous execution exists
Terminate existing execution and start new one
Parent Close Policy
ParentClosePolicy
Policy for child workflow when parent closes.Leave child workflow running
Request cancellation of child workflow
Forcefully terminate child workflow
See Also
- Frontend Service API - Workflow execution APIs
- History Service API - Workflow state management
- Domain Types - Domain configuration types
- Task Types - Task-related type definitions