Skip to content
Proud to collaborate with Microsoft for Startups

agents.metrics-step-close ​

Close a step metric row with token counts and latency

Finalise a step metric row with token counts, latency, and finish reason.

Overview ​

PropertyValue
Workflow typeLinear
LibraryApp-agents
Version1.0

Triggers ​

SourceEndpoint / EventDescription
INTERNALinternal.invocationInternal — called by the runner agent to record execution metrics

Input Schema ​

FieldTypeRequiredDefaultDescription
step_metric_uuidstringNo——
session_uuidstringNo——
organization_uuidstringNo——
step_numberintegerNo——
turnintegerNo——
tokens_promptintegerNo——
tokens_completionintegerNo——
tokens_cache_readintegerNo——
tokens_cache_writeintegerNo——
tokens_reasoningintegerNo——
model_namestringNo——
finish_reasonstringNo——
latency_msintegerNo——
errorstringNo——
cached_completionstringNo——
cached_outputdictNo——

Output Schema ​

FieldTypeRequiredDefaultDescription
errorstringNo——
error_typestringNo——
failed_atstringNo——
failed_at_statestringNo——
failed_layerjsonNo——
failed_stepstringNo——
failure_reasonstringNo——
finished_atjsonNo——
step_metric_uuidjsonNo——
session_uuidjsonNo——
organization_uuidjsonNo——
step_numberjsonNo——
turnjsonNo——
tokens_promptjsonNo——
tokens_completionjsonNo——
tokens_cache_readjsonNo——
tokens_cache_writejsonNo——
tokens_reasoningjsonNo——
model_namejsonNo——
finish_reasonjsonNo——
latency_msjsonNo——
cached_completionjsonNo——
cached_outputjsonNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
initiatedYesNo—run—
runNoNo—complete—
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
initiatedrunrun—
runcompletecompleted—
* (any state)failfailed—

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "agents.metrics-step-close",
  "initial_data": {
    "step_metric_uuid": "value",
    "session_uuid": "value",
    "organization_uuid": "value",
    "step_number": 123
  }
}