WorkflowHistory
Query workflow history events for specific executions
Audience: Programmer
Fetches workflow history events for executions matching the filter criteria. This query is designed to retrieve the complete history for specific workflow executions, replacing the removed history field from WorkflowExecutionInfo.
Use this query when you need to inspect workflow execution details, debug workflow behavior, or display workflow event timelines.
Arguments
where
WorkflowExecutionsWhereInput!
Filter criteria for workflow executions (required)
limit
Int
Maximum number of executions to fetch history for. Defaults to 10, max 100
Return Type
WorkflowExecutionHistoryConnection! - A connection containing workflow executions with their history events.
Connection Fields
edges
[WorkflowExecutionHistoryEdge!]!
List of workflow execution history edges
pageInfo
WorkflowPageInfo!
Pagination information
totalCount
Int!
Total count of matching executions
Edge Fields
node
WorkflowExecutionHistory!
The workflow execution with history
cursor
String!
Cursor for pagination
WorkflowExecutionHistory Fields
execution
WorkflowExecution!
The workflow execution identifier
typeName
String!
The workflow type name
history
[WorkflowEvent!]!
All history events for this execution
Filter Options
The where parameter accepts the same WorkflowExecutionsWhereInput as the workflowExecutions query, including support for logical operators (or, and, not) and advanced string predicates.
For complete documentation of all available filters, see workflowExecutions.
Common filters for history retrieval include:
workflowID
String
Exact workflow ID (recommended for single execution)
runID
String
Specific run ID
workflowIDIn
[String!]
Multiple workflow IDs
typeName
String
Filter by workflow type
status
String
Filter by status
Usage Examples
Get History for a Single Execution
Get History for Specific Run
Get History for Multiple Executions
Get History for Failed Workflows
Get History by Service and Data Type
Example Response
Common Event Types
EVENT_TYPE_WORKFLOW_EXECUTION_STARTED
Workflow began execution
EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED
Workflow completed successfully
EVENT_TYPE_WORKFLOW_EXECUTION_FAILED
Workflow failed with error
EVENT_TYPE_WORKFLOW_EXECUTION_CANCELED
Workflow was canceled
EVENT_TYPE_WORKFLOW_EXECUTION_TERMINATED
Workflow was forcefully terminated
EVENT_TYPE_WORKFLOW_EXECUTION_TIMED_OUT
Workflow exceeded timeout
EVENT_TYPE_WORKFLOW_TASK_SCHEDULED
Task scheduled for worker
EVENT_TYPE_WORKFLOW_TASK_STARTED
Worker started task
EVENT_TYPE_WORKFLOW_TASK_COMPLETED
Worker completed task
EVENT_TYPE_ACTIVITY_TASK_SCHEDULED
Activity scheduled
EVENT_TYPE_ACTIVITY_TASK_STARTED
Activity started
EVENT_TYPE_ACTIVITY_TASK_COMPLETED
Activity completed
EVENT_TYPE_ACTIVITY_TASK_FAILED
Activity failed
EVENT_TYPE_TIMER_STARTED
Timer started
EVENT_TYPE_TIMER_FIRED
Timer fired
EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED
Signal sent to another workflow
EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED
Workflow received signal
Performance Considerations
The
limitparameter defaults to 10 and has a maximum of 100Fetching history for many executions can be resource-intensive
For best performance, query specific workflows by
workflowIDorrunIDHistory events are returned in full; there is no pagination within a single execution's history
Consider using
workflowExecutionsfirst to identify specific executions, then query their history
Migration from history Field
If you were previously using the history field on WorkflowExecutionInfo:
Before:
After:
Notes
The
whereparameter is required - you must specify filter criteriaReturns all history events for each matching execution (no pagination within history)
Use the
limitparameter to control how many executions' histories are fetchedThis query replaces the removed
historyfield fromWorkflowExecutionInfoThe
extrafield in history events contains event-specific detailsLogical operators (
or,and,not) are fully supported for building complex filter conditions
Related Documentation
workflowExecutions - Query execution metadata
WorkflowExecutionHistory - History type
WorkflowExecutionHistoryConnection - Connection type
WorkflowEvent - Event type
WorkflowExecutionInfo - Execution info type
Last updated
Was this helpful?
