Batch environment variables changes


Hey guys,

I’m curious if there is any known way to batch multiple environment variables changes, via the API/node-sdk, to avoid multiple device restarts.

Thanks very much!

Single API call to update multiple Environment Variables

Hi, the API does do some batching, it doesn’t apply the changes right away, but after every update, it waits for a couple of seconds to see if there’s anything new coming in, and only after things stopped coming in it restarts the application. :clock:

I’ve tested it out by creating 10x new environment variables with 1s delay between them in the node SDK, and I only got a single application restart, a few seconds after the last environment variable creation call. So it’s definitely workable in this simple case.

How are you trying to update the env vars, can you tell us more about your situation and the issue you run into?


Thanks for your answer!
It sounds like a cool feature! In the app I’m working on, users can manage(add/update/remove) env vars for a device/application so I can’t be sure how much time will be between operations, because it’s at user’s will. This is what I’m facing :slight_smile: The simplest solution we could think of is to send all promises at once.


Yeah, it sounds like if it’s based on user actions, you might want to do some caching on your side. It’s really a trade off between being timely and being efficient. :runner:

:thinking: Or maybe it can be that on your side you have a different user experience for env vars: in the dashboard when one var is saved it is immediately applied. IN your case, I think it could be cool to have users adding env vars, but then explicitly “commit” or “save” those changes, and then you’d submit them as one series… Just a thought :slight_smile:


Thanks for suggestions :slight_smile: