Documentation

Run an agent when an issue reaches a status

A board lists issues by status. Give a status an agent, and moving an issue into that status starts the agent on it. The agent moves the issue to the next status when it is done. That status starts the next agent.

  1. Open New session and describe the workflow. Name the board, its statuses, and what happens in each one:

    Create a board named Docs with the statuses backlog, writing, review and done. When an issue moves to writing, an agent drafts the page and opens a pull request, then moves the issue to review.

  2. Answer the session's questions until it creates the board and the agent.

  3. Open Agents in the sidebar and pick the new agent. Under Configuration, its definition looks like this:

    agents:
      docs-writer:
        prompts:
          - /agents/docs-writer/prompt.md
        runs_when:
          write:
            lives_on: issue
            where: self.board_id == "j-abcdef" && self.status == "writing"
            mode: headless

    Check these parts against your request:

    • self.board_id is the board's id. A status key such as writing can exist on several boards, so the condition names both.
    • When the issue leaves writing, the agent stops.
    • mode: headless runs the agent without you. Ask for an interactive agent if you want to talk to it in each session.
  4. Open Issues in the sidebar and switch to Board. Add an issue to the Docs board and set its status to writing.

  5. Open the issue. Its Sessions section lists the agent's session.

To have each session act for the issue's assignee instead of the organization, ask for it. The entry then sets on_behalf_of: self.assignee.get_or_else(org). Sessions explains who a session acts for.