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}
17
18fn default_condition() -> Value {
19 Value::Bool(true)
20}