recursive loop in windmill.dev
I need to create a loop that start and run against a list that depends on the output of each loop.
I can't find a way to do it? ๐ ๐ฅ ๐
11 Replies
Hi, I'm not sure to understand but you can nest loop
I run a python script (script A) that get all urls from a webpage.
the result of this script is a list of urls that need to run script A again until a certain limit or depth is triggered
it is a dynamic loop where each time you run the loop you update the iteration list
hope it makes sense
You just need a while loop and a for loop and to store the array of items in flow user state and return the number of items left in each while loop end
while len(items_left) > 0:
for item in item_left:
update list of item left
return updated_item_left as flow user state
thanks I think I got it, I ll try that
Thanks for your time
Hi @rubenf , Not sure how I can retrieve the list of item from
urls = wmill.get_flow_user_state("urls") and to iterate in the loop iterator?
urls = wmill.get_flow_user_state("urls") and to iterate in the loop iterator?
flow_input as super easy to use but what i can't use flow user state?
i guess i need to create python code previously that return urls = wmill.get_flow_user_state("urls")
I was hoping that we could call the flow_user_state directly in the iterator like with flow_input
please let me know if i can help to do it since windmill is open-source
not sure how linear interact with github, since I did not see the issue
it's internal so you can't see it
if you want to contribute on it, you would have to modify this: https://github.com/windmill-labs/windmill/blob/main/backend/windmill-worker/src/js_eval.rs and use deno_core ops functions
GitHub
windmill/backend/windmill-worker/src/js_eval.rs at main ยท windmill-...
Open-source developer platform to power your entire infra and turn scripts into webhooks, workflows and UIs. Fastest workflow engine (13x vs Airflow). Open-source alternative to Retool and Temporal...