Skip to content
AutomationTutorial

n8n error handling: catch failures before leads go missing

Set up n8n error handling with email alerts, a safe failure test, and a recovery checklist that helps you avoid missed inquiries and duplicate messages.

RunbookOctober 3, 20268 min read
n8n error handling: catch failures before leads go missing
FIG. 01 — FEATURED

This sheet contains partner links. A purchase through one earns Runbook a commission at no additional cost to you. How we make money.

A failed lead automation can leave a customer waiting while your team thinks the inquiry was handled. You'll set up n8n error handling that emails a responsible person, links to the failed run when available, and gives them a recovery checklist. Allow roughly an hour with n8n and your business email account, longer if you need help connecting email.

What you'll build

Your alert will live in a separate workflow, n8n's name for an automated routine. A node is one step in that routine. An execution is one attempt to run it.

The main routine does the business work. The alert routine starts when the main routine fails. Keep the alert short: identify the routine, point to its history, and tell someone to investigate before repeating anything.

This is a documented setup, with official instructions checked October 3, 2026. The time allowance is a planning estimate, not a measured test result. Start with one important routine, such as the guarded inquiry process in the n8n AI agent setup guide.

Stack

You need access to edit workflows in n8n, an email account that permits automated sending, and a recipient responsible for checking failures. Use an internal address you actually monitor.

The email connection uses SMTP, the standard method an application uses to send mail through your provider. Gather its server address, username, password, and connection settings before opening n8n. Your provider might require an app password, a separate password created for this connection.

You also need a harmless test routine. Build it from scratch so it contains no customer messaging or record updates.

PieceJobWhat you must confirm
Main workflowPerforms the business taskThe correct alert routine is selected
Error TriggerReceives failure detailsThe failing run started automatically
Send EmailNotifies the responsible personA real test message reaches the inbox
Failure testDeliberately stops a disposable routineThe alert identifies the test correctly

Steps

1. Create the alert routine

Open a new workflow and name it Automation failure inbox. Select Add first step, search for Error Trigger, and choose it. This node receives information about failures in workflows connected to it.

Save the workflow, or confirm that the editor has saved it automatically. The Error Trigger instructions specify that this alert workflow doesn't need to be published. Publishing is how ordinary scheduled workflows become live; Error Trigger follows a different rule.

Keep this routine limited to notification. Don't add a step that resends the customer's message or restarts the broken business task.

2. Connect your email account

Select the plus connector after Error Trigger. Search for Send Email and choose the Send operation. Under Credential to connect with, select an existing working connection or create an SMTP account credential. A credential is the saved login n8n uses for this service.

Enter the provider's values for User, Password, Host, and Port. Host means the sending server's address; port identifies the connection it accepts. Match the provider's security instructions. n8n's credential guidance uses SSL/TLS on for port 465, or off for port 587 with STARTTLS available. Both names describe ways to encrypt the connection. Don't guess these settings from your website address.

Set From Email to the address your provider allows you to send from. Set To Email to the responsible person's inbox. Enter Automation needs attention as the subject and choose Text under Email Format. The Send Email reference documents these fields and links to the credential instructions.

Put the message from “Copy this” below into the text body. Switch that field to Expression, which lets n8n insert values from the failed run into your message. Save the changes.

3. Build a controlled failure

Create another workflow named Failure alert check. Choose Add first step > Schedule Trigger. Set Trigger Interval to Minutes and Minutes Between Triggers to 5. Five minutes is a suggested test interval, not a product requirement.

Add Stop And Error after it. Select Error Message for Error Type, then enter Planned alert check. No customer work performed. in Error Message. This step intentionally marks the run as failed.

In the upper-right three-dot menu, open Settings. Under Error workflow, select Automation failure inbox. Set Save failed production executions to save failed runs, then save the settings. Production executions are automatic runs of your live workflow.

Click Publish, then confirm publishing in the dialog. Wait for the scheduled run instead of pressing the editor's manual execution button. Once the alert arrives, use the dropdown beside Publish > Unpublish to stop the test schedule.

4. Check the whole handoff

Open the email. Confirm that it names Failure alert check and that its run link opens the failed execution for an authorized n8n user. If the link is missing, open the test workflow and select Executions in the top menu.

Check both histories: the test should show a failure, and Automation failure inbox should show a successful notification run. An email appearing in a sent folder isn't the same as reaching the intended inbox.

