Skip to content
Proud to collaborate with Microsoft for Startups

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 ​

PropertyValue
Workflow typeDag
LibraryApp-agents
Version1.0

Triggers ​

SourceEndpoint / EventDescription
APIPOST /api/agents/sessions/{session_uuid}/infra-cost/reconcileAdmin recovery of infrastructure-cost evidence for one terminal organization session

Input Schema ​

FieldTypeRequiredDefaultDescription
workflow_run_uuidstringNo—DAG-stamped parent run id (auto-injected by the engine)
organization_uuidstringYes——
session_uuidstringYes——

Output Schema ​

FieldTypeRequiredDefaultDescription
errorstringNo——
error_typestringNo——
failed_atstringNo——
failed_at_statestringNo——
failed_layerjsonNo——
failed_stepstringNo——
failure_reasonstringNo——
workflow_run_uuidjsonNo——
organization_uuidjsonNo——
session_uuidjsonNo——
date_fromjsonNo——
date_tojsonNo——
resolve-sessionsjsonNo——
fetch-awsjsonNo——
fetch-gcpjsonNo——
fetch-dojsonNo——
persistjsonNo——
noopjsonNo——
compensation_triggerjsonNo——
comp_queuejsonNo——
comp_current_layerjsonNo——
comp_retry_countjsonNo——

DAG Layers ​

#LayerStepsCompensation
1resolveagents._infra-cost-sync.resolve-sessionsagents._infra-cost-sync.noop
2fetch-costsagents._infra-cost-sync.fetch-aws, agents._infra-cost-sync.fetch-gcp, agents._infra-cost-sync.fetch-doagents._infra-cost-sync.noop
3persistagents._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-workflowStep name
agents._infra-cost-sync.resolve-sessionsresolve-sessions
agents._infra-cost-sync.fetch-awsfetch-aws
agents._infra-cost-sync.fetch-gcpfetch-gcp
agents._infra-cost-sync.fetch-dofetch-do
agents._infra-cost-sync.persistpersist
agents._infra-cost-sync.noopnoop

Outcomes ​

OutcomeTypeDescriptionState Data Keys
reconciledSUCCESSSession infrastructure cost reconciledworkflow_run_uuid, session_uuid, organization_uuid
failedFAILURESession infrastructure cost reconciled 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_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-infra-cost-reconcile",
  "initial_data": {
    "organization_uuid": "value",
    "session_uuid": "value"
  }
}