Get Flow Execution Details
get_flow_execution_detailsRetrieve detailed flow execution data including per-action timing, inputs, outputs, and metadata to diagnose step failures and understand flow behavior.
Instructions
Get rich execution details for a flow context: per-action timing, inputs, outputs, and high-level metadata (state, runtime, who ran it, test vs production).
This is the primary diagnostic tool after test_flow or execute_flow — use it to understand what each action did, identify which step failed, inspect inputs and outputs, and iterate on the flow definition.
Uses the ProcessFlow operations API (GET /api/now/processflow/operations/flow/context/{id}), the same endpoint Flow Designer uses to display execution details.
IMPORTANT: Requires flow operations logging to be enabled on the instance. If the execution report is unavailable, the response will include a notice explaining why.
Typical workflow: test_flow → get_flow_execution_details → diagnose → modify flow → test_flow again
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instance | No | The ServiceNow instance auth alias to use. This is the alias configured via `now-sdk auth --add` (e.g., "myinstance", "prod", "test"). The user will typically refer to this by name when saying things like "on my myinstance instance". If not provided, falls back to the SN_AUTH_ALIAS environment variable. | |
| context_id | Yes | The flow context sys_id returned by test_flow, execute_flow, execute_subflow, or execute_action (the contextId field in the result). | |
| scope | No | Scope sys_id for the ProcessFlow API transaction scope query parameter. If omitted, the API uses the default scope. | |
| include_flow_definition | No | Whether to include the full flow definition snapshot in the response. Default: false. Enable only when you need to inspect the raw flow structure. |