Skip to content

Environment Variable

This component allows you to access external configuration settings stored in your Nappai environment. Instead of hardcoding values directly into your workflow, you can use this component to dynamically pull data (such as API keys, file paths, or custom labels) from your system’s environment. This ensures that your workflow remains flexible and easy to update without needing to modify the code itself.

How it Works

This component acts as a bridge between your workflow and the settings saved in your Nappai environment. When you add this component to your dashboard, it automatically checks your current workflow’s environment to see which variables are available.

You simply select the specific variable you need from a dropdown list. The component then looks up that variable in the background, retrieves its current value, and makes that value available for you to use in subsequent steps of your automation. Because it connects to the live environment, any changes you make to your environment settings will be reflected here immediately.

Connection & Credentials

This component does not require any external API credentials or complex configuration. It relies on the environment settings that are already associated with your specific workflow or flow in Nappai.

Inputs

The following fields are available to configure this component.

  • Variable Key: Select the name of the environment variable you wish to retrieve. This dropdown is populated automatically with all the variables currently defined in your workflow’s environment.
    • Visible in: N/A

Outputs

Output Data Example

The component produces a single output containing the text value of the selected variable. json { “variable_value”: { “text”: “your_actual_variable_value_here” } }

Connectivity

This component is typically used as a starting point for data retrieval. You will likely connect its Value output to other components that require external data, such as:

  • API Call Components: To pass environment variables like API keys or endpoints.
  • Text Processing Components: To use configuration values in generating messages or reports.
  • File I/O Components: To provide file paths or directory names stored in the environment.

Usage Example

Imagine you are building an automation that sends emails. You have stored your SMTP server address in your Nappai environment under the variable name SMTP_SERVER.

  1. Add the Environment Variable component to your workflow.
  2. In the Variable Key field, select SMTP_SERVER from the dropdown list.
  3. Connect the Value output from this component to the Server input field of your Email Sending component.

Now, whenever your workflow runs, it will automatically fetch the correct server address from your environment settings.

Tips and Best Practices

  • Use Descriptive Names: When defining variables in your environment, use clear names (e.g., DB_PASSWORD instead of v1) to make it easier to identify them in the dropdown list.
  • Dynamic Updates: Remember that this component reads values live. If you update a variable in your Nappai environment settings, the workflow will use the new value on its next run.
  • Error Handling: If a variable key is not found, the component will return an empty value. Ensure that you have spelled the variable key correctly in the dropdown selection.

Security Considerations

  • Sensitive Data: Avoid storing highly sensitive information (like master passwords) directly in environment variables if possible. If you must store secrets, ensure your Nappai environment is secured and that you are the only user with access to view these variables.
  • Exposure: Be cautious when logging or displaying the output of this component, as it may contain sensitive configuration data.