agents.session-launch ​
Launch a new agent session: validate, create, load context, start runner, start watch
Orchestrate a full agent session launch.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Dag |
| Library | App-agents |
| Version | 1.0 |
Triggers ​
| Source | Endpoint / Event | Description |
|---|---|---|
| API | POST /api/agents/sessions | Launch a new agent session |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
workflow_run_uuid | string | No | — | DAG-stamped parent run id (auto-injected by the engine) |
workflow_run_id | string | No | — | — |
agent_config_uuid | string | Yes | — | — |
actor_uuid | string | No | — | — |
act_as_identity_app_uuid | string | No | — | ADR-IDENTITY-010 session mode: run this Staff actor session as the actor's own end-user seat in this identity app |
ticket_git_work_uuid | string | No | — | — |
ticket_uuid | string | No | — | — |
repository_uuid | string | No | — | — |
branch_ref | string | No | — | — |
target_ref | string | No | — | — |
base_oid | string | No | — | — |
head_oid | string | No | — | — |
task | string | Yes | — | — |
organization_uuid | string | Yes | — | — |
context | dict | No | — | — |
caller_ref | string | No | — | — |
attachment_uuids | list | No | — | — |
include_platform_defaults | boolean | No | — | — |
refresh_stale_mcp | boolean | No | — | — |
max_tool_rounds | integer | No | — | — |
max_parallel_tool_calls | integer | No | — | — |
safe_retry_resume_nonce | string | No | — | — |
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 | — | — |
workflow_run_uuid | json | No | — | — |
workflow_run_id | string | No | — | — |
agent_config_uuid | json | No | — | — |
actor_uuid | json | No | — | — |
act_as_identity_app_uuid | json | No | — | — |
ticket_git_work_uuid | json | No | — | — |
ticket_uuid | json | No | — | — |
repository_uuid | json | No | — | — |
branch_ref | json | No | — | — |
target_ref | json | No | — | — |
base_oid | json | No | — | — |
head_oid | json | No | — | — |
task | json | No | — | — |
organization_uuid | json | No | — | — |
context | json | No | — | — |
caller_ref | json | No | — | — |
attachment_uuids | json | No | — | — |
include_platform_defaults | json | No | — | — |
refresh_stale_mcp | json | No | — | — |
max_tool_rounds | json | No | — | — |
max_parallel_tool_calls | json | No | — | — |
safe_retry_resume_nonce | string | No | — | — |
reconcile-stale-capacity | json | No | — | — |
validate-create | json | No | — | — |
fetch-secrets | json | No | — | — |
load-skills | json | No | — | — |
load-mcp | json | No | — | — |
load-memory | json | No | — | — |
build-tool-catalog | json | No | — | — |
plan-git-work | json | No | — | — |
reserve-delivery-cost | json | No | — | — |
launch-runner | json | No | — | — |
start-watch | json | No | — | — |
mark-failed | json | No | — | — |
compensation_trigger | json | No | — | — |
comp_queue | json | No | — | — |
comp_current_layer | json | No | — | — |
comp_retry_count | json | No | — | — |
DAG Layers ​
| # | Layer | Steps | Compensation |
|---|---|---|---|
| 1 | reconcile-stale-capacity | runner.execution-reconcile-stale-claims | — |
| 2 | validate-create | agents._session-launch.validate-create | agents._session-launch.mark-failed |
| 3 | load-context | agents._session-launch.fetch-secrets, agents._session-launch.load-skills, agents._session-launch.load-mcp | agents._session-launch.mark-failed |
| 4 | build-tool-catalog | agents.tool-catalog.build | agents._session-launch.mark-failed |
| 5 | load-memory | agents._session-launch.load-memory | agents._session-launch.mark-failed |
| 6 | plan-git-work | ticket.git-work.begin | agents._session-launch.mark-failed |
| 7 | reserve-delivery-cost | ticket.software-delivery.cost-reserve-bundle | agents._session-launch.mark-failed |
| 8 | launch-runner | agents._session-launch.launch-runner | agents._session-launch.mark-failed |
| 9 | start-watch | agents._session-launch.start-watch | — |
Execution Flow ​
Compensation ​
When any layer fails, its compensation steps run in reverse order to roll back the work completed so far.
Sub-workflows ​
| Sub-workflow | Step name |
|---|---|
runner.execution-reconcile-stale-claims | reconcile-stale-capacity |
agents._session-launch.validate-create | validate-create |
agents._session-launch.fetch-secrets | fetch-secrets |
agents._session-launch.load-skills | load-skills |
agents._session-launch.load-mcp | load-mcp |
agents.tool-catalog.build | build-tool-catalog |
agents._session-launch.load-memory | load-memory |
ticket.git-work.begin | plan-git-work |
ticket.software-delivery.cost-reserve-bundle | reserve-delivery-cost |
agents._session-launch.launch-runner | launch-runner |
agents._session-launch.start-watch | start-watch |
agents._session-launch.mark-failed | mark-failed |
Outcomes ​
| Outcome | Type | Description | State Data Keys |
|---|---|---|---|
launched | SUCCESS | Agent session launched | workflow_run_uuid, agent_config_uuid |
failed | FAILURE | Agent session launched 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-launch",
"initial_data": {
"agent_config_uuid": "value",
"task": "value",
"organization_uuid": "value"
}
}