
3dl5q (3dl5q) asked a question.
Hi there,
I'm currently trying to pass a single string output to a "List - For Each" card which has a helper flow associated with it. I need the string value to be passed to the helper flow so I can assign it to a separate function within that Helper flow.
I can generate it string within the helper flow but this would cause that it regenerates at every run which would not be an efficient way to tackle this problem.

@3dl5q (3dl5q) -- This is typically how you would handle it in scenario's where the built-in authentication option(s) on the API Connector won't work for the endpoint you are utilizing and you need to manually generate your own bearer token.
The "If/Error" card in Workflows is a (Try / Catch) block. So you can "Try" to perform the API call then if the call fails with a 401 due to the bearer token expiration in the "Error/Catch" block you can call a flow similarly to what I demonstrated previously that generates a new bearer token, stores it, and can return it back to you. Then in the Error block you just perform the same API call again with the same inputs but now with the new token.
Keep in mind this only works if you keep your currency to (1) on List - For Each. Otherwise you could have multiple threads that get a 401 at the same time, they both try to generate a new token, update the table etc.. and they could end up writing an invalid token to the table. With concurrency of (1) it would always be in order.