pub struct Workflow {Show 14 fields
pub id: String,
pub name: String,
pub priority: u32,
pub description: Option<String>,
pub condition: Value,
pub condition_index: Option<usize>,
pub tasks: Vec<Task>,
pub continue_on_error: bool,
pub channel: String,
pub version: u32,
pub status: WorkflowStatus,
pub tags: Vec<String>,
pub created_at: Option<DateTime<Utc>>,
pub updated_at: Option<DateTime<Utc>>,
}Expand description
Workflow represents a collection of tasks that execute sequentially (also known as a Rule in rules-engine terminology).
Conditions are evaluated against the full message context, including data, metadata, and temp_data fields.
Fields§
§id: String§name: String§priority: u32§description: Option<String>§condition: Value§condition_index: Option<usize>§tasks: Vec<Task>§continue_on_error: bool§channel: StringChannel for routing (default: “default”)
version: u32Version number for rule versioning (default: 1)
status: WorkflowStatusWorkflow status — Active, Paused, or Archived (default: Active)
Tags for categorization and filtering
created_at: Option<DateTime<Utc>>Creation timestamp
updated_at: Option<DateTime<Utc>>Last update timestamp
Implementations§
Source§impl Workflow
impl Workflow
pub fn new() -> Self
Sourcepub fn rule(id: &str, name: &str, condition: Value, tasks: Vec<Task>) -> Self
pub fn rule(id: &str, name: &str, condition: Value, tasks: Vec<Task>) -> Self
Create a workflow (rule) with a condition and tasks.
This is a convenience constructor for the IFTTT-style rules engine pattern:
IF condition THEN execute tasks.
§Arguments
id- Unique identifier for the rulename- Human-readable namecondition- JSONLogic condition evaluated against the full context (data, metadata, temp_data)tasks- Actions to execute when the condition is met
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Workflow
impl<'de> Deserialize<'de> for Workflow
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 Workflow
impl RefUnwindSafe for Workflow
impl Send for Workflow
impl Sync for Workflow
impl Unpin for Workflow
impl UnsafeUnpin for Workflow
impl UnwindSafe for Workflow
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