Changing the order of the Routes

As soon as a value gets passed through to the array aggregator, I want it to run before moving onto the next iteration. Right now, it is going through all of the rows and then moving onto the array aggregator. How do I accomplish this:

Hmm… An aggregator takes multiple inputs and converts them to a single output. You’re saying that you want all outputs to run one at a time. Why do you want the aggregator? If you remove it and just leave the google sheet, every iteration will call Google Sheets. If yo don’t want every iteration to call Google Sheets, maybe a filter will help?

Otherwise, you would need to explain what you’re trying to do. Then maybe someone can give you a better way to do it.

L

So currently, I have multiple tabs in google sheets that each represent a state. In each tab, there is a list of business names in a column. I’m having apify first find the information of that business, and then scraping their website for any pages that sound like a directory. Then, I want AI to look at the html of each site and determine who the decision maker is and get their contact information. Every website is different, so one iteration may not get all the information I need. In this case, I’m trying to make sure three values are obtained before switching to the aggregator. The aggregator is getting values from the google sheets module (for row number, sheet id, and sheet name), the 2nd apify module (that contains the website url and city the business is in), and the get multiple variables module (name, email, phone, title, etc)

When I look at your screenshot, it shows that the aggregator only takes the information that’s in the tools module between the iterator and the aggregator. What I am seeing is that the HTTP call can only be done once per iteration. If the 5 values you set at the end of the HTTP branch are the variables that you’re looking for, and they are not always completed on the first run, you might have to repeat your HTTP call multiple times until all the values that are essential are filled, and then you can continue your flow.But then in your flow after the router, there probably needs to be a GET variable between the router and the aggregator so you can get the values that are set in your set variable modules on the HTTP branch.

If the AI is doing all the work, maybe you can adjust your prompt to tell it to keep searching until it has all the information it needs. In the tools you have in your AI agent, I’m assuming you have a tool that knows how to get the information and determine if it is complete or not. By adjusting your prompt, can you get the agent to keep trying to get all the information it needs and to stop after a certain number of attempts?

L