Ensuring Accuracy when Merging Output of 2 Nodes

The code node splits up all the line items from the single subscription information, then adds the related subscription id and formatted date back into the table for each split line item.

After passing through the two If nodes, it branches off to a WooCommerce get product node, which returns more information about each product(line item) using the product id.

The issue here is that once the woo node gets the product information for each line item, that product information no longer has a connection to the subscription id or formatted date which was added to the relative line item in the previous code node.

I have figured out a way to merge the original code node output with the woo node output by their position, which seems to work in my testing, but I need to be sure that it will always merge accurately.

Quick Workflow Overview:

  1. Get all subscriptions (limited to 10 in image)

  2. Get info on each of the 10 subscriptions

  3. Get line items from within each single subscription, connect the relevant subscription id and formatted date here to each line item

  4. Get product information of each line item (connection to subscription id and formatted date does not exists here)

  5. Merge product information with related single subscription line items (including subscription id and formatted date)

Reason I need to merge:

I need the data to be connected because the last HTTP node requires the ‘subscription id’, ‘id’ (id is the position of the line item within users subscription) and the ‘formatted date’ to work properly to remove the correct line item from the correct users subscription. If any of these numbers mess up, the wrong user could have the wrong item removed.

Question

Does anyone know if the merge by position in the way I have it set up will be accurate and reliable for a very large-scale production workflow? Is there a better way to do this?

Sorry if this is a pretty noob question, this is my second day of using n8n.

Hey @mastema,

At first glance it looks ok but without seeing the data it is hard to say. Typically when I am making larger workflows I will do something similar to what you have then after a few runs of larger data sets I find little things I can tweak that improve the process.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.