Skip to content
Docs

Watch a Run

Watch a Run gives an Agent the watch_run tool. The agent uses it to learn how another run ends without checking on it over and over. In a conversation, the agent ends its turn and gets a new one when the run finishes. In a run no conversation started, such as one started by a schedule, a webhook or a form, the agent’s own run pauses until the watched run finishes, then carries on. You find the node on the node picker’s AI shelf.

Connect the node’s output to the agent’s tool handle (labelled Tools). When you click that handle, the node is starred at the top of the list.

This node has no configuration fields.

An agent in a flow started by a Chat trigger, or by a message to your workspace’s Discord, Slack or Telegram bot, gets ask_user, watch_run and schedule_follow_up without wiring anything. Wire any of the three nodes and the agent gets only the wired ones, in every run of the flow. In any other flow, such as one started by a Schedule, the agent has watch_run only when this node is wired to it.

Argument Required Description
runId Yes The id of the run to watch.
note Yes What to do when the run finishes, e.g. check the order rows it wrote. It comes back with the result, to tell the agent why it watched.

The run must belong to your workspace and still be running. A run that has already ended, a run that cannot be found, a run waiting for itself, and an empty note are refused, and the agent is told why.

Watching never needs approval, in any approval mode.

The call returns at once, and the agent ends its turn saying it will report back. When the watched run completes, fails or is stopped, a new turn of the conversation starts with how it ended, for a failure the step that failed and its error, and the note. If a turn of that conversation is still running then, the news reaches that turn instead of starting another.

The new turn runs as the person who asked, and its reply goes where they are. Only a conversation a workspace member started can hold one: the chat page in Publicus or a linked Discord, Slack or Telegram bot, not a public chat webhook.

In the chat page in Publicus each waiting watch is listed under the message box with a Cancel button, and the turn it starts is marked as a follow-up rather than as something the person typed. The Schedules page lists it too, under Follow-ups agents promised, with its own Cancel.

The agent’s run pauses until the watched run completes, fails or is stopped. The call then returns how it ended, for a failure the step that failed and its error, with the note, and the agent carries on.

  • Where it is listed. The Schedules page lists the wait under Follow-ups agents promised, with The run that waits for it linked under Promised to.
  • Cancel. Cancelling it there wakes the waiting run, and the agent is told it was cancelled.
  • When the waiting run ends. When the run that waits is stopped or fails, its wait lapses.

A paused run holds no worker while it waits, and the wait does not count toward the agent’s turnMinuteBudget.

In the flow’s control path the node passes the previous node’s output through unchanged. Its work happens as a tool during the agent’s run, not as a step of the flow.

An operations agent answers questions about running imports in the chat page in Publicus.

  1. Add a Chat trigger, an Agent, and a Watch a Run node.
  2. Connect the Watch a Run node’s output to the agent’s tool handle.
  3. In the agent’s system message, tell it to watch a run when someone asks to hear how it ends.

A member writes that the nightly import is still running, gives its run id, and asks to hear when it is done. The agent calls watch_run with that id and the note say how the import ended and which step failed, if one did, and says it will report back. When the import finishes, a new turn starts and the agent reports the result in the same conversation.

  • A conversation, or a run, holds at most 10 waiting watches and follow-ups at once. Past that the agent is told to let one come first or cancel one.
  • An agent answering a portal visitor gets none of these tools; it reaches only what its Toolbox lists.