Skip to content

Agent runs overview ​

An agent run is one session between people and an agent, from the moment the agent is asked to do something to the moment it finishes, fails, or stops. The run records who started it, the work item and comment thread it lives in, and its status. Everything said inside the run, by the people and by the agent, is an agent run activity.

Plane starts most runs for you: when a person @mentions an agent in a top-level work item comment or assigns an agent to a work item, and when a Plane agent's trigger fires. You can also start a run on an existing top-level comment with Create an agent run. Runs are never deleted, and there's no DELETE endpoint. A run ends when it's settled as completed, stopped, failed, or stale.

To build an agent that works through runs, start with the Agents overview and Building an agent.

Learn more about agent sessions

The agent run object ​

Attributes ​

  • id string (uuid)

    Unique identifier for the run.

  • title string or null

    A short title for the run. Set it when you create the run, or the agent sets it with Update an agent run.

  • summary string or null

    A summary of what the run did, usually reported by the agent when it settles the run.

  • status string

    Where the run is in its lifecycle. One of created, in_progress, awaiting, completed, stopping, stopped, failed, or stale. See Run statuses.

  • type string

    How the run started:

    • comment_thread: from a work item comment. Mention runs, assignment runs, and runs created through the API all have this type.
    • scheduled: a Plane agent's schedule trigger.
    • event_triggered: a Plane agent's work item event trigger, or a person starting a Plane agent by hand.
    • integration_triggered: an event from a connected integration, such as a Slack message or a GitHub event.
    • assignment: a valid value, but Plane stores assignment runs as comment_thread. Use trigger_type to find them.
  • trigger_type string or null

    The trigger that started the run, for example mention, assignment, schedule, or manual. Plane agents' event triggers write their own values. Runs created through the API have null.

  • agent_user_id string (uuid)

    The agent's bot user. Every action the agent takes in Plane runs as this user.

  • native_agent_id string (uuid) or null

    The Plane agent behind the run, for an agent built in Plane. null for an agent installed as an app.

  • comment_id string (uuid) or null

    The root comment of the run's thread on the work item. The agent's replies and people's prompts are posted under it.

  • source_comment_id string (uuid) or null

    The comment that started the run. For a run started from a comment, it's the same comment as comment_id.

  • creator_id string (uuid) or null

    The person who started the run, for example the person who mentioned or assigned the agent.

  • work_item_id string (uuid) or null

    The work item the run is on. null for a run with no work item, such as a scheduled run.

  • project_id string (uuid) or null

    The project of the run's work item.

  • external_link string (uri) or null

    A link to the run in the agent's own system, such as a log or dashboard. Set when the run is created through the API.

  • external_trigger_source string or null

    For an integration_triggered run, the integration it came from: slack or github.

  • external_trigger_id string or null

    For an integration_triggered run, the conversation it belongs to in that integration, such as a Slack thread.

  • error_metadata object or null

    Details of a failure. When the agent posts an error activity, Plane copies that activity's signal_metadata here. A failed Plane agent run carries a reason, for example agent_inactive.

  • token_usage object

    Token usage reported by the agent. Plane stores the object as sent.

  • credit_usage object

    Credit usage reported by the agent. Plane stores the object as sent.

  • started_at string (date-time)

    When the run started. Plane sets it when it creates the run.

  • ended_at string (date-time) or null

    When the run was settled. null while it's open.

  • stopped_at string (date-time) or null

    When the run moved from stopping to stopped.

  • stopped_by_id string (uuid) or null

    The person who asked the run to stop. Set when the run reaches stopped.

  • created_at string (date-time)

    When the run was created.

  • updated_at string (date-time)

    When the run last changed. Every activity updates the run, so this is also the time of its latest activity.

  • created_by_id string (uuid) or null

    The user who created the run record.

  • updated_by_id string (uuid) or null

    The user who last updated the run record.

Response200
json
{
  "id": "5d2e8b47-3a1c-4f96-b0e2-7c9a4d1f8e63",
  "title": "Find the commit behind the Safari redirect loop",
  "summary": "Traced the loop to the SameSite change in commit 4e1a9c2 and suggested a fix.",
  "status": "completed",
  "type": "comment_thread",
  "trigger_type": "mention",
  "agent_user_id": "a8f3c1d2-6b4e-4e57-9d10-2f5b7c8e3a94",
  "native_agent_id": null,
  "comment_id": "c47e9a12-8d3b-4f61-a5e0-9b2d6f4c1e78",
  "source_comment_id": "c47e9a12-8d3b-4f61-a5e0-9b2d6f4c1e78",
  "creator_id": "16c61a3a-512a-48ac-b0be-b6b46fe6f430",
  "work_item_id": "8c3d1f72-4a9e-4b65-9d20-6e1f3b7a5c48",
  "project_id": "4af68566-94a4-4eb3-94aa-50dc9427067b",
  "external_link": null,
  "external_trigger_source": null,
  "external_trigger_id": null,
  "error_metadata": {},
  "token_usage": {},
  "credit_usage": {},
  "started_at": "2026-11-20T10:15:02.118204Z",
  "ended_at": "2026-11-20T10:17:41.502913Z",
  "stopped_at": null,
  "stopped_by_id": null,
  "created_at": "2026-11-20T10:15:02.118204Z",
  "updated_at": "2026-11-20T10:17:41.502913Z",
  "created_by_id": null,
  "updated_by_id": "a8f3c1d2-6b4e-4e57-9d10-2f5b7c8e3a94"
}

