On Coding Agent Event
on_coding_agent_event · Nodes · Trigger · Trigger
Starts the workflow when a Relay coding session reports an event.
On Coding Agent Event#
Starts the workflow when a Relay coding-agent session reports an event.
- Tag:
on_coding_agent_event - Input: none
- Output:
output
One workflow run per accepted event from the coding sessions of one Verdalia Relay connection,
whether OpenCode, Oh My Pi or Claude Code runs it in a mount, or the relay observes it in
Paseo. The session can be driven from the Coding Agents page, a relay_coding_agent node,
another workflow, an agent tool or, for a Paseo session, Paseo itself. Import a stored mount
session with relay_coding_agent's import_session before listening for its events.
Paseo's top-level foreground agents are coding sessions as soon as the relay reports them.
This is the listening half of relay_coding_agent. relay_coding_agent opens sessions and sends
messages, and this trigger reacts when a turn finishes, the coding agent asks permission or a
question, or another selected event occurs.
Relay offers a mount provider only when it is enabled and its command is found on the user
PATH. relay_list shows the available providers and lists enabled providers with missing
commands under unavailable. See Relay Coding Agent
for startup and import errors.
relay_coding_agent(send_prompt) ──▶ … the prompt
on_coding_agent_event ──▶ branch on output.envelope.event.type ──▶ Telegram Send
Match a sent message's events by the message_id the send_prompt op returned: prompt_queued,
prompt_started, prompt_steered, prompt_recorded, cancel_requested, prompt_finished and
prompt_failed carry it as envelope.event.message_id.
Config#
connection: the one Verdalia Relay connection whose sessions to listen to. A trigger holds one
relay's event stream from the moment it is installed and has no input, so a template is refused:
saving reports "Connection cannot be a template here" and installing fails with "takes one fixed
connection, not a template". Add one trigger per relay. Its output's connection_id is what a
downstream relay node templates on to answer the relay the event came from.
session_id: the coding session to follow, picked from the workspace's coding sessions; it is
stored as the session's Verdalia id, the one relay_coding_agent reports (session.id from
start_session, open_session or read_session, or session_id from
find_session_by_provider_id). Leave it unset (null, the default) to listen to every coding
session of the connection. Installation fails when no coding session has that id on the
connection.
event_types: which events start a workflow. Accepted values: session_opened,
history_replay_started, history_replay_finished, prompt_queued, prompt_started,
prompt_steered, prompt_recorded, cancel_requested, prompt_finished, prompt_failed, agent_exited,
session_closed, user_message_chunk, agent_message_chunk, agent_thought_chunk,
tool_call, tool_call_update, plan, available_commands_update, current_mode_update,
config_option_update, session_info_update, usage_update, capabilities_update,
activity_update, permission_requested, permission_resolved, question_requested,
question_resolved, question_restated, notice, compaction, agent_message, history_reset,
and frame_undecodable. An empty array accepts all of them.
The default is ["prompt_finished", "prompt_failed", "permission_requested", "question_requested"]. That covers both ways a prompt can end and the points where a session
waits for someone: to decide on a permission, or to answer its questions. Each prompt ends with
exactly one of prompt_finished or prompt_failed, except a prompt that joined a running turn
(prompt_steered), which ends with that turn. Chunks and tool traffic are available but not in
the default. A single prompt produces many of them, and each accepted event starts its own run.
question_restated is not in the default either: the question it restates ended before, and was
acted on then. Nor is prompt_queued: the message's own turn events follow it.
prompt_recorded is off by default. Select it to start a workflow when the Relay confirms that
the coding agent's own history holds the message, even if the turn has yet to finish.
{
"on_coding_agent_event": {
"connection": "01JCONNECTION00000000000000",
"session_id": null,
"event_types": ["prompt_finished", "prompt_failed", "permission_requested", "question_requested"]
}
}
Hear what Paseo agents report beyond their turns, such as notices and messages from other agents:
{
"on_coding_agent_event": {
"connection": "01JCONNECTION00000000000000",
"session_id": null,
"event_types": ["notice", "agent_message", "prompt_finished"]
}
}
Output#
The output is {connection_id, session_id, provider, envelope}:
{
"connection_id": "01JCONNECTION00000000000000",
"session_id": "01JSESSION0000000000000000",
"provider": "opencode",
"envelope": {
"at": "2026-09-26T12:00:00Z",
"event": { "type": "prompt_finished", "message_id": "01JMESSAGE0000000000000000", "stop_reason": "end_turn" }
}
}
session_id is the coding session's Verdalia id, the same one relay_coding_agent takes.
provider is opencode, omp, claude, or paseo. Use relay_coding_agent's read_session
to get the provider's own id (session.provider_session_id) or the session's location. For a
mount session, session.location has kind: "mount" and directory; change workflow filters
on location.kind from "acp" to "mount". The trigger itself returns no location.
envelope.at is when the event happened, in RFC 3339 format: Paseo's own time for an event from
a Paseo session's timeline (or, for the replayed turns of a reopened Claude Code session, the time
Claude Code's transcript records), otherwise the time the Relay recorded it. An event from a Paseo
session's timeline also carries envelope.place {epoch, seq, turn}: the timeline's epoch, the
sequence number Paseo gave it, and the turn it belongs to when Paseo names one. Branch on
envelope.event.type to handle event types differently.
Most events belong to an item of the session: a message, a thought, a tool call, a plan, a
permission request, a question, a notice, a compaction, or another agent's message. They carry
the item's item_id, which stays the same for every event of that item. A user message's
item_id is the message_id its prompt events carry.
session_opened:session_id,mode(newfor a started session,loadfor an opened one), optionalagent{name, title, version},capabilities,config_options, optionalmodes.capabilitiessays what the session supports, each atrue/false:load,list,close,images(prompts may carry images),reload(the agent can be reloaded in its coding agent),rewind_conversation(the conversation can be rewound to a user message),rewind_files(the files the agent changed can be put back as they were before a user message),rewind_both(conversation and files together),fork(a new coding session can start with this one's conversation up to a turn),interrupt(a message can stop the running turn and start the next one),attachments(a message can carry files other than images, issues and pull requests, and diff comments), andfind(the session's history can be searched and its prompts listed). OpenCode, Oh My Pi and Claude Code report the last eight asfalse.history_replay_started/history_replay_finished: bracket the history that aloadreplays.prompt_queued:message_id,sender. The relay holds the user messagemessage_iduntil the agent takes it.senderis who sent it through Verdalia:person,agent,workflowormcp_client, ornullfor a session start's first prompt.prompt_started:message_id,text. The user messagemessage_idwas delivered and started a turn. A Paseo turn someone else started has amessage_idof its own and may have an emptytext.prompt_steered:message_id,text. A message sent to Claude Code or Paseo joined a running turn. That turn ends once, under themessage_idthat started it.prompt_recorded:message_id. The Relay has evidence that the coding agent's history holds this user message. Use it to confirm recording; useprompt_finishedfor turn completion.cancel_requested:message_id, the message whose turn is being stopped.prompt_finished:message_id,stop_reason(end_turn,max_tokens,max_turn_requests,refusalorcancelled).prompt_failed:message_id,error.error.kindisrpc(withcodeandmessage),undecodable(witherror),agent_exited,dropped(the turn was stopped before this prompt was delivered), orprovider(withmessageand optionalcode, the provider's own failure).agent_exited:expected(truewhen the session was closed),exit.exit.kindisprocess(withcode,signal,stderr_tail) ordisconnected(withreason: the relay lost its connection to Paseo).session_closed: the session was closed. It sends no further events.user_message_chunk/agent_message_chunk/agent_thought_chunk:item_id,offset, optionalmessage_id, andcontent: one piece appended to a message or thought.offsetis how long the item was before it, in UTF-16 code units of its text plus one per other part.message_idis the agent's own id for the message.content.typeistext(withtext),resource_link,resource,image,audio, orunsupported.tool_call:tool_call_id,title, optionalname,kind,status,content,locations, optionalraw_input, and optionaldetail.tool_call_update:tool_call_idand only the fields that changed.plan:entries, each{content, priority, status}.available_commands_update:commands, each{name, description, input_hint}.current_mode_update:mode_id.config_option_update:config_options.session_info_update:titleandupdated_at. A missing field did not change, andnullmeans it was cleared.usage_update:used,size, optionalcost{amount, currency}, optionalinput,cachedandoutputtoken counts, and optionaltoken_spanandcost_span(last_turnorsession). The Relay reports each span for a Paseo session when it knows what the Paseo provider reports, and omits the span when unknown. A Paseo session sends an update whenever Paseo reports new usage, including during a turn. When a report leaves out the cost or a token count, the session repeats the last one it sent. It sends no cost while Paseo reports none.capabilities_update:capabilities, the whole new set insession_opened's shape, sent only when it changes. A Paseo session'srewind_conversation,rewind_filesandrewind_botharefalsewhile Paseo has stopped its agent's process, and follow what the agent reports once it starts again. Not in the default.activity_update:delegates(the subagents) andbackground, both whole lists, sent when either changes; Paseo sessions only. Each subagent is{id, title, description, status},statusone ofrunning,completed,failedorcanceled; each item of background work is{id, kind, description, command, started_at, can_stop},kindone ofshell,monitororother. A missingtitle,descriptionorcommandwas not given. Not in the default.permission_requested:request_id,tool_call, andoptions, each{option_id, name, kind}. Answer the request withrelay_coding_agent'sanswer_permission_request, passingsession_id,request_idand the chosenoption_id.permission_resolved:request_id,resolution.resolution.outcomeisselected(withoption_id),cancelled,withdrawn,agent_exited, orunknown: Paseo stopped waiting on the request without saying how it ended.question_requested:request_id, optionaltitle,descriptionandintro, andquestions, each{question, header, options, multi_select, allow_other, allow_empty, placeholder, dismiss_label, detail, link}withoptionseach{label, description, preview}.header,placeholder,dismiss_label,detail,linkand an option'sdescriptionandprevieware optional. Paseo usestitleanddescriptionfor its notification preview.introappears before the questions anddetailappears below its question. A question accepts the user's own words when it has no options orallow_otheris set, multiple options whenmulti_selectis set, and an empty answer whenallow_emptyis set. Claude Code emits this event forAskUserQuestionand MCP server requests (elicitations). An MCP form has one question per field and anintrosuch as<server> asks: <message>. A URL request has an HTTP(S)link; the card shows the full URL and Open link opens it in a new tab without answering the question. An unsupported form or a non-HTTP(S) URL is cancelled with anoticenaming the server. Userelay_coding_agent'sanswer_questionordecline_questionto respond. An invalid form answer fails withinvalid_question_answer, naming the question and what it needs, and leaves it open.question_resolved:request_id,resolution.resolution.outcomeisanswered(withanswers, one per question in order: the answer as text, including typed MCP form values rendered as text,""ornullfor an empty answer, ornullwhen Paseo did not report it; andgiven, the original picks and text as{"selected": [labels], "custom": "text"},nullfor one left empty or not reported),declined,withdrawn,agent_exited, orunknown: Paseo stopped waiting on the request without saying how it ended.question_restated:request(asquestion_requestedcarries it) andresolution(asquestion_resolvedcarries it). A question the session asked and saw end before its history was replayed (after ahistory_reset, a Relay restart, or the session being opened again), restated right after thetool_callit was asked in, or at the end of the replayed history when that call is not known. It is not a new question and has nothing to answer.notice:level(info,warning, orerror) andmessage: something the agent wants seen that belongs to no message. For a Paseo session, a failure Paseo records outside a prompt the relay follows (a failed command, a turn failure no prompt took, a failure in replayed history) is anoticewith levelerror. The agent's message chunks are only what it said. A Paseo session also gets aninfonotice "Idle. Your next message starts it." when Paseo stops its agent's process, and "Started" when it starts it again.compaction:status(loadingorcompleted), optionaltrigger(autoormanual), and optionalpre_tokens: the agent is compacting its context, or has.agent_message:tool_call_id,event(message,finished,errored,permission_required, orclosed),sender{id, title}, andtext: another agent spoke to this one through that tool call.history_reset: the session's history was replaced; every earlier event no longer applies. Read the session again withrelay_coding_agent'sread_session.frame_undecodable:frame,error. The Relay received a message from the agent that it could not read.
A tool call's detail, when reported by Claude Code or Paseo, is tagged by type:
shell:command, optionalcwd,output,exit_code.read:path, optionalcontent,offset,limit.edit:path, optionalold_text,new_text,unified_diff.write:path, optionalcontent.search:query, optionaltool(search,grep,glob, orweb_search),content,paths, optionalmatches.fetch:url, optionalresult,status.worktree_setup:path,branch,log,commands.
File paths in tool content, locations and details are {scope: "mount", path} relative to the
session's mount root, or {scope: "host", path} when the path is outside every mount (always for a
Paseo session).
Delivery behavior#
- Only events sent while the trigger is installed start a workflow; a session's earlier events are
never replayed into it.
relay_coding_agent'sread_sessionreturns the events of a running session. - A session that is already running when the workflow is installed is picked up from its next event.
- Each matching event starts one run, in the order the Relay sent them, including events that arrive while earlier runs are still going.
- For a static Relay, the backend asks the Relay to post events here while the trigger is installed, and keeps renewing that request. The Relay machine must be able to reach the backend's app URL, or no events arrive. A dynamic Relay sends its events over its existing link.
- Events sent while the Relay is disconnected are lost.
- Changes to the Relay's Paseo projects and agents start no workflow: only session events do.
- If the workflow is run without a staged event, this trigger's outgoing branch is skipped. Other roots in the same workflow still run as usual.
Failure behavior#
- Installation fails when the connection is missing, is not a Verdalia Relay connection, or has not
been paired, when
session_idnames no coding session of the connection, and when the Relay answers but needs updating: averdalia-relayolder than coding sessions sends events that do not name their coding agent. The failure appears as a workflow install diagnostic. A Relay that is offline does not fail installation: its events start arriving once it is back. - A run Verdalia cannot queue is retried.
Inputs
None.
Outputs
output
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
connection | connection(verdalia_relay) | Yes | Verdalia Relay connection whose coding sessions to listen to |
session_id | nullable<coding_session_ref> | No | Verdalia id of the coding session to follow, as Relay Coding Agent reports it. Unset listens to every coding session of the connection. |
event_types | array<enum(session_opened, history_replay_started, history_replay_finished, prompt_queued, prompt_recorded, prompt_started, prompt_steered, cancel_requested, prompt_finished, prompt_failed, agent_exited, session_closed, user_message_chunk, agent_message_chunk, agent_thought_chunk, tool_call, tool_call_update, plan, available_commands_update, current_mode_update, config_option_update, session_info_update, usage_update, capabilities_update, activity_update, permission_requested, permission_resolved, question_requested, question_resolved, question_restated, notice, compaction, agent_message, history_reset, frame_undecodable)> | No | Which session events start a workflow. An empty list accepts every one of them. Each accepted event is a workflow run of its own. The optional `activity_update` event carries both whole lists of subagents and background work when either list changes on a Paseo session. |
base_config | record | No | Shared node configuration. failure_mode decides what a failure of this node does to the workflow; leave it at the default stop unless the workflow handles the failure itself on the node's error output (route_to_error) or the node is a rare emergency kill switch (stop_workflow). |