Tasks
Fields and outcomes
Collect typed values on a task and route the workflow by the outcome the person chooses.
Outcomes
A User Task lists its outcomes, for example Approved and Rejected. Each outcome is a button on the task and an outgoing edge on the canvas with the same label. When the task is completed, the run resumes on the matching edge and {{outcome}} and {{outcome_notes}} are set.
Fields
fields define what the person fills in. Five types are supported:
| Type | Stored as | Notes |
|---|---|---|
text | string | placeholder, default |
number | number | |
date | ISO date | |
boolean | true / false | |
choice | string | options (at least one) |
Each field has a key (defaults to the label in snake_case), a label and required. Keys must be unique in the task. After completion the values are available as {{task_data.<key>}} (also {{task.data.<key>}}).
{
"task_title": "Approve invoice {{invoice_number}}",
"task_description": "{{vendor.name}} · {{=FORMAT_NUMBER(amount, 2)}} {{currency}}",
"outcomes": ["Approved", "Rejected"],
"fields": [
{ "key": "amount", "label": "Approved amount", "type": "number", "required": true, "default": "{{amount}}" },
{ "key": "cost_centre", "label": "Cost centre", "type": "choice", "options": ["OPS", "FIN", "IT"], "required": true },
{ "key": "comment", "label": "Comment", "type": "text" }
]
}Several assignees
When a task is assigned to several people, completion_rule decides when it is done:
| Rule | Completes when |
|---|---|
first_response | the first person responds (their outcome wins) |
all_complete | everyone has responded (the most common outcome wins) |
consensus | at least min_responses people agree |
unanimous | everyone chooses the same outcome |
custom | custom_rule_expression evaluates true |
Every response is kept ({{task.responses}}, {{task.outcome_counts}}), and the rule is applied the same way whether people respond in the app, through the API or through an agent.