Overview
This node allows users to access global variables defined in a JSON configuration stored in credentials. It reads these variables and outputs them either grouped under a single key or as separate keys directly on the output JSON. This is useful when you want to inject global configuration or environment variables into your workflow data for use in subsequent nodes.
Practical examples include:
- Injecting API keys, URLs, or other configuration parameters globally accessible throughout a workflow.
- Centralizing environment-specific settings that can be reused without hardcoding values in multiple places.
- Dynamically modifying workflow behavior based on global flags or parameters.
Properties
| Name | Meaning |
|---|---|
| Put All Variables in One Key | Whether to group all global variables under a single key in the output JSON (true), or to spread them as individual keys at the root level (false). |
| Variables Key Name | The name of the key under which all variables will be grouped if "Put All Variables in One Key" is enabled. Default is "vars". |
Output
The node outputs an array of items where each item's json property contains the global variables:
- If "Put All Variables in One Key" is enabled, all variables are nested inside a single key (default
"vars"). For example:{ "vars": { "apiKey": "123", "environment": "production" } } - If disabled, each variable is added as a separate key directly on the root of the
jsonobject:{ "apiKey": "123", "environment": "production" }
If the node receives input items, it merges the variables into each item's existing JSON data; if no input is provided, it creates one item with the variables.
Dependencies
- Requires an API key credential containing a JSON string of variables under a field named
variables. - The JSON must represent an object (not an array or other types).
- No external services are called; all data comes from the configured credential.
Troubleshooting
- Invalid JSON in variables field: If the JSON string in the credential is malformed, the node throws an error indicating invalid JSON. To fix, ensure the JSON is valid and properly formatted.
- Variables must be defined as a JSON object: If the parsed JSON is not an object (e.g., it's an array or null), the node will throw this error. Make sure the JSON represents an object with key-value pairs.
- Empty input handling: If the node receives no input items, it still outputs one item containing the variables.