Variables
Store readable configuration shared by Workflows in an Environment, and understand when changed values take effect.
Last updated
A Variable holds a non-secret configuration value for an Environment. Use it for values such as an
API's base URL, a destination identifier or a processing threshold. A Workflow reads it as
vars.NAME, for example vars.API_URL.
Use a Secret for an API key, password or token. Variable values are readable through configuration tools by callers with the required access, including Agents.
Names and values
The name belongs to the Workspace; the value belongs to an Environment. Use uppercase names with
underscores, such as API_URL.
| Name | Staging value | Production value |
|---|
API_URL | https://sandbox.example.com | https://api.example.com |
|---|---|---|
DESTINATION_ID | test-inbox | customer-inbox |
Every Workflow using vars.API_URL in staging reads the staging value. There is no separate
Workflow-level override. Setting a value in one Environment does not supply it in another.
A name has a fixed kind throughout the Workspace. If API_URL is a Variable, it cannot also be a
Secret in production. Choose the kind based on whether the value is sensitive.
When a change takes effect
Typenode captures the Environment's Variable values when it accepts a Run. That Run keeps those values, including when it resumes after waiting or makes another attempt.
Updating a Variable affects later Runs without republishing. It does not replace the value in a Run already accepted. Because the value is shared within the Environment, the change affects later Runs of every Workflow that references it.
For example, changing API_URL while a Run waits for input leaves that Run using its original URL
when it resumes. A new Run uses the changed URL.
Missing and empty values
A name existing in the Workspace does not mean it has a value in every Environment. Check the Environment you will run in.
In Workflow code, reading an unset Variable produces undefined; an empty string is a set value.
Typenode also checks configuration requirements before work starts, so a missing required value
can prevent a Run from starting. Supply required values explicitly rather than expecting another
Environment to provide them.