Back to Curriculum

Webhook Triggers: The Entry Point of Automation

Webhooks are the "nervous system" of the Automated Growth Empire. They allow external systems (like Shopify, Typeform, or a custom Python script) to trigger a workflow in n8n instantly. In this lesson, we learn how to architect a high-fidelity webhook receiver.

🏗️ The Webhook Lifecycle

  1. The Event: An action occurs in an external app (e.g., a new lead is submitted).
  2. The Payload: The external app sends a JSON POST request to your n8n URL.
  3. The Orchestration: n8n parses the JSON and triggers the subsequent nodes (Scoring, CRM Sync, Notification).

🛠️ Technical Snippet: Testing Webhooks with curl

Before connecting a real app, always test your webhook node manually:

curl -X POST https://automate.yourdomain.com/webhook-test/unique-id \
     -H "Content-Type: application/json" \
     -d '{"email": "lead@example.com", "name": "Test Lead", "source": "LinkedIn"}'

🔍 Nuance: Production vs. Test URLs

n8n provides two types of webhook URLs.

  • Test URL: Only active when you are looking at the workflow in the browser. Used for development.
  • Production URL: Always active. You must Activate the workflow for this URL to respond.

⚡ Practice Lab: The Lead Capture Loop

  1. Trigger: Add a Webhook node in n8n. Set the HTTP Method to POST.
  2. Action: Add a "Google Sheets" node. Connect it to a "Leads" sheet.
  3. Map: Use the "Expression" editor to map the email and name from the webhook to the sheet columns.
  4. Execute: Send a curl request and verify the lead appears in your sheet in real-time.

📝 Homework: The Multi-Source Receiver

Create a single webhook that handles leads from 3 different sources (LinkedIn, Meta, Website). Use an "If" node to route the lead to a different Slack channel based on the source field in the JSON payload.