Endpoints ​

MethodPathDescription
GET/api/v2/workspaces/{slug}/runs/List agent runs
POST/api/v2/workspaces/{slug}/runs/Create an agent run
GET/api/v2/workspaces/{slug}/runs/{pk}/Get an agent run
PATCH/api/v2/workspaces/{slug}/runs/{pk}/Update an agent run
POST/api/v2/workspaces/{slug}/runs/{pk}/stop/Stop an agent run

Reads need the agents.runs:read scope, and create, update, and stop need agents.runs:write. A run's activities have their own endpoints and scopes. See Agent run activities.

Who can call what ​

Agent runs are open to active workspace admins and members. Guests get 403.

The API tells an agent from a person by the caller's user. An agent calls with its app's bot token, so it acts as its bot user. A person calls with a personal API key or a user OAuth token.

  • An agent sees only its own runs, the ones where it's the agent_user_id. Another agent's run is left out of lists and returns 404 by id. An agent can start runs for itself only, settle its runs with PATCH, and post their output activities. It can't call stop.
  • A person sees the runs on work items they can view, plus runs with no work item. A run on a work item they can't see returns 404, the same as a run that doesn't exist. A manual run is visible only to the person who started it and to the agent. A person can start a run on a comment, post a prompt, and stop a run. Starting a run or posting a prompt also needs permission to comment on the work item. A person can't PATCH a run.

Run statuses ​

A new run starts as created. After that, its status follows the activities posted to it:

EventStatus after
The agent posts a thought or actionin_progress, unless the run is stopping or stopped
The agent posts a responsestopped if the run was stopping, unchanged if it's stopped, otherwise in_progress
The agent posts an elicitationawaiting
The agent posts an errorfailed. Plane sets ended_at and copies the activity's signal_metadata into error_metadata.
The agent sends PATCH with status: completedcompleted, with ended_at set
A person calls stopstopping
A person posts any other promptin_progress. On a run that has ended, this reopens it and clears ended_at, stopped_at, stopped_by_id, and error_metadata.
No change for 5 minutes while created, in_progress, or awaitingstale, with ended_at set

A response doesn't complete a run. When the agent is done, it posts its final response and then sends PATCH with status: completed. Stop returns 409 for a run that has ended as completed, stopped, failed, or stale. Those statuses aren't final, though, because a person's next prompt reopens the run.

Plane marks a quiet run stale the next time the run is read. Listing runs settles every run that's due first. Self-hosted instances can change the 5-minute timeout with the AGENT_RUN_STALE_TIMEOUT_IN_MINS environment variable. See Stale run prevention.

Stopping a run ​

Stop an agent run does what the Stop button does in Plane. It records a prompt activity with signal: stop and moves the run to stopping. The run reaches stopped when the agent posts its next response, and stopped_by_id records the person who asked. An agent learns about the stop from the activity webhook or by reading the activity in its feed. See The stop signal.

Finding work by polling ​

An agent can find its runs without webhooks. Poll List agent runs with ?updated_at__gte= and paginate=cursor. The list is ordered oldest change first by default, so a run that changes while you page through it moves behind your cursor and comes back on a later page. Deduplicate by id. To read what people said, poll the workspace activity feed instead of reading each run.

A poll with updated_at__gte and an ascending cursor walk leave out runs changed in the last 3 seconds. Those runs come back on your next poll, after the writes that changed them have committed, so a poll never skips a row.

Webhooks ​

Creating a run, and every prompt a person posts, sends the agent's app the same agent run webhooks as in v1, whichever API version made the change. A Plane agent is started inside Plane instead and gets no webhook.

Response shaping ​

Every agent run read accepts ?fields= for sparse responses and ?expand= for agent_user, creator, work_item, comment, and source_comment. See Sparse fields and Expanding relations. Errors follow the shared problem+json contract.

Changed from v1 ​

  • Ids are flat: v1's issue is now work_item_id, and agent_user, comment, creator, and the other references gain an _id suffix. v1's nested issue_details is now ?expand=work_item.
  • The create body names the comment comment_id, where v1 used comment. An unknown agent_slug returns 400, where v1 returned 404.
  • An agent sees only its own runs. v1 let any bot in the workspace read any run.
  • A person sees only runs on work items they can view. Another member's manual run returns 404, where v1 returned 403.
  • v2 adds List agent runs, Stop an agent run, and the workspace activity feed.
  • The OAuth scopes are v1's, so an installed app needs no new grant.

See Migrating from v1 for the full list.