Hi everyone,
the title states the question, but for some background:
I created a nested loop to enable the app to find user generated items in our database and check criteria. IT’s only a test database with around 15 rows in each table and checking for 2-3 criteria in the second loop.
So it goes:
- find item of datatype A in datatype B
- for that item, check requirement 1 and requirement 2, if met change a field in datatype A to “yes” or 1. (haven’t even included a else “no” yet)
- repeat for each item in datatype A.
Shortly after, I received an error basically saying I’ve reached my apps limit and my log said I was running 1300 (!) workflows within around 30 mins.
So the question is: does each iteration in a loop count as a workflow?
Would you advise to use an external backend like Xano if such operations are needed?
Or am I overcomplicating achieving this task with a nested loop?
Many thanks in advance!
Yes, each time a workflow runs, that counts as one workflow run. If you run a workflow 1300 times, then that’s 1300 workflows.
What you’re doing sounds simple enough, and shouldn’t be using up all your capacity (if that’s what you’re saying) unless you’ve set something up wrong.
I’m also not entirely sure where the ‘nested’ aspect comes into it (or why you need it), but that’s probably because I don’t know what you’re doing or how you’re doing it.
Maybe some more specific info about what you’re actually doing, and how you’re doing it (including screenshots of your database structure and workflows) might help to see if there’s anything you could do more efficiently.
Many thanks, @adamhholmes!
Just to clarify: so if I run a nested recursive workflow that loops through (in this test case) 15 rows for each item in another list of 15 rows → is that one workflow or 15*15=225 workflows (or more if I need to check multiple conditions? Otherwise, I don’t understand why my log tells me about 1300 workflows. I only ran it a handful of times to test whether and how its working.
I thought I needed a nested recursive flow because I want to check multiple conditions for each item in one data type for each item in another data type. Maybe I’m making it more complicated than it needs to be?
I’m attaching a screenshot with the current backend workflow (for some reason it jumps over the first two entries as it is now, but I wanted to resolve the capacity issue first).
The backend workflow
The input to the backend workflow when button is clicked
And the two data types modified with that workflow (they have some auxilliary fields now just to check how and whether the workflow works).
I hope that makes it more clear - if any other info would be useful to understand the issue, please let me know.
Thanks very much!