n8n Workflows
What n8n actually is
n8n is a self-hosted (or cloud) workflow automation platform. Think Zapier, but open source, more powerful, and with the ability to run arbitrary code inside workflows.
The difference that matters: Zapier gives you pre-built integrations with fixed behavior. n8n gives you those same integrations plus the ability to write JavaScript or Python at any step, call any API, run conditionals of arbitrary complexity, and handle errors properly.
For MarTech and AI workflow use cases, n8n is increasingly the preferred tool for anyone who needs more than what Zapier can do.
Nodes: the building blocks
Everything in n8n is a node. Each node does one thing.
Trigger nodes: start the workflow. Webhook (HTTP request hits your endpoint), schedule (cron), email received, form submitted, database row inserted.
Action nodes: do something. Send email, create HubSpot contact, query database, call an API, write a file, post to Slack.
Logic nodes: control flow. IF (conditional branching), Switch (multiple conditions), Merge (combine data from parallel branches), Loop (iterate over items).
Code nodes: run arbitrary JavaScript or Python. This is what makes n8n powerful for complex transformations.
LLM nodes: n8n has built-in OpenAI, Anthropic, and other AI integration nodes. Connect to Claude or GPT-4 mid-workflow.
A real workflow: lead enrichment and routing
This workflow runs when a new lead submits a HubSpot form:
Trigger: HubSpot form submission (webhook)
↓
Node 1: Extract company domain from email
↓
Node 2: Clearbit Enrichment API → get company size, industry, revenue
↓
Node 3: IF (company size > 200 AND industry = 'SaaS')
├── YES → Node 4a: Set lifecycle stage = MQL, assign to enterprise sales rep
└── NO → Node 4b: Set lifecycle stage = Lead, enroll in nurture sequence
↓
Node 5: Send Slack notification to relevant sales channel
↓
Node 6: Log to Google Sheets (for reporting)
This workflow replaces manual lead routing, eliminates the enrichment-to-CRM delay, and ensures every lead is handled consistently within seconds of submission.
n8n + AI: building intelligent automation
n8n's AI nodes let you inject LLM intelligence into workflows.
Use case: automated lead qualification with AI:
1. Lead submits a form with a free-text "What are you working on?" field
2. n8n sends that text to GPT-4 with a classification prompt
3. GPT-4 returns: {"use_case": "analytics_migration", "company_size_signal": "enterprise", "priority": "high"}
4. n8n uses those values to route the lead, set custom properties, and personalize the first outreach email
Use case: personalized outreach generation:
1. Trigger: new lead added to HubSpot
2. n8n fetches company's website content (HTTP node)
3. n8n passes content + lead info to Claude
4. Claude generates a personalized first email draft
5. n8n saves draft to HubSpot note, notifies sales rep to review before sending
This is the workflow Sadullah built for QuikSales. The personalization comes from actual research on the prospect's business, not mail merge tokens.
Error handling (do this from the start)
n8n workflows fail silently if you don't build error handling in. An API returns an error. A required field is null. A webhook payload has unexpected structure.
Error triggers: add an Error Trigger node to every complex workflow. When any node fails, this triggers and can send a Slack alert, log the error, or attempt recovery.
Continue on Fail: for non-critical nodes (enrichment, optional notifications), enable "Continue on Fail" so a single API error doesn't kill the entire workflow.
Default values: in Code nodes, always handle the case where upstream data is null or missing. const email = $input.item.json?.email ?? 'unknown'
Test with bad data: deliberately send malformed input to your workflow in test mode. See where it breaks. Fix it before it breaks in production with a real lead.
I build these systems professionally.
Whether it's a RAG pipeline, analytics migration, or AI workflow — let's talk.