Skip to main content

Module run_creator

Module run_creator 

Source
Expand description

RunCreator trait and CreateRunOpts builder – centralised run creation.

RunCreator is a minimal trait with a single method: create a run from a NewRun. It is intentionally thinner than RunStore so that any store implementation can be used as a run creator through the blanket impl.

CreateRunOpts is a builder for the optional fields of a run creation request. Combined with WorkflowHandler::create_run, it assembles a NewRun from the handler’s own metadata, removing duplication across call sites.

§Examples

use ironflow_engine::run_creator::{CreateRunOpts, RunCreator};
use ironflow_store::entities::TriggerKind;
use ironflow_store::memory::InMemoryStore;

let store = InMemoryStore::new();
let creator: &dyn RunCreator = &store;

let new_run = CreateRunOpts::new()
    .trigger(TriggerKind::Api)
    .build("deploy", Some("1.0.0"), None);

let creation = creator.create_run(new_run).await?;

Structs§

CreateRunOpts
Builder for optional run creation fields.

Traits§

RunCreator
Minimal trait for creating workflow runs.

Type Aliases§

RunCreatorFuture
Future returned by RunCreator::create_run.