Insomnia scripted environment variable writes under concurrent requests
0 reputation · 26 Dec 2023, 21:09 UTC
Goal: Use Insomnia pre-request scripts to read and update an environment variable with setEnvironmentVariable while multiple requests in the same environment run concurrently.
Constraint: Environment variables are bound to a specific environment and shared by every request that uses it. Insomnia does not document a lock, atomic write, or per-request isolation for script-driven updates, so concurrent executions may observe stale values or overwrite each other with last-write-wins behavior. Persistence and storage timing may also differ between Insomnia desktop builds and Insomnia Cloud or Teams.
- Does Insomnia provide execution isolation or write serialization for environment variables updated by scripts during concurrent request runs?
- Can a scripted variable write be limited to a single request execution without affecting other requests that share the same environment?
- Which Insomnia build determines whether environment changes are persisted immediately or only on application exit?