Workflow with multiple lookup requests and IF nodes to check if data exist or need to be created

So in your use case, the data mocked by Function-SplitGroups & Function-Groups node from your example would come from a different source than the items mocked by Function-Items & Function-SplitItems?

And you want to perform an action for all possible values in the item_cat field for which no match is returned by the Function-SplitGroups node in the item_group_name field? That’s a bit tricky seeing one is an array and one is a string field inside an array of Objects. So you won’t be able to use the Merge node’s Remove Key Matches mode out of the box.

Assuming all the above is true and I understood you right, I’d use a Merge node in Pass-through mode to make sure we keep our data from Function-Items & Function-SplitItems before your IF node, then use a Function Item node to add a group containing the relevant info from Function-SplitGroups. You can then also use the group field in your IF node to check whether a group exists or not (and if not, create one based on the item data).

Example Workflow

In this example, you’ll have a group field after the Function Item node (called “Assign Group” here):

You can see how this field is empty for the Fun Diving item because no Adventure group exists yet. This is checked in the IF node which checks whether the value of group.is_group is larger than 0. This test passes for the first three items but fails for Fun Diving which is sent to the false output of the IF node.

You can then make the API request creating the Adventure (or any other group, provided you are using a suitable expression) as needed (and afterwards proceed for all items on the same path again).

Hope this helps, let me know if you run into any trouble here :slight_smile: