Get the most recent automation trace
automations_get_last_automation_traceRetrieve the current trace for a Home Assistant automation in one call to debug failed or missing runs. Returns the run's step-by-step execution details without manual trace listing.
Instructions
Fetch the most recent trace for an automation in one call.
Calls trace/list for automation_id, then picks a run_id (the most
recent overall, or with failed_only=True the most recent whose
script_execution isn't 'finished') and calls trace/get for it.
Use when: debugging "why didn't this fire?" without first listing
traces and picking a run_id by hand.
Returns: dict with the full step-by-step trace for the picked run.
Errors: returns {"error": "no_traces"|"no_failed_traces", "automation_id": aid} when no matching run exists.
Limits: blocks for two sequential WebSocket round trips.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| failed_only | No | If True, pick the most recent run that did not finish cleanly instead of the most recent run overall. Defaults to False. | |
| automation_id | Yes | Automation config id to fetch the latest trace for, bare or prefixed ('automation.<id>'). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||