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
@Bjarne highly recommend using different workspaces
In addition doing this: https://www.windmill.dev/docs/advanced/deploy_gh_gl
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.
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
Ah ok, thx @rubenf will have a look. Seems like a clean solution indeed