Event Overview
All workflow and activity events are dispatched using Laravel’s event system and can be listened to using standard Laravel event listeners.Workflow Events
WorkflowStarted
Dispatched when a workflow begins execution. Class:Workflow\Events\WorkflowStarted
Properties:
workflowId(int|string) - Unique identifier for the workflow instanceclass(string) - Fully qualified class name of the workflowarguments(string) - Serialized arguments passed to the workflowtimestamp(string) - ISO 8601 timestamp when the workflow started
WorkflowCompleted
Dispatched when a workflow completes successfully. Class:Workflow\Events\WorkflowCompleted
Properties:
workflowId(int|string) - Unique identifier for the workflow instanceoutput(string) - Serialized output returned by the workflowtimestamp(string) - ISO 8601 timestamp when the workflow completed
WorkflowFailed
Dispatched when a workflow fails with an exception. Class:Workflow\Events\WorkflowFailed
Properties:
workflowId(int|string) - Unique identifier for the workflow instanceoutput(string) - Serialized exception or error informationtimestamp(string) - ISO 8601 timestamp when the workflow failed
Activity Events
ActivityStarted
Dispatched when an activity begins execution within a workflow. Class:Workflow\Events\ActivityStarted
Properties:
workflowId(int|string) - ID of the parent workflowactivityId(string) - Unique identifier for this activity executionclass(string) - Fully qualified class name of the activityindex(int) - Sequential index of this activity in the workflow executionarguments(string) - Serialized arguments passed to the activitytimestamp(string) - ISO 8601 timestamp when the activity started
ActivityCompleted
Dispatched when an activity completes successfully. Class:Workflow\Events\ActivityCompleted
Properties:
workflowId(int|string) - ID of the parent workflowactivityId(string) - Unique identifier for this activity executionclass(string) - Fully qualified class name of the activityindex(int) - Sequential index of this activity in the workflow executionoutput(string) - Serialized output returned by the activitytimestamp(string) - ISO 8601 timestamp when the activity completed
ActivityFailed
Dispatched when an activity fails with an exception. Class:Workflow\Events\ActivityFailed
Properties:
workflowId(int|string) - ID of the parent workflowactivityId(string) - Unique identifier for this activity executionclass(string) - Fully qualified class name of the activityindex(int) - Sequential index of this activity in the workflow executionoutput(string) - Serialized exception or error informationtimestamp(string) - ISO 8601 timestamp when the activity failed
State Management Events
StateChanged
Dispatched when a workflow or model transitions between states. Class:Workflow\Events\StateChanged
Properties:
initialState(?State) - The state before transition (null if starting)finalState(?State) - The state after transition (null if ending)model(Model) - The Eloquent model whose state changedfield(string) - The field name that stores the state
Registering Event Listeners
You can register event listeners in yourEventServiceProvider:
Common Use Cases
Custom Monitoring
Track workflow performance metrics:Error Notifications
Send notifications when workflows fail:Audit Logging
Maintain an audit trail of workflow executions:Next Steps
- Explore the Waterline UI for visual monitoring
- Learn about workflow logging for accessing execution history