Quick overview
This workflow triggers when the n8n instance starts, checks recent executions via the n8n API for unfinished runs, summarizes which workflows are affected, and posts a restart and incident summary to Discord and Telegram (with an optional Slack message).
How it works
- Triggers when the n8n instance initializes (server restart/startup).
- Sets runtime variables (restart timestamp, lookback window, and maximum executions to fetch) and retrieves recent executions from the n8n API.
- Filters executions to those that are still unfinished and started within the configured lookback window.
- Groups the filtered executions by workflow ID, counts how many are affected per workflow, and sorts them by highest count.
- Builds formatted Discord, Slack, and Telegram messages that include the restart time, an estimated downtime/gap, and links to the affected workflows’ execution pages.
- Sends the message to a Discord channel via a Discord webhook and to a Telegram chat via the Telegram Bot API (Slack posting is present but disabled).
Setup
- Create and add an n8n API credential with permission to read executions.
- Create a Discord incoming webhook for your target channel and add it as a Discord webhook credential.
- Create a Telegram bot, add the Telegram API credential, and set the target chat ID.
- Update the fallback n8n base URL (and optional mention IDs) in the JavaScript configuration so the generated workflow links and tags are correct.
- If you want Slack notifications, enable the Slack step and configure Slack credentials and the target channel.