Agent run lifecycle

States of one agent run

Lifecycle10 nodes · 11 connections

diagram.html#The link keeps the view, selection, route and playback.

About this diagram

The states of one thing and the moves between them: a job, an order, a deployment.

Ask for one like it

Draw the lifecycle of an agent run: every state it can be in, and what moves it between them.

Read about lifecycle diagrams

The JSON

agent-run/diagram.json171 lines
{  "kind": "lifecycle",  "title": "Agent run lifecycle",  "subtitle": "States of one agent run",  "lanes": [    { "id": "main", "label": "Lifecycle phases" },    { "id": "waiting", "label": "Interruptions" },    { "id": "recovery", "label": "Recovery loop", "tone": "exception" },    { "id": "terminal", "label": "Terminal exits" }  ],  "nodes": [    {      "id": "queued",      "type": "start",      "lane": "main",      "card": { "title": "Queued", "subtitle": "Request accepted" }    },    {      "id": "planning",      "type": "active",      "lane": "main",      "card": { "title": "Planning", "subtitle": "Build task graph" }    },    {      "id": "executing",      "type": "active",      "lane": "main",      "card": { "title": "Executing", "subtitle": "Tool calls" }    },    {      "id": "reviewing",      "type": "decision",      "lane": "main",      "card": { "title": "Reviewing", "subtitle": "Quality gate" }    },    {      "id": "completed",      "type": "success",      "lane": "main",      "card": { "title": "Completed", "subtitle": "Final response" }    },    {      "id": "approval",      "type": "waiting",      "lane": "waiting",      "card": {        "title": "Needs approval",        "subtitle": "Human gate",        "tag": "pause"      }    },    {      "id": "blocked",      "type": "waiting",      "lane": "waiting",      "card": { "title": "Blocked", "subtitle": "Missing input" }    },    {      "id": "failed",      "type": "failure",      "lane": "recovery",      "card": {        "title": "Failed",        "subtitle": "Recoverable error",        "tag": "retryable"      }    },    {      "id": "cancelled",      "type": "failure",      "lane": "terminal",      "card": { "title": "Cancelled", "subtitle": "User stopped" }    },    {      "id": "expired",      "type": "failure",      "lane": "terminal",      "card": { "title": "Expired", "subtitle": "Timeout" }    }  ],  "edges": [    {      "id": "plan",      "from": "queued",      "to": "planning",      "tone": "main"    },    {      "id": "execute",      "from": "planning",      "to": "executing",      "tone": "main"    },    {      "id": "review",      "from": "executing",      "to": "reviewing",      "tone": "main"    },    {      "id": "complete",      "from": "reviewing",      "to": "completed",      "tone": "main"    },    {      "id": "needs-approval",      "from": "executing",      "to": "approval",      "label": "risky op",      "tone": "security"    },    {      "id": "approved",      "from": "approval",      "to": "executing",      "label": "approved",      "kind": "return"    },    {      "id": "review-blocked",      "from": "reviewing",      "to": "blocked",      "label": "missing input"    },    {      "id": "execution-failed",      "from": "executing",      "to": "failed",      "label": "error",      "tone": "error"    },    {      "id": "retry",      "from": "failed",      "to": "executing",      "label": "retry",      "kind": "return"    },    {      "id": "approval-cancelled",      "from": "approval",      "to": "cancelled",      "label": "denied",      "tone": "error"    },    {      "id": "block-expired",      "from": "blocked",      "to": "expired",      "label": "timeout",      "tone": "error"    }  ],  "notes": [    {      "title": "Main path and waits",      "items": [        "The run has five ordered phases from queue to completion",        "Approval and missing input pause the run without ending it"      ]    },    {      "title": "Recovery and terminal exits",      "items": [        "Failed loops back while retry budget remains",        "Cancelled and Expired are terminal exits with no return path"      ]    }  ]}

More lifecycle examples

All examples