within my workflow I had to add the Split Out node but after that I can’t access the Values from e.g. “PD- Get all Deals node” within the “PD - Update Product duration/frequency”
The “PD - Get all Deals” node has only one Item as output the Split Out can have more.
two questions:
how can I access all the Data from the nodes before “Split Out” node?
how can I aggregate all from “Split Out” node to “Aggregate” node so I have only one output after aggregate?
To reference something before the split out node, you can use that syntax:
`{{ $(‘nodename’).last().json.fieldname }}
To aggregate the data, you will need to normalize all 3 inputs so that they return the data with the same field names. Or you can use the aggregate node for each of the inputs
There is a couple of things going on here. You are splitting the items into batches(of 1) and also you have multiple paths coming together.
If you want to combine paths you need the merge node. As a node will execute for each input. And I see 2 incoming green lines on one of your screenshots. So the aggregate will not work as that only works within 1 execution of the node.
So you need to add the merge (append mode) to make sure all data is combined into one item set/list and then you can aggregate them into a single item if needed.
Most often it is good to use a subflow when you are doing more complicated flows within a loop. This might be a good idea here as well.
Hey thank you again for your help. The subworkflow sounds like a good solution and should do whats needed. But somehow I do not get any data in the subworkflow? I thought I put this module
and everything which happen so far in the previous nodes should be passed to this node?
OK I got it. In the node after “Execture Workflow Trigger” I have to use the data like $json…
But It seems this node does only get the data from the previous node and not from all the other nodes. I could I pass the data from the trigger node into the subworkflow?
you could merge in the data from the trigger node before the “execute wf” node.
Or you add the data using the code node.
(the sample code in the code node gets you half there)
edit: the easiest path should be to add an edit node
To make it more clear. I use dynamic credentials where the API token comes from the trigger node. so each HTTP node uses the same credentials but how can I specify this within the sub workflow? I could create another dynamic credential account to do this but Ideal would be to use the same ones.
So far I did use this expression but adding a third solution would be not ideal also don’t know if it would work
{{ $(‘JotForm Trigger’).item.json[“Hinterlegen Sie hier Ihr API-Token”] || $(‘JotForm Trigger’).last().json[“Hinterlegen Sie hier Ihr API-Token”] }}
This I still do not understand. I have this expression
{{ $(‘JotForm Trigger’).item.json[“Hinterlegen Sie hier Ihr API-Token”] || $(‘Execute Workflow Trigger’).item.json[‘Hinterlegen Sie hier Ihr API-Token’] }}
And get this Error in the sub-workflow “JotForm Trigger” node doesn’t exist [Error resolving credentials]
This somehow make sense because it does not exist in the subworkflow but I thought I would then use the second option or do I need some other expression for that?
{{ $exists(‘JotForm Trigger’) ? $(‘JotForm Trigger’).item.json[“Hinterlegen Sie hier Ihr API-Token”] : $(‘Execute Workflow Trigger’).item.json[‘Hinterlegen Sie hier Ihr API-Token’] }}
the Edit Fields node is intended to run before the execute Workflow node. Thereby appending the data (token) to each item before sending it to the child workflow.
The child workflow should only have the data, not a refference to the previous wf.