WindmillWWindmill
Powered by
benB
Windmill•4w ago•
1 reply
ben

Single script with long running loop vs flow loop feature

Context:
- Single Python script with an internal loop that iterates over several dozen items
- Each item interacts with a pretty slow API endpoint (i.e., 1-2 seconds for each request)
- The process in question is not super time sensitive (doesn't matter if it takes 30 seconds or 3 minutes to run)

Option 1:
- Single script that internally iterates over the list. If there are 30 items, it could run for 30-60 seconds, which means it occupies a worker for the full 30-60 seconds

Option 2:
- Flow that interates over the list, running a new script execution for each item. This will, overall, take more time than a single script, but I assume it would allow other items waiting for available Workers to slip in between each iteration (rather than waiting for up to a minute -- in the case that other workers were occupied as well).

Do folks have opinions about which option they've selected in their own approaches?
WindmillJoin
3,362Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Running a script fails when executed in a flow
BravoBBravo / help
16mo ago
Long Running Scripts
Bagas WastuBBagas Wastu / help
3y ago
Use a table action to trigger a long running flow
amararamaAamararama / help
2y ago
Flow States are shared among for loop iterations running in parallel
ShenanigansSShenanigans / help
10mo ago
Recent Announcements
henri-c

Weekly kenote to tell you about our latest updates https://discord.com/channels/930051556043276338/1278977038430240813 https://youtube.com/live/2dGd9TdT8xs?feature=share

henri-c · 4d ago

Pyra

### HTTP tracing (EE) Capture HTTP requests made by job scripts as observability spans Features: - View HTTP request traces (method, URL, status, timing) in the job details UI - Auto-instrumentation for Native TypeScript, MITM proxy for other languages - Integrates with external OpenTelemetry collectors changelog: https://www.windmill.dev/changelog/http-tracing docs: https://www.windmill.dev/docs/advanced/instance_settings#http-tracing Additionally jobs memory metrics are now fully OSS!

Pyra · 2w ago

henri-c

First keynote of the year here https://discord.com/channels/930051556043276338/1278977038430240813 🙂

henri-c · 4w ago