Bjarne
Bjarne5w ago

How to differentiate between preview and production runs?

As the title says: how do I know inside of my script if it is running in preview or production mode? I noticed that I might be able to use env variables for this (in the settings - runtime menu), and this works if you are just running the script standalone. But, when I wish to run a flow in preview mode, the scripts inside of the flow do not seem to realize they are running in preview mode, and the production environment variables are still used.
4 Replies
rubenf
rubenf5w ago
@Bjarne highly recommend using different workspaces
rubenf
rubenf5w ago
Deploy to prod using a git workflow | Windmill
Windmill integration with Git repositories makes it possible to adopt a robust development process for your Windmill scripts, flows and apps.
rubenf
rubenf5w ago
if you do, then you have the same workflows on prod and staging but they refer to different variables/resources which are not synced, or not all of them allowing them to be workspace specific
Bjarne
BjarneOP5w ago
Ah ok, thx @rubenf will have a look. Seems like a clean solution indeed

Did you find this page helpful?