feat(wfe-core): add when condition field to WorkflowStep

This commit is contained in:
2026-03-26 17:05:30 +00:00
parent aff3df6fcf
commit 9c90f0a477
2 changed files with 6 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ use std::time::Duration;
use serde::{Deserialize, Serialize};
use super::condition::StepCondition;
use super::error_behavior::ErrorBehavior;
/// A compiled workflow definition ready for execution.
@@ -46,6 +47,9 @@ pub struct WorkflowStep {
/// Serializable configuration for primitive steps (e.g. event_name, duration).
#[serde(default, skip_serializing_if = "Option::is_none")]
pub step_config: Option<serde_json::Value>,
/// Optional condition that must evaluate to true for this step to execute.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub when: Option<StepCondition>,
}
impl WorkflowStep {
@@ -62,6 +66,7 @@ impl WorkflowStep {
do_compensate: false,
saga: false,
step_config: None,
when: None,
}
}
}

View File

@@ -45,6 +45,7 @@ impl WorkflowInstance {
matches!(
p.status,
PointerStatus::Complete
| PointerStatus::Skipped
| PointerStatus::Compensated
| PointerStatus::Cancelled
| PointerStatus::Failed