agents.session-infra-cost-reconcile ​
Re-observe and persist infrastructure cost for one terminal agent session using server-side runner-group billing configuration
Re-observe infrastructure cost for one terminal organization session.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Dag |
| Library | App-agents |
| Version | 1.0 |
Triggers ​
| Source | Endpoint / Event | Description |
|---|---|---|
| API | POST /api/agents/sessions/{session_uuid}/infra-cost/reconcile | Admin recovery of infrastructure-cost evidence for one terminal organization session |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
workflow_run_uuid | string | No | — | DAG-stamped parent run id (auto-injected by the engine) |
organization_uuid | string | Yes | — | — |
session_uuid | string | Yes | — | — |
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 | — | — |
organization_uuid | json | No | — | — |
session_uuid | json | No | — | — |
date_from | json | No | — | — |
date_to | json | No | — | — |
resolve-sessions | json | No | — | — |
fetch-aws | json | No | — | — |
fetch-gcp | json | No | — | — |
fetch-do | json | No | — | — |
persist | json | No | — | — |
noop | 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 | resolve | agents._infra-cost-sync.resolve-sessions | agents._infra-cost-sync.noop |
| 2 | fetch-costs | agents._infra-cost-sync.fetch-aws, agents._infra-cost-sync.fetch-gcp, agents._infra-cost-sync.fetch-do | agents._infra-cost-sync.noop |
| 3 | persist | agents._infra-cost-sync.persist | — |
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 |
|---|---|
agents._infra-cost-sync.resolve-sessions | resolve-sessions |
agents._infra-cost-sync.fetch-aws | fetch-aws |
agents._infra-cost-sync.fetch-gcp | fetch-gcp |
agents._infra-cost-sync.fetch-do | fetch-do |
agents._infra-cost-sync.persist | persist |
agents._infra-cost-sync.noop | noop |
Outcomes ​
| Outcome | Type | Description | State Data Keys |
|---|---|---|---|
reconciled | SUCCESS | Session infrastructure cost reconciled | workflow_run_uuid, session_uuid, organization_uuid |
failed | FAILURE | Session infrastructure cost reconciled 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_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-infra-cost-reconcile",
"initial_data": {
"organization_uuid": "value",
"session_uuid": "value"
}
}