Tips > Reliability & Performance

Test Webhooks with curl or Postman Before Building the Workflow

Building an entire workflow and then discovering that the webhook payload format is wrong wastes significant time.

Building an entire workflow and then discovering that the webhook payload format is wrong wastes significant time. Test the webhook node in isolation first: create a Webhook trigger, activate it in test mode, send a request with curl, and examine the exact data n8n receives. This confirms the payload structure before you build any downstream logic.

Real-world example: You are building a workflow triggered by a GitHub webhook for pull request events. Before building the processing logic, verify what GitHub actually sends.


# Use the test webhook URL shown in the Webhook node

# (click "Listen for test event" first)

curl -X POST \
  'https://n8n.example.com/webhook-test/github-pr-handler' \
  -H 'Content-Type: application/json' \
  -H 'X-GitHub-Event: pull_request' \
  -d '{
    "action": "opened",
    "number": 42,
    "pull_request": {
      "title": "Fix login bug",
      "user": {
        "login": "developer123"
      },
      "base": {
        "ref": "main"
      },
      "head": {
        "ref": "fix/login-bug"
      },
      "html_url": "https://github.com/myorg/myrepo/pull/42"
    }
  }'
```text
```text title="Step 2: Examine the webhook output in n8n"
The Webhook node output panel now shows exactly how n8n
received and parsed your request:

- headers: all HTTP headers including X-GitHub-Event
- params: URL path parameters
- query: URL query string parameters
- body: the parsed JSON payload

Use this output to write accurate expressions like:
  {{ $json.body.pull_request.title }}
  {{ $json.headers['x-github-event'] }}
```text
> **Tip: Save the curl Command**
>
> Keep your test curl commands in a shell script alongside the workflow. This gives you a repeatable test you can run anytime, even months later when you need to modify the workflow.

Testing webhooks first eliminates guesswork about payload structure and header names, saving you from the cycle of "change expression, re-trigger webhook, check if it works."

**Related:** [Always Set an Error Workflow on Every Production Workflow](../error-handling-and-reliability/01-always-set-an-error-workflow-on-every-production-workflow.md) | [Break Large Workflows into Sub-Workflows](../workflow-architecture/01-break-large-workflows-into-sub-workflows.md)

Showcase builds

19 complete workflows from my own projects, each with its n8n workflow JSON to import. Showcase entries link the file at the end of the article.

See the showcase builds

Keep reading

191 entries grouped by topic, from first workflow to queue mode. Free, no signup.

Browse the encyclopedia

Need it built?

I design, build and run n8n systems for clients. Every engagement starts with a $1,500 diagnostic audit, credited toward the build.

Book a 20-minute call