Bug or a feature? Looks like a bug with webhook test/production

Describe the problem/error/question

I have an execution, which is run when a webhook is received.
The issue is that when I send data to “test” URL - looks like all the nodes are working with data mapping like “{{ $(‘Edit Fields7’).item.json.body.objectId }}” , but when I use production link and send data to it (to note that it’s exactly the same data) - I have to map data like this : “{{ $(‘Edit Fields7’).item.json.body[0].objectId }}” - with a [0] at “body” or n8n will give me error during execution. And I actually don’t see the error in the node itself, that line (without [0]) is red, returning empty data.

What is the error message (if any)?

described above

Please share your workflow

they contain sensitive data

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
    1.29.1

  • Database (default: SQLite):

  • n8n EXECUTIONS_PROCESS setting (default: own, main):

  • Running n8n via (Docker, npm, n8n cloud, desktop app):
    docker, portainer

  • Operating system:
    ubuntu

Please let me know if any additional information is required.
Thanks!

Hey @olegbudeanu,

Can you share the JSON output from the webhook node from both runs? or if you have a CURL post example we can give that a test.

Hello Jon
Thanks for a fast reply!
Here’s the JSON from the Webhook with production test :


[
{
"headers": 
{
"connection": 
"Keep-Alive",
"host": 
"sensitive",
"x-forwarded-scheme": 
"http",
"x-forwarded-proto": 
"http",
"x-forwarded-for": 
"sensitive",
"x-real-ip": 
"sensitive",
"content-length": 
"300",
"accept-encoding": 
"gzip",
"cf-ray": 
"85c1355a9af78254-IAD",
"cf-visitor": 
"{"scheme":"https"}",
"x-hubspot-signature": 
"c2e060cd0b8e18f13ce7b6fbbb3c81e987eb4eab5d6fdc448b712035510c37b8",
"x-hubspot-signature-version": 
"v1",
"x-hubspot-request-timestamp": 
"1709045093507",
"x-hubspot-signature-v3": 
"sensitive",
"content-type": 
"application/json",
"user-agent": 
"HubSpot Connect 2.0 (http://dev.hubspot.com/) (namespace: webhooks-nio-http-client) - WebhooksExecutorDaemon-executor",
"x-hubspot-timeout-millis": 
"10000",
"x-trace": 
"",
"accept": 
"*/*",
"cf-connecting-ip": 
"sensitive",
"cdn-loop": 
"cloudflare",
"cf-ipcountry": 
"US"
},
"params": 
{
},
"query": 
{
},
"body": 
[
{
"eventId": 
317565746,
"subscriptionId": 
2498024,
"portalId": 
8398372,
"appId": 
1552798,
"occurredAt": 
1709045092618,
"subscriptionType": 
"deal.propertyChange",
"attemptNumber": 
0,
"objectId": 
17445064845,
"propertyName": 
"dealstage",
"propertyValue": 
"128819200",
"changeSource": 
"CRM_UI",
"sourceId": 
"userId:49839255"
}
]
}
]

Let me send the test data and paste in the JSON for it.
Thank you !

UPDATE :
Here’s the test output :

[

{

"headers": {

"connection": "Keep-Alive",

"host": "sensitive",

"x-forwarded-scheme": "http",

"x-forwarded-proto": "http",

"x-forwarded-for": "sensitive",

"x-real-ip": "sensitive",

"content-length": "348",

"accept-encoding": "gzip",

"cf-ray": "85c158289a7e8c8a-EWR",

"cf-visitor": "{"scheme":"https"}",

"accept": "application/json",

"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0 X-Middleton/1",

"content-type": "application/json",

"cf-connecting-ip": "sensitive",

"cdn-loop": "cloudflare",

"cf-ipcountry": "US"

},

"params": {

},

"query": {

},

"body": {

"eventId": 1624890169,

"subscriptionId": 2498024,

"portalId": 8398372,

"appId": 1552798,

"occurredAt": 1708955558429,

"subscriptionType": "deal.propertyChange",

"attemptNumber": 0,

"objectId": 17445064845,

"propertyName": "dealstage",

"propertyValue": "128819129",

"changeSource": "CRM_UI",

"sourceId": "userId:49839255"

}

}

]

Hey @olegbudeanu,

First thing I am seeing is the production endpoint seems to be using a hubspot trigger but the test doesn’t look to be the same. Are you sure the data is actually the same?

Edit: Just checked the Hubspot docs and they do send an array so the production data looks to be correct and the test isn’t.

The hubspot does not allow to modify test data (it uses it’s own pre-defined JSON, but I need to test another specific event), so I am using a post service https://reqbin.com/post-online with the production data sent by hubspot, which is this one

{
  "eventId": 1624890169,
  "subscriptionId": 2498024,
  "portalId": 8398372,
  "appId": 1552798,
  "occurredAt": 1708955558429,
  "subscriptionType": "deal.propertyChange",
  "attemptNumber": 0,
  "objectId": 17445064845,
  "propertyName": "dealstage",
  "propertyValue": "128819129",
  "changeSource": "CRM_UI",
  "sourceId": "userId:49839255"
}

So the data is the same, basically the sender is different.

d*******mn
Thanks so much for checking that out! Everything was working fine for months, it looks like they’ve changed how webhooks work without notification!
Thanks, Jon, now it makes sense.

1 Like