Best practices for managing environment variables in Zeebe Modeler

I’ve read through the Best Practices documentation but can’t find anything regarding using environment variables for the Zeebe process bpmn.

To give some context of my problem, I am running a Zeebe cluster in Kubernetes, where I use a generic http worker similar to this example. If I want to configure the Zeebe process to call a nonproduction URL in my staging cluster, and a different production URL in my production cluster, what is the best way to manage these variables? This problem also extends to things like authorization credentials.

I can think of a few options:

  • environment variables set on the http worker application
  • environment variables set on the Zeebe brokers, referred to in the process definition
  • use some XML templating language like xslt to dynamically update the process definition before deploying to different environments.

Any help would be greatly appreciated.

Hey @Andy_JB!
So my preference would be the first one:

  • environment variables set on the http worker application

I am always a big fan of separating things. Due to this I like to have as less technical properties in my business process-definition as even possible. In my opinion the process definition should not need to care about which environment is used. So if there is a possibility to let the worker application decide in which “mode” it is operating is best in my humble opinion.

But honestly, there might be completely different opinions. :smiley:
Let me know what you think about this reasoning!
Best,
Thomas

Thanks @Hafflgav for the reply!

I agree, and have decided to go with a similar approach to the http worker example. However, rather than setting url in the process definition and passing it to the worker, I set host and path in the process definition variables. These are set as environment variable names eg $MY_HOST, $MY_PATH. The worker resolves the environment variables with these names and constructs the url at runtime.

eg

Regards,
Andy

1 Like

Great idea! :slight_smile:
Thanks for sharing @Andy_JB!