pub struct WorkflowDefinition {
pub schema_version: u32,
pub name: String,
pub workflow_version: String,
pub description: Option<String>,
pub inputs: BTreeMap<String, WorkflowInput>,
pub budgets: WorkflowBudgets,
pub preconditions: Vec<VerificationPredicate>,
pub steps: Vec<WorkflowStep>,
pub terminal_condition: VerificationPredicate,
pub outputs: BTreeMap<String, WorkflowOutputDeclaration>,
}Expand description
A complete declarative workflow.
Fields§
§schema_version: u32Schema version, independent of the workflow’s business version.
name: StringStable human-readable workflow name.
workflow_version: StringCaller-owned version of this workflow definition.
description: Option<String>§inputs: BTreeMap<String, WorkflowInput>§budgets: WorkflowBudgets§preconditions: Vec<VerificationPredicate>§steps: Vec<WorkflowStep>§terminal_condition: VerificationPredicate§outputs: BTreeMap<String, WorkflowOutputDeclaration>Implementations§
Source§impl WorkflowDefinition
impl WorkflowDefinition
Sourcepub fn from_json(input: &str) -> Result<Self, WorkflowValidationError>
pub fn from_json(input: &str) -> Result<Self, WorkflowValidationError>
Parse and validate a JSON workflow definition.
Sourcepub fn from_value(value: Value) -> Result<Self, WorkflowValidationError>
pub fn from_value(value: Value) -> Result<Self, WorkflowValidationError>
Deserialize and validate a workflow definition from JSON data.
Sourcepub fn validate(&self) -> Result<(), WorkflowValidationError>
pub fn validate(&self) -> Result<(), WorkflowValidationError>
Validate all structural and resource-boundary constraints.
Sourcepub fn to_canonical_json(&self) -> Result<String, WorkflowValidationError>
pub fn to_canonical_json(&self) -> Result<String, WorkflowValidationError>
Return stable JSON suitable for hashing, caching, or audit records.
Sourcepub fn validate_inputs(
&self,
values: &BTreeMap<String, Value>,
) -> Result<(), WorkflowValidationError>
pub fn validate_inputs( &self, values: &BTreeMap<String, Value>, ) -> Result<(), WorkflowValidationError>
Validate caller-provided input values before execution starts.
Sourcepub fn resolve_actions(
&self,
values: &BTreeMap<String, Value>,
) -> Result<Vec<WorkflowStep>, WorkflowValidationError>
pub fn resolve_actions( &self, values: &BTreeMap<String, Value>, ) -> Result<Vec<WorkflowStep>, WorkflowValidationError>
Resolve bounded ${inputs.name} placeholders in declared actions.
Resolution happens before browser startup or dispatch and never
evaluates arbitrary expressions.
Trait Implementations§
Source§impl Clone for WorkflowDefinition
impl Clone for WorkflowDefinition
Source§fn clone(&self) -> WorkflowDefinition
fn clone(&self) -> WorkflowDefinition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorkflowDefinition
impl Debug for WorkflowDefinition
Source§impl<'de> Deserialize<'de> for WorkflowDefinition
impl<'de> Deserialize<'de> for WorkflowDefinition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for WorkflowDefinition
impl RefUnwindSafe for WorkflowDefinition
impl Send for WorkflowDefinition
impl Sync for WorkflowDefinition
impl Unpin for WorkflowDefinition
impl UnsafeUnpin for WorkflowDefinition
impl UnwindSafe for WorkflowDefinition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more