dataflow_rs/engine/
task.rs

1use crate::engine::functions::FunctionConfig;
2use serde::Deserialize;
3use serde_json::Value;
4
5/// Task represents a single processing unit within a workflow
6#[derive(Clone, Debug, Deserialize)]
7pub struct Task {
8    pub id: String,
9    pub name: String,
10    pub description: Option<String>,
11    #[serde(default = "default_condition")]
12    pub condition: Value,
13    #[serde(skip)]
14    pub condition_index: Option<usize>,
15    pub function: FunctionConfig,
16    #[serde(default)]
17    pub continue_on_error: bool,
18}
19
20fn default_condition() -> Value {
21    Value::Bool(true)
22}