Skip to main content

Module trigger

Module trigger 

Source
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 the trigger-nats feature 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,
    },
]);

Modules§

event
Domain-event trigger for workflow chaining.

Structs§

TriggerEvent
A request to create a workflow run, emitted by a Trigger.
TriggerSink
Channel endpoint for triggers to emit TriggerEvents.

Enums§

TriggerError
Error type for trigger operations.

Traits§

Trigger
A source of workflow run triggers.

Type Aliases§

TriggerFuture
Future returned by Trigger::start.