ironflow-runtime 2.1.3

Runtime daemon for ironflow: webhooks (axum) and cron scheduling
Documentation

ironflow-runtime

The daemon/server layer for ironflow, providing webhook HTTP endpoints and cron scheduling on top of [ironflow_core] operations.

This crate exposes a [runtime::Runtime] builder that lets you declaratively register webhook routes (with pluggable authentication) and cron jobs, then either start a full Axum HTTP server via [runtime::Runtime::serve] or run only the cron scheduler via [runtime::Runtime::run_crons], both with graceful shutdown support.

Quick start

use ironflow_runtime::prelude::*;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    Runtime::new()
        .webhook("/hooks/github", WebhookAuth::github("my-secret"), |payload| async move {
            println!("received: {payload}");
        })
        .cron("0 */5 * * * *", "health-check", || async {
            println!("running health check");
        })
        .serve("0.0.0.0:3000")
        .await?;

    Ok(())
}

Modules

  • [runtime] - The [runtime::Runtime] builder and HTTP server.
  • [webhook] - Webhook authentication strategies ([webhook::WebhookAuth]).
  • cron - Internal cron job representation (crate-private).