# Agno now saves failed workflow runs before the stream ends

> Agno saves a failed workflow run with its final status before sending the last streaming event, so the run keeps its record and completed step outputs.

- Published: 2026-09-08
- Author: Ashpreet Bedi
- Categories: Changelog
- Canonical: https://www.agno.com/articles/agno-now-saves-failed-workflow-runs-before-the-stream-ends
- Markdown: https://www.agno.com/articles/agno-now-saves-failed-workflow-runs-before-the-stream-ends.md

A failing Agno workflow run now writes `ERROR` to the database first, then sends `StepError` and `WorkflowError`. Before, a streaming run that failed halfway emitted its `WorkflowError` first and saved the failure after it, so a client that stopped reading at that event could lose the run entirely.

A workflow that resumed after a pause could also fail, save `ERROR` to the database, and still leave its tracked stream stuck at `PAUSED`.

The outputs of steps that completed before the error stay on the run.

![Two sequences compared. Before, Agno sent the WorkflowError event first and saved the run after it, so a client that stopped reading at WorkflowError lost the run. Now Agno saves the run as ERROR first, then sends StepError and WorkflowError, and completed steps keep their output.](https://www.agno.com/images/v3-0-7-failed-workflow-run-save-order.png)

```python
run = workflow.get_last_run_output()
run.status                                         # RunStatus.error
[(s.step_name, s.success) for s in run.step_results]
# [("fetch_orders", True), ("charge_cards", False)]
```

Agno also stopped retrying guardrail rejections in nested workflows. Those retries had replayed the side effects of earlier child steps.

Learn more about [workflow sessions](https://docs.agno.com/sessions/workflow-sessions), and the run records they store, in the documentation.
