# CompanyOS Tasks move between stages and Routines can be archived or deleted

> Agno CompanyOS lets POST /company/tasks create a Task in Backlog, Ready or Cancelled and lets a Task move to any stage a run doesn't own. Routines gain cancel, archive, restore and delete routes in AgentOS.

- Published: 2026-10-27
- Author: Harsh Sinha
- Categories: Changelog
- Canonical: https://www.agno.com/blog/companyos-tasks-move-between-stages-and-routines-can-be-archived-or-deleted
- Markdown: https://www.agno.com/blog/companyos-tasks-move-between-stages-and-routines-can-be-archived-or-deleted.md

Agno [CompanyOS](https://www.agno.com/blog/introducing-companyos) now accepts a `status` on `POST /company/tasks`, so a Task can start life in `backlog`, `ready` or `cancelled`. A Ready Task needs `executor_type` and `executor_id`, and AgentOS runs the same permission and executor checks it runs when someone accepts a Task, then records one history entry with the reason `Created in ready`.

Once created, a Task can move to Backlog, Ready or Cancelled from any stage, so Done and Cancelled work can reopen. A few stages still belong to runs. In progress starts only through `POST /company/tasks/{id}/runs`. In review and Done need an earlier run attempt in the Task's history. A Task can't reopen inside a Project that is done or cancelled. While a run is executing or paused for approval, leaving In progress returns `409` with the cancel route to call first.

```text
POST /company/tasks/{id}/transitions  {"target": "done"}   on a Task that never ran
409 Completion requires a previous Task attempt
```

Title and brief can now change at any stage, and acceptance and run history stay put. Changing the executor, Project or evidence still needs a return to Backlog. Agents running a Task or a Routine can only edit Task content while it sits in Backlog.

Routines get four new routes. `POST /company/routines/{id}/cancel` stops every running run of the Routine through its executor's cancel route, and answers `409 Routine has no running run` when there is nothing to stop. `/archive` pauses the Routine and hides it from lists while keeping its run history, and `/restore` brings it back. `DELETE /company/routines/{id}` erases the schedule along with its run history and needs the `agent_os:admin` scope. Archive and delete wait until no run is executing.

An on-demand Routine has no schedule to pause, so pause now returns `409`. `GET /company/routines` sorts with `sort_by` (`created_at` or `updated_at`) and `sort_order`, and scheduler runs leave `updated_at` alone, so sorting by it puts the last edited Routine first.

Archiving a Project or Product used to fail with `Cannot archive with active Tasks` when a Task inside had been archived while Ready, In progress or In review. Lists hide archived Tasks, so the Project looked empty and nothing in the UI could clear the error. The check now skips archived Tasks. Visible open Tasks still block the archive.

Moving a Project to Done skips the same hidden Tasks, where earlier releases answered `409 Project has open Tasks`, and retention archiving stops passing over a finished Project that holds one. Restoring an open Task into a Done or Cancelled Project now returns `409 Cannot add open work to a completed or cancelled Project`.

We ran the same calls through AgentOS with FastAPI's `TestClient` on SQLite, once on the previous release and once on this one.

![Real output from AgentOS on SQLite, comparing before and now. POST /company/tasks with status ready went from 422 extra_forbidden to 201 ready. Moving a Task from Cancelled to Backlog went from 409 Invalid task transition to 200 backlog. A new title on a Ready Task went from 409 Accepted task scope requires a return to Backlog to 200, still ready. Archiving a Routine went from 404 Not Found to 200, archived and paused. DELETE on a Routine went from 405 Method Not Allowed to 204. Archiving a Project whose only Task was archived while Ready went from 409 Cannot archive with active Tasks to 204.](https://www.agno.com/images/v3-1-11-company-task-stages.png)

See the [cookbook](https://github.com/agno-agi/agno/tree/main/cookbook/05_agent_os/30_company), and learn more about the [AgentOS scheduler](https://docs.agno.com/agent-os/scheduler/overview) in the documentation.
