# Monitor and auto-heal failed n8n workflow executions: n8n workflow

> Started by a clock, and works across Google Sheets and Slack. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/monitor-and-auto-heal-failed-n8n-workflow-executions (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Alerts and monitoring](https://millionrounds.com/workflows?category=Alerts+and+monitoring#library)

# Monitor and auto-heal failed n8n workflow executions

Started by a clock, and works across Google Sheets and Slack. It hands the judgement calls to OpenAI. 20 steps, 2 branches, 2 loops or waits: a working afternoon to understand properly.

Medium Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fmonitor-and-auto-heal-failed-n8n-workflow-executions)

**20 steps** Medium: a working afternoon

**2** Branches: places the flow splits

**2** Loops or waits

**2** Services it connects to

## The flow

Starts it 1 Model 1 Logic 9 Service 9

The steps in the order they run, from what starts it.

- 1 **Check Every 5 Minutes** Schedule trigger *Starts it*
- 2 **Load Configuration** Set *Logic*
- 3 **Fetch Failed Executions from n8n API** Http Request *Service*
- 4 **Filter Recent Failures Only** Code *Logic*
- 5 **Check If Failures Found** If *Logic*
- 6 **No Failures - Skip** No Op *Logic*
- 7 **Get Full Execution Details** Http Request *Service*
- 8 **Build Error Context for AI** Code *Logic*
- 9 **Diagnose Error with OpenAI** Open Ai *Model*
- 10 **Parse AI Diagnosis Result** Code *Logic*
- 11 **Route by Recommended Action** Switch *Logic*
- 12 **Retry Execution Immediately** Http Request *Service*
- 13 **Wait 2 Min for Rate Limit** Wait *Logic*
- 14 **Wait 15 Min for Service Recovery** Wait *Logic*
- 15 **Notify Admin on Slack** Slack *Service*
- 16 **Send Investigation Report to Slack** Slack *Service*
- 17 **Notify Slack About Auto-Retry** Slack *Service*
- 18 **Retry After Rate Limit Backoff** Http Request *Service*
- 19 **Retry After Service Recovery** Http Request *Service*
- 20 **Log Error to Google Sheets** Google Sheets *Service*

## How it's built

- **Starts on:** A clock
- **Steps:** 20, with 2 branches, 2 loops or waits
- **Size:** Medium: a working afternoon
- **Connects to:** Google Sheets, Slack
- **Model:** OpenAI

## Questions

What does it need to run?

An n8n account, plus your own Google Sheets and Slack accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a clock.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Plan an afternoon. 20 steps is enough that you should read each one before running it.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 20 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fmonitor-and-auto-heal-failed-n8n-workflow-executions)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Google Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)[Slack](https://millionrounds.com/workflows?service=Slack#library)

## Workflows like it

Also alerts and monitoring, with the same services where possible, closest in size first.

- [**AI Stock Trader Bot with Telegram and RSI** 20 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/ai-stock-trader-bot-with-telegram-and-rsi)
- [**Automate peer review assignments with Slack** 20 steps · calls a model · Email, Postgres](https://millionrounds.com/workflow/automate-peer-review-assignments-with-slack)
- [**Deduplicate security alerts into unified cases with Claude** 20 steps · calls a model · Slack](https://millionrounds.com/workflow/deduplicate-security-alerts-into-unified-cases-with-claude)
- [**Monitor NASA asteroid threats with OpenAI and Apify** 20 steps · calls a model · Apify, Discord](https://millionrounds.com/workflow/monitor-nasa-asteroid-threats-with-openai-and-apify)
- [**Monitor Telegram channel intelligence with Apify and OpenAI** 20 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/monitor-telegram-channel-intelligence-with-apify-and-openai)
- [**Monitor programme performance and governance with OpenAI** 20 steps · calls a model · Email, Slack](https://millionrounds.com/workflow/monitor-programme-performance-and-governance-with-openai)
