- My goal: set up a polling mechanism for my agent (which is invoked within a loop block), the setting was to set up a polling system for the invoking of the agent within the loop. Using some of polling set up proposed by Retool.
- Issue: the function block returns "null" upon running in the workflow page, when test run it internally, the function managed to yield result in a specific setting.
- Steps I've taken to troubleshoot: code format tweaking, refreshing
- Additional info: (Cloud or Self-hosted, Screenshots)
I've had workflows and functions do similar things for me too. That's usually been where I've not defined parameters correctly and asked it to loop through something that wasn't iterable.
In your case I'm a little confused as to what the first image is showing - if I'm reading it correctly, you create an array of your run data and then for every run it passes through the entire dataset to the polUntilComplete loop?
Should the runs parameter be using the runID and agentID in the function loop instead of the entire run history?
Hey, thanks for noticing this post. In the first image, the code block 'allAgentRuns' returns an array of agentRunIds and agentIds that are related to the agent invokes in this workflow. the 'pollUntilComplete' block is for using functions to check on the states of agent runs and return the results.
I think that's where my confusion is - if you have an array of items and you pass that to a loop block it'll run once for each item. And the parameter you're passing into the function for that loop is the array of all the items.
My understanding here would be that you'd run the function loop and each iteration of that loop would process one of the items from the data array, not every item.
ie it looks to me as if the getRunStatuses should replace pollUntilComplete ![]()
Did you get this working @Enming_Zhang ?
yes, we figured it out in the end, sorry for missing this, and thanks for the help ![]()
Thanks for the update, @Enming_Zhang! Can you clarify what you ended up doing in order to resolve this?

