diff --git a/lib/crewai/src/crewai/events/types/flow_events.py b/lib/crewai/src/crewai/events/types/flow_events.py index a35254192..96302933c 100644 --- a/lib/crewai/src/crewai/events/types/flow_events.py +++ b/lib/crewai/src/crewai/events/types/flow_events.py @@ -67,6 +67,16 @@ class FlowFinishedEvent(FlowEvent): state: dict[str, Any] | BaseModel +class FlowFailedEvent(FlowEvent): + """Event emitted when a flow fails execution""" + + flow_name: str + error: Exception + type: str = "flow_failed" + + model_config = ConfigDict(arbitrary_types_allowed=True) + + class FlowPlotEvent(FlowEvent): """Event emitted when a flow plot is created"""