What is a Webhook? A Simple Example Without Code (n8n Tutorial)

What is a Webhook? A Simple Example Without Code (n8n Tutorial)

🍕 Imagine this: You order a pizza online. The restaurant doesn't call you every minute to ask if you're still hungry. Instead, they take your order, make the pizza, and then — only when it's ready — they send a delivery driver to your door. That's exactly how a webhook works.

A webhook is an automated message sent from one app to another when a specific event happens. No constant checking, no wasted calls. Just “here's your data, right when you need it.”

In this guide, you'll build your first webhook workflow using n8n — no coding required. By the end, you'll have a live endpoint that captures data from any app (Google Forms, Shopify, Typeform, you name it) and sends it to Google Sheets, Slack, or Telegram.

What is a Webhook? (The Pizza Analogy)

APIs are like calling the restaurant every minute to ask “is my pizza ready?” – wasteful and slow. Webhooks flip the script: you give the restaurant your address, and they knock on your door when the pizza is done.

In technical terms, a webhook is an HTTP request (usually POST) sent from a source application to a destination URL when an event occurs. The destination URL is your n8n workflow endpoint. The event could be “new row in Google Sheets”, “form submission”, “payment received”, etc.

🧠
Remember: Webhooks are “push” – data comes to you. APIs are “pull” – you go fetch data.

Webhook vs API: The Difference

FeatureWebhookTraditional API
DirectionPush (app sends data to you)Pull (you request data from app)
Real‑timeYes, immediateDepends on polling interval
Setup complexityVery low (one endpoint)Higher (authentication, endpoints)
CostFree (if self‑hosted)Often paid beyond limits

3 Real‑World Webhook Use Cases

1
Google Forms → Slack
Every time someone fills your form, a webhook sends the response directly to a Slack channel. No manual copy‑paste.
2
Shopify → Google Sheets
When a customer places an order, a webhook automatically logs the order details into a spreadsheet for your team.
3
Typeform → Telegram
New survey answer? Webhook sends you a private message with the results instantly – perfect for lead alerts.

Build Your First Webhook in n8n (Step by Step)

We'll create a workflow that:

  • Listens for incoming webhook data
  • Parses the data
  • Sends a formatted message to Telegram (or Google Sheets)
Time: 15 minutes · No code · Free n8n account
1

Create a new workflow and add a Webhook node

In n8n, add a Webhook node. Set HTTP Method to POST and Path to /incoming-data. Copy the Production URL (it looks like https://your-n8n.com/webhook/incoming-data). This is your endpoint.

2

Add a “Set” node to format the data

Add a Set node. Map incoming fields (e.g., {{ $json.body.name }} to customer_name) to make them readable.

3

Send data to Telegram (or Google Sheets)

Add a Telegram node. Connect your bot, and compose a message like: New submission from {{ $json.customer_name }}. Alternatively, use a Google Sheets node to append rows.

4

Activate and test

Click Activate. Use any tool (Postman, webhook.site, or even a simple HTML form) to send a POST request to your webhook URL. Watch the execution log.

🎉
You've just built your first webhook! Any app that supports outgoing webhooks can now send data to this workflow.

Free Webhook Workflow JSON

Webhook → Telegram Logger
Webhook node + Set + Telegram
webhook-telegram-workflow.json
{
  "name": "Webhook to Telegram Logger",
  "nodes": [
    {
      "parameters": { "path": "incoming-data", "responseMode": "onReceived", "options": {} },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [250, 300]
    },
    {
      "parameters": {
        "values": {
          "string": [
            { "name": "customer_name", "value": "={{ $json.body.name }}" },
            { "name": "customer_email", "value": "={{ $json.body.email }}" }
          ]
        }
      },
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "typeVersion": 2,
      "position": [450, 300]
    },
    {
      "parameters": {
        "chatId": "YOUR_TELEGRAM_CHAT_ID",
        "text": "📬 *New Webhook Received*\n\n👤 Name: {{ $json.customer_name }}\n📧 Email: {{ $json.customer_email }}",
        "additionalFields": { "parse_mode": "Markdown" }
      },
      "name": "Telegram",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1,
      "position": [680, 300]
    }
  ],
  "connections": {
    "Webhook": { "main": [[{ "node": "Set", "type": "main", "index": 0 }]] },
    "Set": { "main": [[{ "node": "Telegram", "type": "main", "index": 0 }]] }
  },
  "active": false
}
⚠️
Replace YOUR_TELEGRAM_CHAT_ID with your actual chat ID. You can get it from the @userinfobot on Telegram.

Frequently Asked Questions

Is a webhook secure?
Yes, if you use HTTPS endpoints and add secret validation (n8n supports webhook secrets). Never expose sensitive data without authentication.
Can I test a webhook without a real app?
Absolutely. Use webhook.site or Postman to send fake POST requests to your n8n URL.
Do I need a static IP for webhooks?
No, n8n cloud or self‑hosted with a domain works. Use services like ngrok for local testing.
How is this different from the AI workflow in Article #1?
Article #1 used a Gmail trigger (polling). This webhook is event‑driven – data arrives instantly when an external app sends it. They complement each other perfectly.

What's Coming Next

TriggerWorkflow Team
We build every workflow in real environments. No fluff – just working JSON files.

Post a Comment

Previous Post Next Post