AI Marketing Automation

How to Build AI Automations with n8n (Advanced Guide)

 ·  12 min read

An n8n workflow connects several automation steps on a dark canvas.
In this article

Mid-market teams build AI automations with n8n to run complex, multi-step workflows that would cost a fortune on per-task platforms. n8n is a fair-code workflow automation tool with a visual node editor. Its biggest advantage is how it bills: one full workflow run counts as a single execution, no matter how many steps it has. At NuroSparx, we build these systems for SMBs that have outgrown simple triggers and need real conditional logic, data enrichment and error handling that doesn’t fail silently. Below are three production workflows, how n8n really handles errors, and an honest 2026 cost comparison against Zapier and Make.

If you’ve used Zapier and watched a five-step workflow multiply your bill, n8n solves that. The same automations that get expensive elsewhere stay flat here, because extra steps don’t add cost.

Want results like this for your business?

NuroSparx builds AI-powered growth engines for SMBs doing $1M to $100M. Let’s talk.

Get a Free Growth Audit

What is n8n?

n8n is a workflow automation platform that connects apps and APIs through a visual, node-based editor. You can self-host the free Community Edition or use n8n Cloud. It charges per workflow execution instead of per task, so complex automations cost far less at scale. It supports custom JavaScript and Python, conditional branching and native error workflows, so it handles business logic that simpler tools can’t.

How n8n runs and bills a workflow

n8n rests on three ideas. Nodes are single actions (fetch from an API, transform data, send an email). Connections show how data flows between them. A workflow is the full automation from trigger to finish. A simple one might be: email arrives, check if spam, route or delete. An advanced one chains enrichment, scoring, branching, notifications, CRM updates, waits and retries.

By default, n8n runs nodes in sequence: each waits for the previous node, then passes its data forward. That’s reliable but can be slow for large datasets, so advanced users reach for batching and loops. Billing is the part that matters most. n8n counts one execution per full workflow run, whatever the node count, and since late 2025 it counts only successful executions, so failed and test runs don’t burn your quota. A two-step workflow and a fifty-step workflow each cost exactly one execution.

Build a lead qualification workflow in n8n, step by step

This workflow scores inbound leads on fit and sends the good ones to sales automatically.

  1. Add the trigger. Use a form trigger such as Typeform or a webhook to fire when a new submission arrives. Test it by submitting the form once.
  2. Create the lead in your CRM. Add a HubSpot node (or an HTTP Request node) to POST the contact to https://api.hubapi.com/crm/v3/objects/contacts, mapping name, email and company from the trigger data. n8n references upstream data with the {{ }} expression syntax.
  3. Enrich with company data. Add an HTTP Request node to a data provider. Clearbit is now part of HubSpot’s Breeze Intelligence, so current options include Breeze, Apollo or Hunter to pull industry, headcount and funding from the lead’s domain.
  4. Score the lead with a Code node. Add a Code node (the current node that replaced the legacy Function node) and write the logic in JavaScript:
javascript
   const lead = $input.all()[0].json;
   const company = $input.all()[1].json;
   let score = 0;
   if (company.employees > 100) score += 10;
   if (company.employees > 500) score += 10;
   const targetIndustries = ['SaaS', 'Technology', 'Finance'];
   if (targetIndustries.includes(company.industry)) score += 15;
   if (company.estimatedRevenue > 5000000) score += 25;
   return [{ json: { lead, company, score } }];

Adjust the weights to match your ideal customer profile. 5. Branch on quality. Add an IF node with the condition score > 50. The true path goes to your high-value track; the false path goes to nurture. 6. Alert sales on hot leads. On the true path, add a Slack node that posts to your sales channel: “New SQL: {{ name }} from {{ company.name }}, score {{ score }}.” 7. Write the score back to the CRM. Add a HubSpot node using PATCH to update the contact with the lead score and a qualified status.

Seconds after a form submission, your CRM holds an enriched, scored lead, and your sales team already knows about the best ones.

Workflow 2: email nurture with engagement alerts

This one sends a timed sequence and tells sales when a lead engages. Trigger on a new CRM contact at a chosen lifecycle stage. Then alternate Email nodes with Wait nodes (send email one, wait three days, send email two, and so on, with shorter gaps toward the end). After the final email, use a Code node to read the email events and flag whether the contact opened or clicked anything. Add an IF node. If the contact engaged, post a Slack alert to sales with the contact name and the open or click count. If not, send them to a longer nurture track or mark them cold. You get a hands-off sequence that shows interest the moment it appears.

Workflow 3: multi-channel data sync with real error handling

This workflow pushes every new deal into a tracking sheet and notifies the right teams, and it’s where error handling earns its keep. Trigger on a new HubSpot deal at a chosen stage. Use a Code node to format the deal into the fields you want (company, amount, owner, expected close, timestamp). Append a row to Google Sheets, then post a formatted alert to your sales Slack channel. The advanced part: if Google Sheets or the Slack API is down, you need to find out before the deal vanishes. The next section shows how n8n does that, and it works differently from what many guides claim.

How error handling works in n8n

n8n has no “Try/Catch node,” and functions like retryPreviousStep() or skipAndContinue() aren’t part of the platform. If a guide tells you to wrap steps in a Try node, it describes software that doesn’t exist. n8n uses three tools instead.

  • Per-node On Error setting. Every node has a Settings tab with an On Error option: Stop Workflow (the default), Continue, or Continue (using error output). Set a node to continue using error output, and you can branch to a recovery path when that step fails.
  • Retry On Fail. In the same Settings tab, turn on Retry On Fail, then set Max Tries (up to five) and Wait Between Tries. This handles short-lived problems like API rate limits without any code.
  • Error Workflow plus Error Trigger. Build a separate workflow that starts with an Error Trigger node, then assign it as the Error Workflow in your main workflow’s settings. Whenever the main workflow throws an unhandled error, the error workflow fires with the full error payload. From that one place, you can post to a Slack DevOps channel, log to a database and email an admin.

