Support Multiple HTTP methods in a single Webhook node at the same time

The idea is:

Currently in the Webhook node, you can only select one method: GET, POST, or HEAD.
But, some services, like Twitter, require for every webhook URL, support for both GET requests and POST requests.

Currently, in terms of services that require multiple HTTP methods, I’m only aware of Twitter at the moment. But I think it’s likely that this requirement is also true for other services.

So feature request is: support for multiple HTTP methods in a single Webhook node.

My use case:

See above: I would like to handle Twitter API webhooks with n8n

Any resources to support this?

Hey @werchter,

What you could do is add 2 webhook triggers to the same workflow, You can configured them both to have the same URI which should do the job for you.

[[email protected] ~]$ curl -X POST http://localhost:5678/webhook/for-twitter
POST Finished
[[email protected] ~]$ curl -X GET http://localhost:5678/webhook/for-twitter
Get Finished

image

Quick workflow below if you need it.

Example Workflow
{
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "for-twitter",
        "options": {
          "responseData": "POST Finished"
        }
      },
      "name": "Webhook - POST",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        -300,
        30
      ],
      "webhookId": "320eabab-e4e1-484d-86d8-2c1719af86ae"
    },
    {
      "parameters": {
        "path": "for-twitter",
        "options": {
          "responseData": "Get Finished"
        }
      },
      "name": "Webhook - GET",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        -300,
        170
      ],
      "webhookId": "bcef5743-d503-4e9a-9276-19ff0614de1d"
    },
    {
      "parameters": {},
      "name": "GET",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        -100,
        170
      ]
    },
    {
      "parameters": {},
      "name": "POST",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        -100,
        30
      ]
    }
  ],
  "connections": {
    "Webhook - POST": {
      "main": [
        [
          {
            "node": "POST",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook - GET": {
      "main": [
        [
          {
            "node": "GET",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Ah, thanks!
Did not know it is possible to add two webhooks nodes with same url!
Will try it out.

2 Likes

I didn’t know either, I gave it a quick go when I spotted your post so we have both discovered something new today :grinning_face_with_smiling_eyes:

1 Like

Ben gave an interesting talk around this. You can check-it out here: Super powers of the Webhook node - Ben Hesseldieck - YouTube

1 Like