workflow.jsondevelopmentN8nv1.0.0

n8n: Webhook Processor

Generic webhook processor with conditional routing, data transformation, and HTTP forwarding.

Setup time: ~8 min
Last updated: Mar 16, 2026
byRunbooks Communitycontributor

Template

workflow.json
{
  "name": "Webhook Processor",
  "nodes": [
    {
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [250, 300],
      "parameters": {
        "httpMethod": "POST",
        "path": "process",
        "responseMode": "lastNode"
      }
    },
    {
      "name": "Validate & Transform",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [450, 300],
      "parameters": {
        "jsCode": "const body = items[0].json.body || {}; if (!body.event_type) { throw new Error('Missing event_type'); } return [{ json: { event_type: body.event_type, payload: body.data || {}, received_at: new Date().toISOString(), processed: true } }];"
      }
    },
    {
      "name": "Route by Event",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [650, 300],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.event_type }}",
              "operation": "equal",
              "value2": "create"
            }
          ]
        }
      }
    },
    {
      "name": "Forward Create",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [850, 200],
      "parameters": {
        "method": "POST",
        "url": "https://your-api.example.com/events/create",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json.payload) }}"
      }
    },
    {
      "name": "Forward Other",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [850, 400],
      "parameters": {
        "method": "POST",
        "url": "https://your-api.example.com/events/other",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ event_type: $json.event_type, payload: $json.payload }) }}"
      }
    }
  ],
  "connections": {
    "Webhook": { "main": [[{ "node": "Validate & Transform" }]] },
    "Validate & Transform": { "main": [[{ "node": "Route by Event" }]] },
    "Route by Event": { "main": [[{ "node": "Forward Create" }], [{ "node": "Forward Other" }]] }
  },
  "active": false,
  "settings": {}
}

Setup

  1. 1

    Copy the workflow JSON above.

  2. 2

    In n8n, go to Workflows and click Import.

  3. 3

    Paste the JSON and update credential references.

  4. 4

    Activate the workflow.

Import into n8n

This is an n8n workflow. Import it directly into your n8n instance.

  1. 1

    Open your n8n instance (localhost:5678 or your cloud URL).

  2. 2

    Go to Workflows and click the + New button.

  3. 3

    Click the three-dot menu in the top right, then select "Import from JSON".

  4. 4

    Paste the workflow JSON from the template above.

  5. 5

    Update any placeholder values (channel names, webhook URLs, credentials).

  6. 6

    Activate the workflow with the toggle in the top right.

# Alternatively, import via n8n CLI:
n8n import:workflow --input=workflow.json

Version History

v1.0.0Initial releaseMar 16, 2026

Framework

N8n

Requirements

Webhook (n8n node)
HTTP Request (n8n node)
Code (n8n node)

File type

workflow.json

Version

v1.0.0

Updated Mar 16, 2026

Contributor

Runbooks Community

Community submission

You might also like