For decision-heavy logic, use IF nodes for simple branches and a Switch node when you have several cases (for example, routing a lead score into nurture, sales or a VIP track with a default fallback). Together, these give you retries, graceful skips, branching recovery and central alerts, all with built-in features.

Custom code, speed and scaling

The Code node runs JavaScript natively and Python through Pyodide, so you can transform data, hash values, derive fields or score records inline. Python in the Code node works well for shaping data, but its external package support is limited compared with a full Python environment. Check compatibility before you rely on a specific library.

As automations grow, three levers keep them fast and affordable. Batching processes records in groups instead of one at a time, which cuts API calls sharply on large datasets. Scheduling runs workflows on a sensible cadence (lead scoring hourly, syncs nightly) instead of firing constantly, which trims both load and cost. And because n8n has no built-in cache, you can store repeated lookups in workflow static data or an external store, so you call an enrichment API once per domain instead of once per lead. n8n does run branches, and a Merge node lets you recombine them. Still, the engine runs largely in sequence per execution, so use parallel branches to organize logic and don’t count on true concurrency.

What n8n, Zapier and Make cost in 2026

The three platforms bill on completely different units, and that unit decides your bill far more than the plan name.

Factor n8n Zapier Make
Billing unit Per workflow execution Per task (one action step) Per credit (one module run)
Step count effect None, any node count is 1 execution Every step adds a task Every module adds a credit
Free option Self-hosted Community, unlimited 100 tasks/month (eval only) 1,000 credits/month
Entry paid plan Cloud Starter about $20/mo, 2,500 executions Professional about $20/mo annual, 750 tasks Core about $9/mo, 10,000 credits
Mid tier Pro about $50/mo, 10,000 executions Team from about $69/mo, 2,000 tasks Pro about $16/mo, Teams about $29/mo
Self-host Yes, free software (~$3 to $7/mo server) No No
Best for Complex, high-volume, multi-step Simple workflows, widest app library Visual mid-volume automations

A five-step workflow that runs hundreds of times a month uses one execution per run on n8n, but five tasks per run on Zapier and five credits per run on Make. That gap is why teams running complex automations often report large savings after moving to n8n, especially when they self-host. n8n Cloud removed its permanent free tier in late 2025 and now offers a trial only, so the free path is the self-hosted Community Edition. All three vendors change pricing often, so confirm current numbers. To estimate what a workflow saves you, try our automation ROI calculator. For the content side of automation, see our guide on AI content workflows with Make.com and ChatGPT.

Mistakes that break n8n automations

Three errors cause most of the failures we get called in to fix.

  1. No error workflow. Without an Error Trigger workflow and per-node retry settings, one failed API call can stop an automation, and you won’t know until a deal goes missing. Set up central error alerts before you go live.
  2. Ignoring the execution model when costing. On n8n, cost depends on how often workflows run. Step count doesn’t change it. Polling a service every five minutes burns roughly 8,640 executions a month from one workflow, far past the Starter cap. Schedule sensibly and self-host high-volume jobs.
  3. Building without test runs. Run a workflow against a single test record before you turn it on for live data. n8n’s execution history shows each node’s input and output, so you can trace exactly where data goes missing.

Frequently asked questions

Is n8n harder than Zapier?

Slightly, for simple automations, because Zapier’s interface is friendlier for beginners. n8n pulls ahead once you need conditional logic, custom code or error handling. Most people get comfortable with n8n within a week or two, once they understand nodes and the expression syntax.

How does n8n pricing compare to Zapier and Make?

n8n bills per full workflow execution. Zapier bills per task and Make bills per credit, so each extra step adds cost on those two and none on n8n. The self-hosted Community Edition is free software with unlimited executions, and n8n Cloud starts around $20 per month for 2,500 executions. For complex, high-volume workflows, n8n often costs far less than the alternatives.

Do I need to know coding to use n8n?

No, but it helps. You can build most workflows with no-code nodes, and the Code node covers cases that need custom JavaScript or Python. HTTP Request, IF, Switch and app nodes take you a long way without any code.

How does error handling work in n8n?

Each node has On Error settings (stop, continue, or continue using error output) and a Retry On Fail option where you set the number of retries and the wait time. For unhandled errors, you build a separate workflow that starts with an Error Trigger node and assign it as your main workflow’s Error Workflow. That puts alerts to Slack, email or a log in one place.

Can I run n8n on my own server?

Yes. The self-hosted Community Edition is free software with unlimited executions; you only pay for the server, typically $3 to $7 per month on a small VPS. Skip underpowered hardware like a Raspberry Pi for production, and use a proper VPS or n8n Cloud for reliability.

How do I test a workflow before running it on real data?

Run it against a single test record first and review the execution history, which shows the exact input and output of every node. This catches mapping errors and bad transformations before they touch live data, and failed test runs don’t count against your execution quota.

Get help building n8n automations

Simple platforms get expensive the moment the logic gets real, and that cost is what holds most teams back. n8n removes that ceiling, and we use the same patterns from this guide for brands every week. To find which manual processes cost you the most hours, book a free growth audit and we’ll map where automation pays off fastest. Questions first? Reach the team through our contact page.

Free AI Automation Snapshot

Find the work worth automating first

Tell us how your team works today. We map the first workflows worth automating and reply within 24 hours.

Your data is safe. We never share details without permission.

Free growth audit

Find out what's costing you leads

We check your site, ads and tracking and send the fixes that matter most within 24 hours. Your first 15 days are free on a new plan.