Get Flow Execution Logs
get_flow_logsRetrieve flow execution logs for a context ID to debug errors, warnings, and cancellation reasons. Provides step-level output for troubleshooting ServiceNow flow runs.
Instructions
Retrieve flow execution log entries from sys_flow_log for a given context.
Log entries include error messages, step-level debug output, and cancellation reasons. Use this alongside get_flow_execution_details to get the full picture of what happened during an execution.
Note: Log entries may be empty for simple successful executions, or if the flow's reporting level is set to NONE. Errors and warnings are always logged regardless of the reporting level setting.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of log entries to return. Default: 100. | |
| 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. | |
| order_direction | No | Order direction: "asc" (default, oldest first) or "desc" (newest first). |