Skip to main content

RunCreator

Trait RunCreator 

Source
pub trait RunCreator: Send + Sync {
    // Required method
    fn create_run(&self, req: NewRun) -> RunCreatorFuture<'_>;
}
Expand description

Minimal trait for creating workflow runs.

Automatically implemented for every RunStore via a blanket impl, so any store (InMemory, Postgres, ApiRunStore) is a valid RunCreator.

§Examples

use ironflow_engine::run_creator::RunCreator;
use ironflow_store::entities::{NewRun, TriggerKind};

let new_run = NewRun {
    workflow_name: "deploy".to_string(),
    trigger: TriggerKind::Manual,
    payload: serde_json::json!({}),
    max_retries: 0,
    handler_version: None,
    labels: Default::default(),
    scheduled_at: None,
    created_by: None,
    idempotency_key: None,
    max_cost_usd: None,
};
let creation = creator.create_run(new_run).await?;

Required Methods§

Source

fn create_run(&self, req: NewRun) -> RunCreatorFuture<'_>

Create a new workflow run.

§Errors

Returns EngineError if the run could not be created.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§