Task lifecycle
A task moves through a fixed set of statuses. Nexus Core is the only writer.
draft → planned → ready_for_agent → leased → running
→ waiting_review → (blocked) → done
From goal to tasks
- A goal arrives (Telegram command or UI): "Build authentication system."
- Nexus drafts tasks from the goal (a planner agent or a built-in decomposer).
- Tasks land as
draft/planned, withdepends_onedges where ordering matters. - The operator reviews the plan in the UI and approves.
- Approved tasks flip to
ready_for_agentand emitnexus.task.ready.
/nexus create goal "Build authentication system for my app"
→ Goal created.
→ Drafted 8 tasks.
→ Waiting for approval in Nexus UI.
From ready to running
- The scheduler (in
nexus-worker) picks aready_for_agenttask whose dependencies are satisfied. - It leases the task (
leased, with a lease that expires) so no other worker double-dispatches. - Core assembles the run config and asks the runtime to start a run; the task
flips to
running. See Agent run.
From running to done
- The pod reports completion events.
- If the task hit an approval gate or needs review, it becomes
waiting_review; an operator resolves it. - Otherwise the task becomes
done. Blocked tasks (blocked) wait on an external dependency and are surfaced in the UI.
Statuses at a glance
| Status | Set by | Meaning |
|---|---|---|
draft | decomposer | proposed, not yet planned |
planned | operator/planner | part of an approved-pending plan |
ready_for_agent | operator approval | dependencies clear, schedulable |
leased | scheduler | claimed for a run (lease expires) |
running | runtime | a pod is executing |
waiting_review | Core | needs human approval/review |
blocked | Core/agent | waiting on external dependency |
done | Core | completed |