pub struct WorkflowStepConfig {
pub workflow_name: String,
pub payload: Value,
pub retry: Option<RetryPolicy>,
pub concurrency_key: Option<String>,
pub allow_failure: bool,
}Expand description
Configuration for invoking a registered workflow as a sub-step.
The engine will look up the handler by workflow_name
and execute it as a child run with its own steps and lifecycle.
§Examples
use ironflow_engine::config::WorkflowStepConfig;
use serde_json::json;
let config = WorkflowStepConfig::new("build", json!({"branch": "main"}));
assert_eq!(config.workflow_name, "build");Fields§
§workflow_name: StringName of the registered workflow handler to invoke.
payload: ValuePayload to pass to the child workflow run.
retry: Option<RetryPolicy>Optional step-level retry policy.
concurrency_key: Option<String>Concurrency key held by the child run while it is not terminal.
Set through WorkflowOptions::concurrency_key and recorded in the
step input.
allow_failure: boolTolerate a failed child: the step completes with the child’s failure in its output instead of failing the parent.
Implementations§
Source§impl WorkflowStepConfig
impl WorkflowStepConfig
Sourcepub fn new(workflow_name: &str, payload: Value) -> Self
pub fn new(workflow_name: &str, payload: Value) -> Self
Create a new workflow step config.
§Examples
use ironflow_engine::config::WorkflowStepConfig;
use serde_json::json;
let config = WorkflowStepConfig::new("deploy", json!({}));
assert_eq!(config.workflow_name, "deploy");Sourcepub fn retry_policy(self, policy: RetryPolicy) -> Self
pub fn retry_policy(self, policy: RetryPolicy) -> Self
Set a step-level retry policy.
§Examples
use ironflow_core::retry::RetryPolicy;
use ironflow_engine::config::WorkflowStepConfig;
use serde_json::json;
let config = WorkflowStepConfig::new("build", json!({}))
.retry_policy(RetryPolicy::new(3));
assert!(config.retry.is_some());Sourcepub fn allow_failure(self) -> Self
pub fn allow_failure(self) -> Self
Tolerate a failed child run: the step completes with a
SubWorkflowOutput reporting the
failure and the parent run ends as Warning.
§Examples
use ironflow_engine::config::WorkflowStepConfig;
use serde_json::json;
let config = WorkflowStepConfig::new("build", json!({})).allow_failure();
assert!(config.allow_failure);