HomeBlog › Building Automation Pipelines with n8n: A Step-by-Step Guide

Building Automation Pipelines with n8n: A Step-by-Step Guide

AgentPro Team · June 23, 2026

n8n is the leading open-source workflow automation platform, connecting over 400 services through a visual drag-and-drop interface. Unlike closed-source alternatives like Zapier or Make, n8n runs on your own infrastructure, giving you full control over your data and workflows. In this guide, I will walk through building three practical automation pipelines from scratch.

Before you start, ensure you have n8n running. The easiest method is Docker: docker run -it --rm --name n8n -p 5678:5678 -v ~/.n8n:/home/node/.n8n n8nio/n8n. Once running, open http://localhost:5678 to access the editor. For pre-built workflows spanning 188 integrations, check the Automation Empire collection.

Pipeline 1: Lead Capture to CRM Sync

This pipeline captures leads from a web form, enriches the data, and syncs to your CRM. Start with a Webhook trigger node configured to receive POST requests from your form. Add a Function node to clean and normalize the incoming data — trim whitespace, validate email format, and split full names into first and last. Connect an HTTP Request node to an enrichment API like Clearbit to pull company data from the email domain. Finally, add a HubSpot or Salesforce node to create or update the contact record.

Pro tip: Add an error workflow that sends you a Telegram message when the enrichment API fails. n8n's error handling is separate from the main workflow, so you can catch failures without stopping the pipeline. Validate your webhook payloads using the JSON Formatter before deploying.

Pipeline 2: Content Publishing Across Platforms

Automate your content distribution by connecting Google Docs to WordPress, Medium, LinkedIn, and Twitter. The workflow triggers when a Google Doc is tagged with a specific label (e.g., "Ready to Publish"). An HTML node extracts the content and converts it to the target format. A series of HTTP Request nodes post to each platform's API. Add a Schedule node to stagger publishing times — publish to WordPress immediately, Medium after 2 hours, LinkedIn the next day, and Twitter a week later.

For teams managing multiple content streams, set up a Slack notification node that posts a summary after each successful publish. Use the Markdown Previewer to check content formatting before scheduling.

Pipeline 3: Automated Invoice Generation and Delivery

Generate and send invoices automatically when a payment is received. Trigger the workflow with a webhook from your payment system (the self-hosted USDT payment gateway works perfectly here). A Function node calculates invoice numbers, applies tax rates, and formats line items. Connect a PDF creation node (like Puppeteer or the built-in PDF tool) to generate the invoice document. Finally, an Email node sends the PDF to the customer with a personalized message.

Add a Spreadsheet node to log every invoice in a Google Sheet for accounting purposes. Set up a monthly aggregation workflow that totals your revenue and sends a summary report.

Error Handling Best Practices

Every production workflow needs error handling. n8n provides "Error Workflow" settings — create a separate workflow that receives error data and sends alerts. Include the workflow name, error message, and input data snapshot in your alert. Store retry logic in a Loop node for transient failures. Set reasonable timeout values (30 seconds for API calls, 5 minutes for data processing).

Monitor workflow execution history regularly. n8n stores execution data for 24 hours by default. Increase retention in Settings if you need longer debugging windows. Use the Timestamp Converter to analyze execution logs across different time zones.