ironflow-api 2.1.1

REST API for ironflow run management and observability
Documentation

ironflow-api

REST API crate for the ironflow workflow engine. Provides endpoints for querying workflow runs, managing their lifecycle, and viewing aggregate statistics.

Architecture

  • entities/ — DTOs and query parameter types (public API contract)
  • routes/ — One file per route handler
  • error.rs — Typed API errors mapped to HTTP status codes
  • response.rs — Standard response envelope
  • state.rs — Shared application state

API Endpoints

Health check

  • GET /api/v1/health-check — Liveness probe, always returns 200 OK

Runs

  • GET /api/v1/runs — List runs with optional filtering and pagination
  • POST /api/v1/runs — Trigger a workflow
  • GET /api/v1/runs/:id — Get run details and steps
  • POST /api/v1/runs/:id/cancel — Cancel a pending or running run
  • POST /api/v1/runs/:id/retry — Retry a failed run (creates new run)

Workflows

  • GET /api/v1/workflows — List registered workflows

Statistics

  • GET /api/v1/stats — Aggregate statistics (total runs, success rate, cost, etc.)

Quick start

use ironflow_api::prelude::*;
use ironflow_api::routes::create_router;
use ironflow_store::prelude::*;
use ironflow_engine::engine::Engine;
use ironflow_core::providers::claude::ClaudeCodeProvider;
use ironflow_auth::jwt::JwtConfig;
use std::sync::Arc;

# async fn example() {
let store = Arc::new(InMemoryStore::new());
let user_store: Arc<dyn ironflow_store::user_store::UserStore> = Arc::new(InMemoryStore::new());
let provider = Arc::new(ClaudeCodeProvider::new());
let engine = Arc::new(Engine::new(store.clone(), provider));
let jwt_config = Arc::new(JwtConfig {
    secret: "your-secret-key".to_string(),
    access_token_ttl_secs: 900,
    refresh_token_ttl_secs: 604800,
    cookie_domain: None,
    cookie_secure: false,
});
let state = AppState { store, user_store, engine, jwt_config, worker_token: "token".to_string() };
let app = create_router(state, None);

let listener = tokio::net::TcpListener::bind("127.0.0.1:3000")
    .await
    .unwrap();
axum::serve(listener, app).await.unwrap();
# }