1. Opening Problem Statement
Meet Sarah, a Workflow Administrator managing multiple business-critical automations in n8n. Every week, she spends nearly 2 hours manually checking the execution history of each workflow to catch failures. Missing a failure could delay crucial operations, costing productivity and causing frustration. This repetitive monitoring is error-prone and inefficient—Sarah needs a reliable way to automate failure reporting without logging into n8n every day.
2. What This Automation Does
This specific n8n automation compiles all workflow failures from the past 7 days and sends a consolidated report via Telegram. When triggered weekly, it:
- Retrieves all executions of a specified workflow from n8n’s internal execution history.
- Filters failures that occurred within the last 7 days.
- Creates a custom message for each failure, including workflow name, execution ID, and failure date.
- Aggregates these messages into a single notification.
- Sends the aggregated failure report to a specified Telegram chat via the Telegram node.
This automation saves Sarah over 2 hours per week in manual checks and ensures she never misses an important failure alert.
3. Prerequisites ⚙️
- n8n Account (cloud or self-hosted) with API access enabled.
- Telegram Bot Token and Chat ID to send messages.
- Properly configured n8n credentials for accessing the execution API and Telegram.
4. Step-by-Step Guide
Step 1: Set Up the Schedule Trigger to Run Weekly
In n8n, add a Schedule Trigger node:
- Click + Add Node → search for Schedule Trigger.
- Set “Interval” to trigger every 7 days.
- This ensures the workflow runs once a week automatically.
- Click + Add Node → search for n8n node (type: execution resource).
- Configure to retrieve all executions for a specific workflow ID.
- Set it to return all results (not just the first page).
- Set conditions to:
- Execution start date > current time minus 7 days.
- Execution’s finished status is false (not successfully finished).
- This filters only failures within the last week.
- Create a new string field “message” with the template:
⚠️ Workflow `{{ $json.workflowData.name }}` failed to run! [execution]({{ $json.id }}) [date]({{ $json.startedAt }}) - This builds a unique alert message per failure with clickable links to the execution details and date.
- Choose to aggregate all “message” fields from input data.
- This step consolidates all failure alerts into one message to avoid spamming.
- Provide Telegram bot credentials and target chat ID.
- Set the message text to the aggregated message from the previous step using expression:
{{$json.message.join("n")}}. - This sends a clean, readable weekly failure report directly to your Telegram app.
- Change Workflow Scope: In the “Get all previous executions” node, specify a different workflow ID to monitor other workflows.
- Adjust Timeframe: Modify the date filter in “Filter for executions of the week” node to check failure windows other than 7 days.
- Customize Telegram Message: Edit the message template in the “Set a message for each failed execution” node to include more info, e.g., error messages.
- Add Multiple Notification Channels: Duplicate the Telegram node and add other notification nodes like Email or Slack for multi-channel alerts.
- Confirm Telegram bot token and chat ID are correctly configured.
- Validate workflow ID input in “Get all previous executions” node matches your target workflows.
- Test Schedule Trigger to ensure weekly runs activate correctly.
- Run manual test execution and verify messages appear in Telegram.
Common mistake: Forgetting to specify 7 days interval causes the workflow to run too often or never.
Step 2: Retrieve All Execution Records
Add the n8n Internal Execution node:
You can leave the workflow ID empty to monitor all workflows or specify a workflow ID for targeted checks.
Common mistake: Forgetting to enable return all causes incomplete data retrieval.
Step 3: Filter Failures Within the Last 7 Days
Add a Filter node to process execution results:
Common mistake: Misconfiguring date comparison logic or operator types.
Step 4: Format Failure Messages
Add a Set node:
Common mistake: Syntax errors or incorrect field references.
Step 5: Aggregate Messages Into Single Notification
Add an Aggregate node:
Common mistake: Forgetting to aggregate leads to multiple separate messages.
Step 6: Send the Report via Telegram
Add the Telegram node:
Common mistake: Invalid chat ID or bot permissions cause sending issues.
5. Customizations ✏️
6. Troubleshooting 🔧
Problem: “No failures are appearing in the Telegram report despite recent errors.”
Cause: Incorrect workflow ID or filtering conditions in “Get all previous executions” or “Filter” node.
Solution: Double-check workflow ID is correct and the date condition captures last 7 days properly. Test by manually triggering workflow and inspecting execution data.
Problem: “Telegram messages fail to send.”
Cause: Invalid bot token, missing chat ID, or Telegram API restrictions.
Solution: Verify Telegram credentials and that bot has permission to send messages to the chat. Use Telegram API test tools to confirm connectivity.
7. Pre-Production Checklist ✅
8. Deployment Guide
Once tested, activate the workflow in n8n’s editor using the “Activate” toggle. The Schedule Trigger ensures weekly execution without manual intervention. For monitoring, enable webhook logs or use n8n’s execution logs to track failures. Adjust notification settings in Telegram as needed.
9. FAQs
Q: Can I use Slack instead of Telegram for notifications?
A: Yes, by replacing the Telegram node with Slack nodes configured with your workspace credentials.
Q: Does this workflow use a lot of n8n API calls?
A: It fetches executions once per week, so API usage is minimal and well within typical usage limits.
Q: Is the Telegram bot secure?
A: Yes, your bot’s credentials and chat ID should be kept private, and Telegram uses encrypted communication.
10. Conclusion
By following this guide, you’ve automated weekly failure detection and reporting for your n8n workflows using the Telegram node. This saves precious time, catches failures promptly, and keeps you informed wherever you are. Next, consider expanding this by adding email alerts, integrating Slack, or automating resolution steps. Keep improving your automation monitoring to stay ahead!