I have a list of data and need to run a calculation on each item, then create a new thing with the calculated data. Currently, I’m encountering performance warnings and App too busy warning.
When a user clicks a button, I schedule an API workflow on a list (contains unique Agents, approximately 900 items). However, I filter out only those Agents meeting specific conditions, reducing the list to 150 items.
Then, it triggers another API workflow in the backend to again schedule an API workflow on a list (contains list of Payments, around 70,000 items). Once more, I filter this list with conditions, reducing it to approximately 7,000 items.
Finally, another API workflow is triggered to create new entities. I expect 7,000 items (already calculated) to be created in my database, but an error occurs, resulting in only around 1,800 items being created.
My question is, how do I improve the performance and prevent my App to run into any performance error.
If you set a one second interval and did one list item at a time, it would take about 5 hours to get through everything.
The good part of recursive workflows is that you know when they are done, as you can use the last step to do whatever post processing. E.g.: last step of recursive workflow 1 can kick off recursive workflow 2.
They can still be interrupted, but they are more reliable for large lists. I use them all the time. Slow AF but flexible and reliable AF too.
150 * 7000 = 1.05 million scheduled workflows. I’d be busy too. First, add intervals to the 150 (your agents). I’d give 5 seconds or so if it’s just a daily thing that’s not time sensitive.
Hello, I didn’t know that it scheduled millions of workflows, because I thought it runs 150 workflows (agents) and then processes a single list of 7000 items.
No, you said yourself that in the backend workflow
you run Schedule API workflow on a list of 7000 items. That means scheduling 7,000 API workflows (one for each item)
That’s crazy, I need to make changes in my workflow right now. Do you know what’s the best way to deal with this? Using intervals is not what I want because I need the result as fast as possible.
I did this last week and saw 5-10x speed improvements on Schedule API Workflow on a list, with the default (blank) interval set. Definitely can recommend for that improvement alone!