Production-Ready n8n: Errors, Sub-workflows, Handover
Make n8n workflows reliable: error workflows, retries, error outputs, sub-workflows, workflow tools for agents, logging and client handover.
Video chapters
- 00:00Intro
- 00:40What actually breaks in production
- 01:20Step 1: One error workflow for everything
- 02:44Step 2: Retries and error outputs
- 03:49Step 3: Validate input and AI output
- 04:50Step 4: Sub-workflows you can reuse
- 06:10Step 5: Logs, data and secrets
- 07:20Step 6: Handing over to a client
- 08:16The production checklist
- 08:56Eight episodes: what you can build now
Everything we've built so far works. This episode is about making it keep working, and making it something you can confidently hand to a client or an employer: errors that alert you, steps that retry, reusable sub-workflows, logs, and clear documentation.
What you need
- n8n with at least one workflow from the earlier episodes
- Gmail or Telegram credential for alerts
What actually breaks in production
Let's start with what actually goes wrong. In my experience, it's almost always one of five things.
APIs go down. They time out, return server errors, hit rate limits, or your key expires.
Input is bad. Someone submits an empty form, sends a sticker instead of text, or pastes a whole book.
AI surprises you. It returns the wrong format, writes too much, or makes something up.
Failures are silent. The workflow broke on Tuesday, and you found out on Friday, from an unhappy client.
And nobody understands the workflow, including you, six months later. Today we fix all five.
Quick reference
- APIs go down: Timeouts, 500 errors, rate limits, expired keys
- Bad input: Empty fields, wrong formats, huge messages
- AI surprises: Wrong format, too long, invented answers
- Silent failures: It broke on Tuesday. You found out on Friday
- Nobody understands it: No notes, cryptic node names, one giant canvas
Step 1 · One error workflow for everything
Step one fixes silent failures, and it's the most valuable five minutes in this video. Create a new workflow, and call it Error Alerts.
Start it with the Error Trigger node. This trigger runs whenever another workflow that uses it fails.
Add a node that builds a short message: the workflow name, the node that failed, the error message, and a link to the failed execution. All of these come from the Error Trigger's output, and they're in the notes for this episode.
Then send it to yourself on Telegram or by email. You don't need to activate this workflow, because the Error Trigger is called automatically.
Now open each of your real workflows, go to workflow settings, and set the error workflow to Error Alerts. From now on, every failure reaches your phone within seconds.
And test it. Add a node that always fails, like an HTTP request to an address that doesn't exist, run the workflow once, and make sure the alert arrives. An alert system you haven't tested is just a hope.
Keep the alert short and useful. Someone reading it on their phone should know immediately which workflow broke, where, and how to open the failed run. If you look after workflows for several clients, add the client's name to the message too, so you know whose problem it is before you even open your laptop.
Quick reference
Error Trigger → Format alert → Send alert
Workflow settings → Error workflow → “Error Alerts”
Step 2 · Retries and error outputs
Step two handles temporary problems. Most API errors are temporary. A server is busy for a few seconds, then it's fine again. So instead of failing immediately, let the node try again.
Open any node, go to its settings, and turn on retry on fail.
Three tries, with five seconds between them, is a sensible default.
Turn this on for every node that talks to the outside world: HTTP requests, AI models, Google Sheets, and email. It costs nothing when things work, and it saves you when they don't.
For problems that retrying won't fix, look at the on error setting. By default, the workflow stops, and your error workflow fires. But you can choose continue, using error output.
That gives the node a second output, just for failures. On that branch, you decide what happens. Log the problem, try a backup AI model, or reply to the user politely: sorry, I couldn't process that, a person will get back to you. Your user gets an answer, even when something broke.
Quick reference
- Node Settings → Retry On Fail: on
- Max tries: 3 · Wait between tries: 5000 ms
- Use for: HTTP requests, AI calls, Sheets, email
- On Error → “Continue (using error output)”
- Error branch: log it, use a fallback, tell the user
ON ERROR OPTIONS
Stop Workflow default; error workflow fires Continue ignore and keep going Continue (using error output) send failed items down a separate branch you control
Step 3 · Validate input and AI output
Step three: never trust input. Right after every trigger, add an If node that checks the fields you need actually exist.
Check sizes too. A message longer than a few thousand characters probably isn't a real support question, and it can cost real money to process.
Then validate what the AI gives back. In episode one, we used a structured output parser so the AI returns clean fields. Use it for any AI step whose output feeds another node.
The parser has an auto-fixing option, which sends a badly formatted answer back to the model to correct it. Turn it on for important steps.
And add one last sanity check. If the AI should return hot, warm or cold, check that it did, before you route anything on that value.
The rule of thumb fits on one slide. Never trust what users send you, what other APIs return, or what the AI writes. Check it before you use it.
Quick reference
- Right after the trigger: If node checks required fields
- Check length: text.length < 4000
- AI output: structured output parser (Episode 1)
- Auto-fix: let the parser retry a bad format
- Last check: If category is not one of hot / warm / cold
RULE OF THUMB
Never trust: - what users send you - what other APIs return - what the AI writes Check it before you use it.
Step 4 · Sub-workflows you can reuse
Step four fixes giant, confusing workflows. When a group of nodes does one clear job, move it into its own workflow, and call it from everywhere you need it.
Create a new workflow that starts with the trigger called when executed by another workflow.
Define the inputs it expects, for example, text, and language. Now anyone calling it knows exactly what to send.
Inside, it does one job, like the AI summary from episode five, and the last node's output is returned to the caller.
From any other workflow, add an execute sub-workflow node, choose it from the list, and pass in the inputs. Your Telegram bot, your webhook API, and your daily digest can all share the same summary logic.
And here's the powerful part. In an AI agent, add the call n8n workflow tool, and point it at this sub-workflow. Now the agent can use your workflow as one of its tools. Any workflow you build can become a skill for your agents.
A word of balance. Don't split everything into tiny pieces. A sub-workflow is worth it when the same logic is used in two or more places, or when a section is big enough to deserve its own name and its own tests. If you split too much, you just move the confusion somewhere else.
Quick reference
- New workflow: “When Executed by Another Workflow”
- Define inputs: text, language
- Do one job: e.g. AI summarize → return result
- Call it with “Execute Sub-workflow” from anywhere
- Give it to an AI agent: “Call n8n Workflow Tool”
ONE SUB-WORKFLOW, MANY USERS
Summarize (sub-workflow) ↑ called by: Telegram bot ↑ called by: Webhook API ↑ called by: Daily digest ↑ called by: AI agent (as a tool) Fix the prompt once → all 4 improve
Step 5 · Logs, data and secrets
Step five: logs, data, and secrets.
For important workflows, like anything a client relies on, append a small log row for each run: the time, a short version of the input, the result, and whether it succeeded. When someone asks, did my lead come through on Tuesday, you can answer in ten seconds.
n8n's own execution history is great for debugging, but it grows. On a self-hosted server, configure how long executions are kept, so your database doesn't fill the disk. The n8n docs cover the pruning settings.
Be careful with personal data. Don't log what you don't need, and be ready to delete a person's data if they ask. Your clients may have legal obligations here, depending on where they operate.
Keep secrets in credentials only. Never in nodes, never in sticky notes, and never in a workflow file you share or export.
And back everything up. You already have volume backups from episode four. Exporting your workflows as JSON into a Git repository adds version history, so you can see exactly what changed, and roll back.
Quick reference
- Log important runs: Time, input, result, status → a sheet or database
- Execution history: Keep enough to debug, prune the rest
- Personal data: Don't log what you don't need. Delete on request
- Secrets: Credentials only. Never in nodes, notes or exports
- Backups + Git: Volume backups, and workflow JSON in version control
Step 6 · Handing over to a client
Step six: handing a workflow over. If you build automations for clients or an employer, this is where you earn trust.
First, a clean canvas. Every node has a clear name, sticky notes explain each section, and related nodes are grouped together.
Second, a one-page document. What the workflow does, what triggers it, which accounts it uses, where alerts go, and what to do when it fails. Here's a simple template you can copy from the notes.
Third, use the client's own accounts and API keys, not yours. When the project ends, they shouldn't depend on your personal Google account or your billing.
Fourth, error alerts should reach both you and the client, so nobody is surprised.
And fifth, agree on support in writing. Who fixes what, how quickly, and whether it's included or paid separately. A short, clear agreement prevents most arguments later.
Quick reference
- Clean canvas: named nodes, sticky notes, sections
- One-page doc: what it does, triggers, accounts used
- Client-owned accounts and API keys, not yours
- Error alerts go to you AND the client
- Agree on support: who fixes what, how fast
HANDOVER DOC · template
Name: Lead Assistant
Does: Classifies + logs leads
Trigger: Website form
Uses: Gemini, Sheets, Gmail
Alerts to: ops@client.com
If it fails: check Executions tab,
then contact support
Owner: Client · Built by: YouThe production checklist
Let's turn all of this into a checklist you can run through before any workflow goes live.
Alerts: the error workflow is set, and you've tested it.
Resilience: retries on every external call, and error branches where a failure needs a friendly response.
Validation: inputs are checked, and AI output is structured and checked.
Structure: repeated logic lives in sub-workflows, nodes are named, and sticky notes explain the canvas.
And records: logs for important runs, backups, workflow files in Git, and a handover document. Five lines. Print it, and use it every time.
Quick reference
- Alerts: Error workflow set, and tested
- Resilience: Retries on external calls, error branches where needed
- Validation: Inputs checked, AI output structured
- Structure: Sub-workflows, named nodes, sticky notes
- Records: Logs, backups, workflow JSON in Git, handover doc
Eight episodes: what you can build now
And that brings us to the end of the core of this series. Let's look at how far you've come.
In episodes one to three, you built AI workflows, agents with memory and tools, and a live Telegram bot.
In episode four, you deployed n8n on your own server, with Docker and HTTPS.
In episode five, you connected n8n to any API, and built your own.
In episodes six and seven, you gave an agent your documents with RAG, and built automations that run on a schedule.
And today, you learned the production habits that clients and employers actually pay for. Next in this playlist, we'll build complete client projects from start to finish. And if you also want to learn the cloud side, our Road to Cloud Engineer course starts on this channel too. The notes for this episode, with the checklist and the handover template, are linked in the description.
Quick reference
- Episodes 1–3: AI workflows, agents with memory + tools, Telegram bots
- Episode 4: Your own server with Docker and HTTPS
- Episode 5: Webhooks and APIs: connect anything
- Episodes 6–7: RAG on your documents, scheduled AI workflows
- Episode 8: Production habits clients pay for
Practice
- Create the error workflow and assign it to every active workflow you have.
- Turn the summarize step from Episode 5 into a sub-workflow, and call it from two places.
- Write a one-page handover document for your Telegram bot from Episode 3.
Next episode
That completes the core of the series. Next we'll build complete client projects, end to end.
Key takeaways
- One error workflow alerts you whenever any workflow fails
- Add retries on external calls, and validate both the input and the AI output
- Move repeated logic into sub-workflows and give every node a clear name
- Keep secrets in credentials only, log important runs, and hand over with a short document