Skip to main content

Module notify

Module notify 

Source
Expand description

Event-driven notification system for the ironflow lifecycle.

Uses a publisher/subscriber pattern: the EventPublisher broadcasts Events to registered EventSubscribers. Event type filtering is handled by the publisher at subscription time – subscribers only receive events they signed up for.

Built-in subscribers:

§Architecture

  • Event – domain event enum covering runs, steps, approvals, auth.
  • EventSubscriber – trait: receives and handles a single event.
  • EventPublisher – holds subscriptions (subscriber + event type filter), dispatches matching events via tokio::spawn.
  • MessageFormatter – trait: converts events into platform-specific messages.
  • RetryConfig – shared retry/backoff configuration for HTTP subscribers.
  • WebhookSubscriber – built-in HTTP POST implementation.

§Examples

use ironflow_engine::notify::{Event, EventPublisher, WebhookSubscriber};

let mut publisher = EventPublisher::new();
publisher.subscribe(
    WebhookSubscriber::new("https://hooks.example.com/events"),
    &[Event::RUN_STATUS_CHANGED, Event::STEP_FAILED],
);

Structs§

ApprovalGrantedEvent
Payload of the Event::ApprovalGranted event.
ApprovalRejectedEvent
Payload of the Event::ApprovalRejected event.
ApprovalRequestedEvent
Payload of the Event::ApprovalRequested event.
AuditLogSubscriber
Subscriber that persists every received event as an audit log entry.
BetterStackSubscriber
Subscriber that forwards error events to BetterStack Logs.
EventPublisher
Broadcasts Events to registered EventSubscribers.
FormattedMessage
A formatted message ready to be sent to an external platform.
LogLineEvent
Payload of the Event::LogLine event.
RetryConfig
Configuration for retry behaviour on outbound HTTP calls.
RetryForcedEvent
Payload of the Event::RetryForced event.
RunBudgetExceededEvent
Payload of the Event::RunBudgetExceeded event.
RunCreatedEvent
Payload of the Event::RunCreated event.
RunFailedEvent
Payload of the Event::RunFailed event.
RunStatusChangedEvent
Payload of the Event::RunStatusChanged event.
StepCompletedEvent
Payload of the Event::StepCompleted event.
StepFailedEvent
Payload of the Event::StepFailed event.
UserSignedInEvent
Payload of the Event::UserSignedIn event.
UserSignedOutEvent
Payload of the Event::UserSignedOut event.
UserSignedUpEvent
Payload of the Event::UserSignedUp event.
WebhookSubscriber
Subscriber that POSTs the event as JSON to a webhook URL.
WorkflowAgentStepTokensUsedEvent
Payload of the WorkflowEvent::AgentStepTokensUsed workflow event.
WorkflowApprovalRequiredEvent
Payload of the WorkflowEvent::ApprovalRequired workflow event.
WorkflowEventBus
Per-workflow broadcast event bus for real-time monitoring.
WorkflowStepCompletedEvent
Payload of the WorkflowEvent::StepCompleted workflow event.
WorkflowStepFailedEvent
Payload of the WorkflowEvent::StepFailed workflow event.
WorkflowStepStartedEvent
Payload of the WorkflowEvent::StepStarted workflow event.

Enums§

Event
A domain event emitted by the ironflow system.
LogStream
Output stream for a log line.
WorkflowEvent
A granular step-level event for real-time workflow monitoring.

Traits§

EventSubscriber
A subscriber that reacts to domain events.
MessageFormatter
Converts domain events into platform-specific messages.

Functions§

deliver_with_retry
Execute an HTTP request with retry and exponential backoff.
is_accepted_202
Returns true when the response status is exactly 202 Accepted.
is_success_2xx
Returns true when the response status is 2xx.

Type Aliases§

SubscriberFuture
Boxed future returned by EventSubscriber::handle.