Expand description
Domain-event trigger for workflow chaining.
EventTrigger subscribes to the EventPublisher
and creates a new run whenever a matching event fires. This allows
declarative workflow chaining without external infrastructure.
§Anti-loop protection
Each triggered run carries a _chain_depth label. When the depth
reaches max_chain_depth, the trigger ignores the event and logs a
warning. This prevents two workflows from triggering each other
indefinitely.
§Examples
use ironflow_runtime::trigger::event::{EventTrigger, EventTriggerRule};
use ironflow_store::entities::EventKind;
let trigger = EventTrigger::new(vec![
EventTriggerRule {
on_event: EventKind::RunFailed,
source_workflow: "deploy".to_string(),
target_workflow: "rollback".to_string(),
max_chain_depth: 3,
conditions: vec![],
},
]);Structs§
- Event
Trigger - A trigger that reacts to internal domain events.
- Event
Trigger Rule - A rule that maps a domain event to a workflow to trigger.
- Trigger
Context - Context available to
TriggerConditions when evaluating whether a rule should fire.
Enums§
- Trigger
Condition - A condition that must be satisfied for an
EventTriggerRuleto fire.
Constants§
- CHAIN_
DEPTH_ LABEL - Label key used to track chaining depth on triggered runs.