WindmillWWindmill
Powered by
benB
Windmill•11h ago•
1 reply
ben

When using dedicated workers, are

When using dedicated workers, are preprocessors included?

I have a stand alone python script that has a preprocessor (http route has to take a url parameter and parse it to pass the value correctly to main), and when running the script on the default workers executions from the http route function as expected. But, when I add the script to a dedicated worker the preprocessor doesn't seem to run. When adding print/debug statements inside the script it reveals that no values are being passed to main (in the runs page I can see that the http request is being record by Windmill, even if it's not being parsed by the preprocessor when the script runs). When running the script directly in the UI it's clear the script itself is not cold starting -- because it's a python script making external db connections and only takes 60-70ms to complete.

I decided to try to move the logic to a flow -- moving the preprocessor logic to the preprocessor step before the inputs section -- and while it worked through the http route, it looks like the preprocessor isn't preloaded and is cold starting each time. The script portion of the flow (after the inputs section) mostly runs in 100ms or less, but the total flow execution time is over 800ms. And the script portion is doing way more work than the preprocessor (external database connections, etc).

If there is some workaround where the actual http request json can be sent to the main function, that would also work.

As an aside: If this was a "new" endpoint I would just move the url parameter to the body, but I'm attempting to migrate an existing endpoint from another application that's used by other internal services I don't have any control over. So, the url parameter needs to stay where it is (I'm also doing migrated legacy authentication in the preprocessor, but I figure that detail desn't matter so much as just that the preprocessor -- or similar functionality -- is needed in general).

EDIT: I'm using v1.647.0
WindmillJoin
3,388Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?
Recent Announcements
henri-c

We're live here https://discord.com/channels/930051556043276338/1278977038430240813

henri-c · 22h ago

rubenf

Infrastructure as code

rubenf · 3w ago

rubenf

As we're preparing for a new Windmill sandbox SDK, we took the opportunity **to open-source NSJAIL sandboxing** and make it available in CE and easier to set. In 1.634.0, just set nsjail to benefit from the tightest security and isolation per job. It's constraining so no need to use it unless you need but now you won't be restricted in security for CE if you need to.

rubenf · 4w ago

Similar Threads

what are native workers
rubenfRrubenf / general
3y ago
Hi ! We are actually using HTTP
centdix974Ccentdix974 / general
6mo ago
Agent workers
rubenfRrubenf / general
2y ago