Task
A task is one step of work, described by its instruction.
Syntax
text
id["Label"]@{ instruction: "…" }
id["Label"]@{ shape: task, instruction: "…" }
id@{ instruction: "…" }Without a label, the id is the label. Settings can also go on their own line, after the task: id@{ instruction: "…" }.
Settings
| Setting | Required | Value | Example |
|---|---|---|---|
instruction | yes | text | instruction: "Summarise the ticket in two lines." |
Where it can go
A task sits inside a flow and holds nothing.
| Arrow | In from | Out to |
|---|---|---|
Arrow (-->) | flow, task, decision | flow, task, decision |
Dotted link (-.-) | connector | connector |
Rules
- A task sits inside a flow. →
TASK_OUTSIDE_FLOW(error) - A task has an instruction that isn't blank. →
INSTRUCTION_MISSING(error) - A task with an empty label still needs an instruction. →
TASK_MISSING_LABEL(error) - A task takes only the
instructionsetting. →METADATA_UNKNOWN_KEY(warning) - The instruction is text. →
METADATA_INVALID_VALUE(error) - The instruction has no unfilled placeholder such as
<REPO>. →INSTRUCTION_PLACEHOLDER(error) - A task's id is used by no other node. →
ID_DUPLICATE(error)
Example
Code:
mermaid
agentflow TB
flow support["Support"]
summarise["Summarise"]@{ instruction: "Summarise the ticket in two lines." }
reply["Reply"]
summarise --> reply
end
reply@{ instruction: "Write a polite reply that answers the ticket." }
Common mistake
A task at the top level of the workflow.
Code:
mermaid
agentflow TB
summarise["Summarise"]@{ instruction: "Summarise the ticket in two lines." }
Task "summarise" is outside every flow. Move it into a flow.