Skip to content
Proud to collaborate with Microsoft for Startups

agents.session-watch ​

Poll runner workflow status and finalize the agent session when done

Poll the runner workflow and finalise the AgentSession when the runner exits.

Inputs ​

session_uuid : str — AgentSession.session_uuid organization_uuid : str — Organization UUID (must own the session) runner_workflow_uuid : str - workflow_uuid of the runner execution workflow to watch

Overview ​

PropertyValue
Workflow typeLinear
LibraryApp-agents
Version1.0

Triggers ​

SourceEndpoint / EventDescription
INTERNALinternal.invocationInternal — started by the agents.session-launch DAG after runner launch

Input Schema ​

FieldTypeRequiredDefaultDescription
session_uuidstringYes—AgentSession.session_uuid
organization_uuidstringYes—Organization UUID that owns the session
runner_workflow_uuidstringNo—Optional cloud launcher workflow UUID. DevKit watches the linked RunnerExecution directly.

Output Schema ​

FieldTypeRequiredDefaultDescription
failure_reasonstringNo——
failed_atstringNo——
failed_at_statestringNo——
failed_stepstringNo——
failed_layerjsonNo——
errorstringNo——
error_typestringNo——
completed_atstringNo——
memory_entries_savedintegerNo——
step_countintegerNo——
total_cost_usdjsonNo——
cancelled_atstringNo——
organization_uuidstringNo——
runner_workflow_uuidstringNo——
session_uuidstringNo——
_watch_decisionstringNo——
watch_decisionstringNo——
terminal_session_statusstringNo——
watch_noopbooleanNo——
heartbeat_age_secondsjsonNo——
activity_age_secondsjsonNo——
last_activity_atstringNo——
since_start_secondsjsonNo——
elapsed_secondsjsonNo——
runner_failure_detailjsonNo——
retried_fromstringNo——
retry_countintegerNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
watchingYesNo—poll—
cancellingNoNo—finalize_cancel—
completingNoNo—finalize—
failingNoNo—finalize_failure—
routingNoNo———
cancelledNoYesYes——
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
watchingpollrouting—
routingroute_completecompleting—
routingroute_failfailing—
routingroute_cancelcancelling—
routingroute_continuewatching—
completingfinalizecompleted—
failingfinalize_failurefailed—
cancellingfinalize_cancelcancelled—
* (any state)failfailed—

Outcomes ​

OutcomeTypeDescriptionState Data Keys
watchedSUCCESSAgent session watch completedsession_uuid, terminal_session_status, organization_uuid
cancelledCANCELLEDOperation cancelledsession_uuid, terminal_session_status, organization_uuid
failedFAILUREAgent session watch completed failedfailure_reason, error, error_type, failed_at_state, failed_step, failed_layer

Business Errors ​

CodeMessage Template
AGENTS_ORGANIZATION_CONTEXT_INVALIDAuthenticated organization context is missing or does not match the workflow input
AGENTS_SESSION_NOT_FOUNDAgent session {session_uuid} was not found in the organization
AGENTS_CONFIG_NOT_FOUNDAgent configuration {agent_config_uuid} was not found in the organization
AGENTS_RUNNER_GROUP_NOT_FOUNDRunner group {runner_group_uuid} was not found in the organization
AGENTS_VALIDATION_FAILEDWorkflow input or domain state failed validation:
AGENTS_CONFLICTConflicting agent domain state:
AGENTS_PROVIDER_FAILEDUpstream provider or runner call failed:
AGENTS_MCP_CALL_FAILEDMCP tool call failed for {tool_name}:

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "agents.session-watch",
  "initial_data": {
    "session_uuid": "value",
    "organization_uuid": "value"
  }
}