Global Constants icon

Global Constants

Global Constants

Overview

This node, named "Global Constants," is designed to inject predefined global constants into the workflow data. It retrieves these constants from a secured credential store and makes them available as part of the node's output JSON. This is useful when you want to centralize configuration values or fixed parameters (like API endpoints, feature flags, or environment-specific settings) and reuse them across multiple workflows or nodes without hardcoding them repeatedly.

Typical use cases include:

  • Injecting environment-specific constants for conditional logic.
  • Providing reusable configuration values to downstream nodes.
  • Simplifying maintenance by managing constants in one place.

Properties

Name Meaning
Put All Constants in One Key Whether to group all constants under a single key in the output JSON, or output each constant separately at the root level.
Constants Key Name The key name under which all constants will be stored if grouping is enabled (default: "constants").
Get Only One Section Whether to retrieve only one specific section of the constants instead of all sections.
Section Name The name of the section to retrieve if "Get Only One Section" is enabled. Supports expressions. Leave empty to get default behavior (all sections).

Output

The node outputs the constants merged into the input items' JSON data:

  • If there are no input items, it creates one item with the constants in its JSON.
  • If input items exist, it merges the constants into each item's JSON.

The structure of the output JSON depends on the "Put All Constants in One Key" setting:

  • If true: All constants (or the selected section) are nested under a single key specified by "Constants Key Name". For example:
    {
      "constants": {
        "API_URL": "https://api.example.com",
        "TIMEOUT": 5000
      }
    }
    
  • If false: Each constant is added as a separate key-value pair at the root level of the JSON. For example:
    {
      "API_URL": "https://api.example.com",
      "TIMEOUT": 5000
    }
    

No binary data output is produced by this node.

Dependencies

  • Requires an API key or authentication token credential that stores the global constants securely.
  • Uses a utility function to split the stored constants into sections.
  • No external API calls are made during execution; all data comes from the configured credentials.

Troubleshooting

  • Missing or invalid credentials: The node requires valid credentials containing the global constants. Ensure the credential is properly configured and accessible.
  • Empty constants output: If "Get Only One Section" is enabled but the specified section name does not exist in the stored constants, the output will be empty. Verify the section name spelling and existence.
  • Merging conflicts: When merging constants into existing JSON, keys may overwrite existing data. Use the "Put All Constants in One Key" option to avoid key collisions.
  • Expression errors: If using expressions in the "Section Name" property, ensure they evaluate correctly to valid section names.

Links and References

Discussion