diff --git a/sgl-model-gateway/src/workflow/definition.rs b/sgl-model-gateway/src/workflow/definition.rs index f88e411f5..c1f2ba0eb 100644 --- a/sgl-model-gateway/src/workflow/definition.rs +++ b/sgl-model-gateway/src/workflow/definition.rs @@ -14,6 +14,9 @@ use super::{ types::{FailureAction, RetryPolicy, StepId, WorkflowContext, WorkflowData, WorkflowId}, }; +/// A condition function that determines whether a step should run. +pub type StepCondition = Arc) -> bool + Send + Sync>; + /// Errors that can occur during workflow validation #[derive(Debug, Clone, thiserror::Error)] pub enum ValidationError { @@ -43,8 +46,7 @@ pub struct StepDefinition { /// Run step at or after this time (after dependencies satisfied) pub scheduled_at: Option>, /// Condition to evaluate; if false, step is skipped - #[allow(clippy::type_complexity)] - pub run_if: Option) -> bool + Send + Sync>>, + pub run_if: Option>, } impl fmt::Debug for StepDefinition {