Expand description
Pluggable trigger sources for starting workflow runs.
A Trigger listens for external or internal signals and emits
TriggerEvents through a TriggerSink. The runtime starts all
registered triggers alongside the HTTP server and cron scheduler, and
forwards their events to the configured handler.
Built-in triggers:
EventTrigger– reacts to internal domain events (workflow chaining).NatsTrigger– consumes messages from a NATS JetStream subject (behind thetrigger-natsfeature flag).
§Examples
use ironflow_runtime::trigger::{Trigger, TriggerSink, TriggerEvent};
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![],
},
]);Modules§
- event
- Domain-event trigger for workflow chaining.
Structs§
- Trigger
Event - A request to create a workflow run, emitted by a
Trigger. - Trigger
Sink - Channel endpoint for triggers to emit
TriggerEvents.
Enums§
- Trigger
Error - Error type for trigger operations.
Traits§
- Trigger
- A source of workflow run triggers.
Type Aliases§
- Trigger
Future - Future returned by
Trigger::start.