#[non_exhaustive]pub struct TaskGroup {
pub id: String,
pub name: Option<String>,
pub description: Option<String>,
pub condition: Value,
pub terminal: bool,
pub continue_on_error: bool,
/* private fields */
}Expand description
A contiguous run of tasks sharing one condition, and optionally ending the workflow once the run completes.
Groups are authored as nested objects inside a workflow’s tasks list — an
element carrying a tasks key is a group, one carrying a function key is
a Task. The parser flattens the tree into Workflow::tasks and records
each group’s span on the task that opens it (Task::group_starts), so the
executor keeps walking a flat slice.
The condition is evaluated once, on entry. A false result skips every task in the span; the individual tasks’ own conditions are not evaluated.
§Example JSON Definition
{
"id": "have_videos",
"condition": {">": [{"length": [{"var": "temp_data.videos"}]}, 0]},
"terminal": false,
"tasks": [
{"id": "rank", "name": "Rank", "function": {"name": "map", "input": {}}},
{"id": "trim", "name": "Trim", "function": {"name": "map", "input": {}}}
]
}#[non_exhaustive]: groups are produced by the workflow parser, never built
by hand — end is an index into the flattened task list and means nothing
on its own. Read the fields freely.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringUnique identifier for the group within the workflow. Shares the task id namespace, so a group cannot reuse a task’s id.
name: Option<String>Human-readable name.
description: Option<String>Optional description explaining what the group covers.
condition: ValueJSONLogic condition gating the whole span. Defaults to true.
terminal: boolWhether reaching the end of this group ends the workflow.
continue_on_error: boolWhether the author wrote "continue_on_error": true on this group.
The engine does not honour it. Error handling is per task
(Task::continue_on_error) and per workflow; a group only gates a
span. The key is recorded here so
check_workflow can report
IssueCode::GroupContinueOnError
rather than let it vanish — being real at the other two levels is
exactly what makes a group the one place it looks like it should work.
false for a group that omits the key, and for one that spells it with
anything other than a literal true.