WorkflowEvent Type - Individual event in workflow execution history
Audience: Programmer
The WorkflowEvent type represents a single event in a Temporal workflow's execution history. Each event captures a specific action or state change that occurred during workflow execution, providing a detailed audit trail of the workflow's progress.
Fields
Field
Type
Description
eventId
Int!
Sequential identifier for the event within the workflow history
eventTime
String!
ISO 8601 timestamp when the event occurred
eventType
String!
The type of event (e.g., WorkflowExecutionStarted, ActivityTaskScheduled)
extra
Map
Additional event-specific attributes and data
Service
This type is defined in the Workflow service.
Event Types
Temporal workflows generate various event types throughout their execution. Common event types include:
Workflow Lifecycle Events
Event Type
Description
EVENT_TYPE_WORKFLOW_EXECUTION_STARTED
Workflow execution has begun
EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED
Workflow completed successfully
EVENT_TYPE_WORKFLOW_EXECUTION_FAILED
Workflow failed with an error
EVENT_TYPE_WORKFLOW_EXECUTION_TIMED_OUT
Workflow exceeded its timeout
EVENT_TYPE_WORKFLOW_EXECUTION_CANCELED
Workflow was canceled
EVENT_TYPE_WORKFLOW_EXECUTION_TERMINATED
Workflow was forcefully terminated
Activity Events
Event Type
Description
EVENT_TYPE_ACTIVITY_TASK_SCHEDULED
Activity task has been scheduled
EVENT_TYPE_ACTIVITY_TASK_STARTED
Activity task execution started
EVENT_TYPE_ACTIVITY_TASK_COMPLETED
Activity task completed successfully
EVENT_TYPE_ACTIVITY_TASK_FAILED
Activity task failed
EVENT_TYPE_ACTIVITY_TASK_TIMED_OUT
Activity task exceeded its timeout
Timer Events
Event Type
Description
EVENT_TYPE_TIMER_STARTED
Timer has been started
EVENT_TYPE_TIMER_FIRED
Timer has fired
EVENT_TYPE_TIMER_CANCELED
Timer was canceled
Workflow Task Events
Event Type
Description
EVENT_TYPE_WORKFLOW_TASK_SCHEDULED
Workflow task has been scheduled
EVENT_TYPE_WORKFLOW_TASK_STARTED
Workflow task execution started
EVENT_TYPE_WORKFLOW_TASK_COMPLETED
Workflow task completed
Usage Example
Query Workflow Execution with History
Query Recent Activity Events
Example Response
JavaScript Example
Use Cases
Debugging Failed Workflows
Query the history to identify where a workflow failed:
Monitoring Activity Performance
Analyze activity durations by examining the time between SCHEDULED, STARTED, and COMPLETED events.
Audit Trail
The history provides a complete audit trail of all actions taken during workflow execution, useful for compliance and debugging.