Calculation problem json data

Hello, I have a data overwriting problem in n8n. I explain myself I create mathematical operations via json data. Unfortunately some data are overwritten and the json return shows me 0 for several values.

Hey @simon_Piquemal, I am sorry to hear you’re having trouble.

Purely based on the screenshot and without a way to test this myself it’s impossible to say for sure what’s happening here. However, seeing you’re using the Merge node quite a lot in your workflow I suspect you might be running into some unwanted behaviour of this node.

This Merge node essentially pulls in data from previous branches, even if they wouldn’t otherwise run. Check out the below example workflow:

The IF node only returns an item on the true branch, but the false branch still executes because it’s executed by the subsequent Merge node:

Is this possibly what’s happening for you here? You can check past executions via the executions list:

To explain the workflow in detail. It is a generator of pdf according to the products entered in notion. A team member fills a form with the name of a customer, the different information and the url of the notion db. The json file is then sorted to end on carbon io (the pdf generator).

I think the problem is with your tools

I changed the script but it didn’t change anything

I solved the problem by changing the order of some notes but I think there is still a bug in the execution of some tasks in n8n.