pub struct WorkflowDefinition {
pub id: String,
pub name: Option<String>,
pub version: u32,
pub description: Option<String>,
pub steps: Vec<WorkflowStep>,
pub default_error_behavior: ErrorBehavior,
pub default_error_retry_interval: Option<Duration>,
pub services: Vec<ServiceDefinition>,
pub shared_volume: Option<SharedVolume>,
}Expand description
A compiled workflow definition ready for execution.
Fields§
§id: StringStable slug used as the primary key (e.g. “ci”, “checkout”). Must be unique within a host. Referenced by other workflows, webhooks, and clients when starting new instances.
name: Option<String>Optional human-friendly display name surfaced in UIs, listings, and
logs (e.g. “Continuous Integration”). Falls back to id when unset.
version: u32Version.
description: Option<String>Description.
steps: Vec<WorkflowStep>Steps.
default_error_behavior: ErrorBehaviorDefault error behavior.
default_error_retry_interval: Option<Duration>Default error retry interval.
services: Vec<ServiceDefinition>Infrastructure services required by this workflow (databases, caches, etc.).
When set, the backend provisions a single persistent volume for the top-level workflow instance and mounts it on every step container. All sub-workflows inherit the same volume through their shared namespace/isolation domain. Sub-workflow declarations are ignored.
Implementations§
Source§impl WorkflowDefinition
impl WorkflowDefinition
pub fn new(id: impl Into<String>, version: u32) -> Self
Sourcepub fn display_name(&self) -> &str
pub fn display_name(&self) -> &str
Return the display name when set, otherwise fall back to the slug id.
Sourcepub fn write_dot<W: Write>(&self, w: &mut W) -> Result
pub fn write_dot<W: Write>(&self, w: &mut W) -> Result
Write a Graphviz DOT representation of this workflow to the given writer.
The output is a directed graph showing:
| Visual element | Meaning |
|---|---|
| Node | One per step, labeled with name and type |
| Solid edge | Sequential execution flow (outcomes) |
| Dotted gray edge | Container/child relationship |
| Dashed red edge | Compensation path |
Container steps (parallel, if, while, foreach, saga, decide) are drawn with a distinct fill colour so you can spot control-flow primitives at a glance.
§Example
let definition = WorkflowBuilder::<MyData>::new()
.start_with::<StepA>()
.then::<StepB>()
.end_workflow()
.build("demo", 1);
let dot = definition.to_dot();
std::fs::write("workflow.dot", &dot).unwrap();Trait Implementations§
Source§impl Clone for WorkflowDefinition
impl Clone for WorkflowDefinition
Source§fn clone(&self) -> WorkflowDefinition
fn clone(&self) -> WorkflowDefinition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more