If nothing arrives, start with those histories. No scheduled execution means the test never ran. A failed Send Email step means the alert routine ran but couldn't deliver its notification. Investigate that connection before attaching it to business work.

Your move

Make one disposable scheduled workflow fail and verify its alert in your own inbox before relying on this setup for customer inquiries.

5. Attach it to the business routine

Open the workflow you actually want to protect. Go to three-dot menu > Settings > Error workflow, choose Automation failure inbox, and save. Also save failed production executions so there is evidence to inspect later.

Open each essential action's Settings tab and inspect On Error. For this first build, use Stop Workflow where failure should halt the routine. n8n's node settings reference distinguishes stopping from continuing with the last valid data or passing an error onward.

If you choose Continue and the routine finishes successfully, don't expect the failure alert to replace a deliberately designed error branch. Keep that more involved design for later.

The part that breaks

The Error Trigger cannot be tested by manually running the business workflow in the editor. It responds to automatic failures. A red failure in a manual test, with no alert email, does not prove your notification setup is broken.

A second trap is expecting every failure to contain a clickable run address. n8n documents that the address requires a saved execution and can be absent when the starting node itself fails. The message below provides a readable fallback.

Finally, an error alert doesn't prove that earlier work was undone. Consider a routine that sends an acknowledgment and then fails while recording an internal note. Before repeating the work, check whether the acknowledgment already went out. Otherwise, your repair can become another interruption for the customer.

This same check belongs in any lead-to-customer-record automation, regardless of which platform moves the information.

Copy this

Paste this into the Send Email text body in Expression mode. The expressions inside double braces read the failure details; the fallback wording handles missing values. The message deliberately excludes raw error text, which can contain information you don't want copied into an inbox.

An automation needs attention.

Routine: {{ $json.workflow?.name || 'Open n8n to identify the routine' }}
Stopped near: {{ $json.execution?.lastNodeExecuted || 'Starting step or unavailable' }}
Run: {{ $json.execution?.url || 'No run link supplied. Open the workflow in n8n.' }}

Check the failed run and the destination system.
Confirm whether any customer message or record already exists.
Fix the cause before repeating unfinished work.
Record who handled the incident and what was recovered.

For the first alert, have its recipient follow those instructions while you watch. If they can't find the affected routine or don't have permission to open it, fix access before expanding coverage.

Upgrade path

Add the same alert routine to your other important workflows only after the disposable test succeeds. Assign an owner to each business process and agree what that person does when an alert arrives outside working hours.

Treat retries as a separate improvement. Retry On Fail repeats a failing node; it doesn't decide whether repeating the business action is appropriate. First use it for a step you've established is safe to repeat, such as reading information, rather than sending another customer message.

For manual recovery, open Executions, find the failed run, and use its Refresh control. n8n offers either the currently saved workflow or the original workflow for retrying, as described in its failed-run recovery instructions. Inspect completed actions before choosing either.

If n8n itself is unavailable, a routine inside it cannot send your alert. Owners running it on their own server need a separate availability check alongside the backups covered in the n8n self-hosting setup.

Your next build is a recovery checklist for the most valuable customer handoff. Write down how to identify unfinished inquiries, verify what already happened, and resume only the missing work.

Frequently asked questions

How do you set up n8n error handling?

Create a separate workflow beginning with Error Trigger, connect an alert action, then select it under Error workflow in the settings of each routine you want to monitor.

Why does n8n Error Trigger not work in a manual test?

Error Trigger responds to failures in automatic runs. Test it with a separate published workflow using Schedule Trigger and Stop And Error, then unpublish that test.

Does an n8n error workflow need to be published?

The workflow beginning with Error Trigger does not need publishing. The scheduled test that causes the failure must be published so it runs automatically.

Should you automatically retry every failed n8n workflow?

No. Check whether earlier steps already sent a message or created a record. Repeat only work you have confirmed is safe, after fixing the cause of the failure.

About Runbook

AI tools and automation builds for marketers. What to use, how to wire it, and the workflow to copy this week. How we work

GET THE NEXT DISPATCH

Run the next build before your competitors read about it.

One short email when an AI tool or automation actually changes the work, with the build to copy.

No send unless there is a build worth running.

// keep_reading

Related builds