Skip to content

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 ​

SettingRequiredValueExample
instructionyestextinstruction: "Summarise the ticket in two lines."

Where it can go ​

A task sits inside a flow and holds nothing.

ArrowIn fromOut to
Arrow (-->)flow, task, decisionflow, task, decision
Dotted link (-.-)connectorconnector

Rules ​

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." }
Ctrl + Enter|

Common mistake ​

A task at the top level of the workflow.

Code:
mermaid
agentflow TB
  summarise["Summarise"]@{ instruction: "Summarise the ticket in two lines." }
Ctrl + Enter|

Task "summarise" is outside every flow. Move it into a flow.

Opens in mermaid.ai