I am seeing this strange behaviour involving the data coming from the Webhook node.
This is the output of the Function (Config) node:
As visible, the webhook
and the config.params.record_id
properties are both showing different data, whereas they are both referring to the same incoming data!
I’ve tried this with a Set node instead of the Function (Config) node, but same result, which makes me wonder that the issue might be with the Webhook node.
Also tried:
- deleting and recreating the Webhook node
- deleting and recreating the docker containers
- refer to the incoming data as
$json
instead of $node["Webhook"].json
- workflow setting for Save Execution Progress set to both false & true
Same result!
Hey @shrey-42!
I executed the workflow that you shared, and I can’t reproduce the issue. I get the same values for the record_id
and the webhook
fields. I tested both the GET and POST method.
I am running the latest version of n8n - 0.130.0
Hey @harshil1712, indeed I’ve observed the same as well.
The above scenario is occurring in my DO cloud docker instance. And when i tried to reproduce this in my local docker setup, everything works fine.
It would be helpful to know how to debug this for my cloud instance.
Can you share the whole workflow? I saw that you have another node after the config node in the picture you shared above. I tested it and was not able to replicate it
@RicardoE105
Workflow code
So, after your message, i tried to add one node at a time and then execute again.
The problem seems to arise after the addition of the last Function node. Code:
const files = $json["body"]["field_338_raw"].map(i => i.id);
const config = $node["Config"].json;
config.params.object_key = "object_27";
const res = files.map(f => {
let c = {...config};
c.params.record_id = f;
return {json:c};
});
return res;
Somehow, this code is influencing the values of the earlier function nodes.
As visible here, the values of config.params
's properties (object_key, record_id
) are getting replaced:
It’s not supposed to happen like this, right?
So, i have now been able to implement a workaround, using this code for the last Function
node:
const files = $node["Get Email"].json["body"]["field_338_raw"].map(i => i.id);
const file_config = Object.assign({}, $node["Config"].json);
const res = files.map(f => {
const c = {...file_config};
c.params = {
object_key: "object_27",
record_id: f
};
return {json:c};
});
return res;
Although, i’m still not clear as to why c.params.object_key
and c.params.record_id
were acting like memory references for the config
object from the Config 1
node.