agents.session-sweep-orphaned ​
Fail non-terminal agent sessions whose runner stopped reporting and whose per-session watch is no longer polling
Periodic sweep that closes sessions no watchdog is watching any more.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | App-agents |
| Version | 1.0 |
Triggers ​
| Source | Endpoint / Event | Description |
|---|---|---|
| INTERNAL | internal.invocation | Periodic orphaned agent session reconciliation |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | string | Yes | — | — |
stale_after_seconds | integer | No | — | — |
max_reap | integer | No | — | — |
dry_run | boolean | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | string | No | — | — |
max_reap | integer | No | — | — |
scanned | integer | No | — | — |
reaped | integer | No | — | — |
skipped | integer | No | — | — |
dry_run | boolean | No | — | — |
stale_after_seconds | integer | No | — | — |
sessions | json | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
failed_at_state | string | No | — | — |
failed_layer | json | No | — | — |
failed_step | string | No | — | — |
failure_reason | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
initiated | Yes | No | — | run | — |
run | No | No | — | complete | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
initiated | run | run | — |
run | complete | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "agents.session-sweep-orphaned",
"initial_data": {
"organization_uuid": "value"
}
}