--- summary: "CLI reference for `openclaw tasks` (background task ledger and Task Flow state)" read_when: - You want to inspect, audit, or cancel background task records - You are documenting Task Flow commands under `openclaw tasks flow` title: "`openclaw tasks`" --- Inspect durable background tasks and Task Flow state. With no subcommand, `openclaw tasks` is equivalent to `openclaw tasks list`. See [Background Tasks](/automation/tasks) for the lifecycle and delivery model. ## Usage ```bash openclaw tasks openclaw tasks list openclaw tasks list --runtime acp openclaw tasks list --status running openclaw tasks show openclaw tasks notify state_changes openclaw tasks cancel openclaw tasks audit openclaw tasks maintenance openclaw tasks maintenance --apply openclaw tasks flow list openclaw tasks flow show openclaw tasks flow cancel ``` ## Root Options - `--json`: output JSON. - `--runtime `: filter by kind: `subagent`, `acp`, `cron`, or `cli`. - `--status `: filter by status: `queued`, `running`, `succeeded`, `failed`, `timed_out`, `cancelled`, or `lost`. ## Subcommands ### `list` ```bash openclaw tasks list [--runtime ] [--status ] [--json] ``` Lists tracked background tasks newest first. ### `show` ```bash openclaw tasks show [--json] ``` Shows one task by task ID, run ID, or session key. ### `notify` ```bash openclaw tasks notify ``` Changes the notification policy for a running task. ### `cancel` ```bash openclaw tasks cancel ``` Cancels a running background task. ### `audit` ```bash openclaw tasks audit [--severity ] [--code ] [--limit ] [--json] ``` Surfaces stale, lost, delivery-failed, or otherwise inconsistent task and Task Flow records. Lost tasks retained until `cleanupAfter` are warnings; expired or unstamped lost tasks are errors. ### `maintenance` ```bash openclaw tasks maintenance [--apply] [--json] ``` Previews or applies task and Task Flow reconciliation, cleanup stamping, and pruning. For cron tasks, reconciliation uses persisted run logs/job state before marking an old active task `lost`, so completed cron runs do not become false audit errors just because the in-memory Gateway runtime state is gone. Offline CLI audit is not authoritative for the Gateway's process-local cron active-job set. ### `flow` ```bash openclaw tasks flow list [--status ] [--json] openclaw tasks flow show [--json] openclaw tasks flow cancel ``` Inspects or cancels durable Task Flow state under the task ledger. ## Related - [CLI reference](/cli) - [Background tasks](/automation/tasks)