Raw data from webhooks

HI all, I’m making a switch from Integromat and Zapier to n8n. Loving it so far, but have hit a snag with a webhook data parse. It’s no problem in Zapier and Integromat, but just can’t seem to nail it in n8n.


I’m trying to parse the data in the rawRequest, any ideas?
Thanks in advance

1 Like

Hey @mb55

Welcome to the n8n community!

By default, the n8n webhook node will receive data in JSON format. Check RAW BODY available under Options in Webhook node.

If this isn’t correct, Please share your use case and someone from the community will assist you. :slight_smile:

1 Like

Thanks @mcnaveen Raw Body is checked in the webhook but i can’t access the rawRequest information “rawRequest”: “{“slug”:“submit/213318132355044/”,“q7_baserowId”:”",“q3_firstName3”:“wwww”,“q4_lastName”:“wwwww”,“q6_notes”:“wwwww”,“event_id”:“1638243939805_213318132355044_zUUWwTb”}"
as line items for some reason. In Integromat there is a ‘parse JSON’ module, is there something similar in n8n?

Hey @mb55,

Welcome to the community :tada:

You can use the JSON.parse() method in the Set node to convert the raw data into JSON.

The screenshot below shows the response I receive in the Webhook node

In the Set node, I added a new string with the same name as the rawRequest field to overwrite the original value. In value field I am using the expression - {{JSON.parse($json["body"]["rawRequest"])}} which convert the string to JSON.

Here’s the screenshot of the Set node:

I am attaching the Set node that I am using in the example workflow, you can copy and paste the code in your workflow canvas to try it out.

{
  "nodes": [
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "body.rawRequest",
              "value": "={{JSON.parse($json[\"body\"][\"rawRequest\"])}}"
            }
          ]
        },
        "options": {}
      },
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        650,
        300
      ]
    }
  ],
  "connections": {}
}
2 Likes

@harshil1712 Thanks so much!! This worked like a dream. I feel like there should be an easier option to add this ability, but will be saving this for sure. Have a great day

1 Like

Happy to know that the above solution worked for you! I would really appreciate it if you can create a Feature Request for the same. This way other community members can also share their use cases, and we can develop the node making sure that all use cases are covered :slight_smile:

Sure @harshil1712 how do i request a feature?

It’s similar to creating this very post! When you create a new topic, make sure you select the Feature Request Nodes category.