ERROR: The data in "Body Parameters" is no valid JSON

I seem to get this whenever the input items contain double quotes. They are escaped prior to the http request. I’m surely doing something wrong, but I’m not sure what it is.

{
  "nodes": [
    {
      "parameters": {
        "url": "https://www.reddit.com/r/buildapcsales/comments/j1un2f/monitor_acer_nitro_xv240y_pbmiiprx_238_ips_full/.rss"
      },
      "name": "RSS Feed Read",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1,
      "position": [
        280,
        300
      ]
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "test1",
              "value": "={{$node[\"RSS Feed Read\"].json[\"title\"]}}"
            },
            {
              "name": "test2",
              "value": "={{$node[\"RSS Feed Read\"].json[\"content\"]}}"
            }
          ]
        },
        "options": {}
      },
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        480,
        300
      ]
    },
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "https://postman-echo.com/get",
        "jsonParameters": true,
        "options": {},
        "bodyParametersJson": "={ \n\"embed\": [\n{  \n  \"test1\": \"{{$node[\"Set\"].json[\"test1\"]}}\",  \n\"test2\": \"{{$node[\"Set\"].json[\"test2\"]}}\"\n}\n]\n}"
      },
      "name": "http Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        660,
        300
      ],
      "typeVersion": 1
    }
  ],
  "connections": {
    "RSS Feed Read": {
      "main": [
        [
          {
            "node": "Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set": {
      "main": [
        [
          {
            "node": "http Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

I checked your worfklow but could not find where the quotes are escaped.

Fixed it now by removing the outer quotes and stringifying the content. Here the new workflow that should now work fine:

{
  "nodes": [
    {
      "parameters": {
        "url": "https://www.reddit.com/r/buildapcsales/comments/j1un2f/monitor_acer_nitro_xv240y_pbmiiprx_238_ips_full/.rss"
      },
      "name": "RSS Feed Read",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1,
      "position": [
        578,
        209
      ]
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "test1",
              "value": "={{$node[\"RSS Feed Read\"].json[\"title\"]}}"
            },
            {
              "name": "test2",
              "value": "={{$node[\"RSS Feed Read\"].json[\"content\"]}}"
            }
          ]
        },
        "options": {}
      },
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        778,
        209
      ]
    },
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "https://postman-echo.com/get",
        "jsonParameters": true,
        "options": {},
        "bodyParametersJson": "={ \n\"embed\": [\n{  \n  \"test1\": {{JSON.stringify($node[\"Set\"].json[\"test1\"])}},  \n\"test2\": {{JSON.stringify($node[\"Set\"].json[\"test2\"])}}\n}\n]\n}"
      },
      "name": "http Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        958,
        209
      ],
      "typeVersion": 1
    }
  ],
  "connections": {
    "RSS Feed Read": {
      "main": [
        [
          {
            "node": "Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set": {
      "main": [
        [
          {
            "node": "http Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

I guess the “results” from the set node were slightly misleading to me since it looked like all the double quotes were already escaped. I guess that’s not the case.

Ah, now I understand what you mean. Yes, the n8n-nodes always escape before it gets added to the internal JSON-data but then gets again parsed when it gets read. Else it would be very confusing for people and if it would go through multiple nodes things would get escaped and then again escaped every time.

If you work with RAW data you have to take care of that yourself.

That makes sense. I guess I need to go make some changes. Thanks again!

Happy to help!

Have fun!