How can I change webhook response?

Hi my dear friends;

In my case:
I forced from third party website to have callback page for post data to it to show them to my users. (Some payment data)
In other hand I force for getting that data in my workflow, give them my “webhook address” in my installed n8n.

My Question is that:
Are there any way to customize webhook message page?
For example can I use html code to design it or can I redirect my users to another page with this address: “http://mysite.com/callback

The message of webhook now is:
{"message":"Workflow got started."}

Best regards;

It is possible to return HTML and redirect to another page with meta-refresh like this:

{
  "nodes": [
    {
      "parameters": {
        "path": "test",
        "responseMode": "lastNode",
        "responseData": "firstEntryBinary",
        "options": {}
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        550,
        450
      ]
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "html",
              "value": "<html>\n  <head>\n    <title>Redirect</title>\n    <meta http-equiv=\"refresh\" content=\"0; URL=http://example.com\">\n  </head>\n  <h1>Redirect</h1>\n</html>"
            }
          ]
        }
      },
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        750,
        450
      ]
    },
    {
      "parameters": {
        "mode": "jsonToBinary",
        "convertAllData": false,
        "sourceKey": "html",
        "options": {
          "mimeType": "text/html",
          "useRawData": true
        }
      },
      "name": "Move Binary Data",
      "type": "n8n-nodes-base.moveBinaryData",
      "typeVersion": 1,
      "position": [
        950,
        450
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set": {
      "main": [
        [
          {
            "node": "Move Binary Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
1 Like

@jan re this feature request, the meta redirect workflow here should be fine for my needs in the interim.

However, I’m struggling to get the same flow as you have above, with an additional MailGun node added in. In which position should I place it / what should be the last node in order to return the HTML data?

You can place it anywhere before the “Set” node. As the Webhook-Node is set to return the data of the last node and the last two nodes together (Set & Move Binary Data) make in this example sure that it is HTML. So to keep that behavior it is important that they stay at the end.
If you have any other node, in the end, the workflow returns the output of that node and so probably not anymore what you want.