agents.session-restore ​
Build a restore context payload from an existing agent session
Build a restore-context payload from an existing AgentSession.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | App-agents |
| Version | 1.0 |
Triggers ​
| Source | Endpoint / Event | Description |
|---|---|---|
| API | POST /api/agents/sessions/{session_uuid}/stop | API — stop or restore an agent session |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
session_uuid | string | Yes | — | AgentSession session_uuid to restore from |
organization_uuid | string | Yes | — | Organization UUID (security check) |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
error | string | No | — | — |
error_type | string | No | — | — |
failed_at | string | No | — | — |
failed_at_state | string | No | — | — |
failed_layer | json | No | — | — |
failed_step | string | No | — | — |
failure_reason | string | No | — | — |
restore_context | json | No | — | — |
session_uuid | json | No | — | — |
organization_uuid | json | 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 | — |
Outcomes ​
| Outcome | Type | Description | State Data Keys |
|---|---|---|---|
restored | SUCCESS | Agent session restore context prepared | restore_context, session_uuid, organization_uuid |
failed | FAILURE | Agent session restore context prepared failed | failure_reason, error, error_type, failed_at_state, failed_step, failed_layer |
Business Errors ​
| Code | Message Template |
|---|---|
AGENTS_ORGANIZATION_CONTEXT_INVALID | Authenticated organization context is missing or does not match the workflow input |
AGENTS_SESSION_NOT_FOUND | Agent session {session_uuid} was not found in the organization |
AGENTS_CONFIG_NOT_FOUND | Agent configuration {agent_config_uuid} was not found in the organization |
AGENTS_RUNNER_GROUP_NOT_FOUND | Runner group {runner_group_uuid} was not found in the organization |
AGENTS_VALIDATION_FAILED | Workflow input or domain state failed validation: |
AGENTS_CONFLICT | Conflicting agent domain state: |
AGENTS_PROVIDER_FAILED | Upstream provider or runner call failed: |
AGENTS_MCP_CALL_FAILED | MCP tool call failed for {tool_name}: |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "agents.session-restore",
"initial_data": {
"session_uuid": "value",
"organization_uuid": "value"
}
}