Skip to main content

Module event

Module event 

Source
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§

EventTrigger
A trigger that reacts to internal domain events.
EventTriggerRule
A rule that maps a domain event to a workflow to trigger.
TriggerContext
Context available to TriggerConditions when evaluating whether a rule should fire.

Enums§

TriggerCondition
A condition that must be satisfied for an EventTriggerRule to fire.

Constants§

CHAIN_DEPTH_LABEL
Label key used to track chaining depth on triggered runs.