What This Automation Does
This workflow listens for errors in other workflows.
It catches two types of errors: execution errors that happen while running, and trigger errors that happen before starting.
When it finds an error, it sends an email through Gmail with all details needed to fix the problem.
This helps people see errors fast and saves time checking logs by hand.
Who Should Use This Workflow
This workflow is good for teams using n8n to run many automations.
Users who want full visibility on all workflow errors, including trigger problems, will find it useful.
It fits those who need fast email alerts with clear information about what went wrong.
Tools and Services Used
- n8n: Automation platform to run workflows and handle error catching.
- Gmail with OAuth2: Sends formatted emails about errors.
- n8n Error Trigger node: Captures error events from other workflows.
Beginner Step-by-Step: How to Use This Workflow in n8n
Step 1: Import the Workflow
- Download the workflow JSON with the Download button on this page.
- Open n8n editor, click on top right menu, choose “Import from File”.
- Select the downloaded workflow file to import.
Step 2: Set Up Credentials and Config
- Go to the Config node, fill in your n8n base URL where it says
config.appUrl. - Enter your recipient email in
config.emailing.sendTo. - Set the sender name for emails in
config.emailing.senderName. - Make sure Gmail credentials with OAuth2 are added and linked in the Gmail node.
- If needed, update email addresses or workflow IDs to match your setup.
Step 3: Test and Activate
- Manually trigger an error in one of your main workflows to test if this error handler sends an email.
- Check your inbox to confirm the email arrives with full error details.
- If email sends successfully, activate this error workflow and enable it in your main workflows by selecting it as “Error Workflow”.
Tip:
When running self-host n8n, make sure the base URL is reachable externally for links in emails.
Inputs, Processing, and Outputs Explained
Inputs
- Error data from other workflows triggered by Error Trigger node.
- Configuration settings like URLs, email addresses, and sender names.
Processing Steps
- Constants node builds URLs and flags based on error type.
- If node decides if the error is execution or trigger level.
- HTML nodes format error details into readable reports.
- Merge nodes combine HTML blocks and add config data.
- Gmail node sends the email using all prepared data.
Outputs
- Emails with rich HTML showing error names, messages, times, stack traces, and direct links.
- Notifications arrive quickly to the configured recipients.
Common Edge Cases and How to Fix Them
- If emails do not send, check Gmail OAuth2 credentials are active and linked.
- If no error emails come, ensure main workflows use this workflow as their “Error Workflow”.
- If emails show bad HTML or missing info, verify JSON expressions in HTML formatting nodes are correct.
- When running in a private network or behind firewall, external links in emails may not work unless base URL is public.
Customization Ideas
- Change
config.emailing.sendToto add team mailing lists or multiple addresses separated by commas. - Update
config.emailing.senderNameto a name fitting the organization or bot style. - Add extra fields in HTML nodes to show workflow-specific tags or metadata.
- Replace Gmail node with other email nodes if using different email systems.
- Include links to Slack or other messaging platforms with additional notification nodes.
Summary of Benefits
✓ Catches all errors, including trigger-level failures.
✓ Sends detailed email notifications with clear error info.
✓ Saves time by reducing manual log checks.
✓ Helps fix problems faster with direct links and diagnostics.
✓ Works with multiple workflows through a single error handler.
Additional Notes
Make sure the email account used for sending has Gmail OAuth2 credentials set correctly.
Always test error scenarios before going live.
The workflow requires a web-accessible base URL to create meaningful links.
If running a self-host n8n, confirm public access for these links.
