Update a variable in a loop

Hello everyone, I hope you are all doing good!
I have a scenario wherein I have a router with 2 branches for conditions and a last one that serves as a converger.
In the two condition branches, I need to keep track of the OpenAI’s API cost. As of now, I use an array aggregator to store every cost, but when the loop ends, I need to retrieve these arrays in the last branch (converger) to sum them. Does anyone know how this can be done ?
Here is a picture of what the scenario looks like:


Thanks in advance for your help.

To “update” a variable, you basically need to get the variable’s current value first.

To do this, you can try using the Tools “Get multiple variables” module —

Get values of a previously stored variables.

For more information about the Get multiple variables module and Tools app, see the corresponding Integrations page and the Help Centre documentation.

Hope this helps! Let me know if there are any further questions or issues.

@samliew