Adding Flow Variables

Variables allow for a customized flow configuration and environment parameterization, eliminating the need to create a separate integration flow for each environment.

If your flow has a REST trigger, it will not be possible to use environment variables in the URI.

Creating a variable

Variables can be created in both the Diagram and Source Code tabs.

In the Diagram tab:

flow variables diagram

  1. Click on the variables icon environment variables button in the left corner of the canvas.

  2. Select the environment: click the name of the environment in which the variable will be applied: Production or Staging.

  3. Register the variable in the form that will open.

  4. Save the variable, by clicking SAVE.

In the Source Code tab, in the Source > Flow Variables folder:

flow variables source code

  1. Select the environment in which the variable will be applied: Production or Staging.

  2. Register the variable in the form that will open.

  3. Save the variable, by clicking SAVE.

To register a variable, fill in the following fields:

  • Variable: variable name. Alphanumeric field. You can use the characters . and _.

  • Value: value assigned to the variable, which will be deployed automatically according to the environment you selected.

To apply the variables, provide the variable name enclosed in curly braces within the component, as shown in the example below:

  • Variable in the HTTPS component:

    uri: https://{{variable_name}}

In this case, follow the steps below:

  • Register the variable by clicking on the flow variables icon on the canvas.

  • In the HTTPS component form, in the Common tab, fill in the Http Uri field with the variable name enclosed in curly braces: {{variable_name}}.

Managing variables

  • To add more than one variable, click the + button in the right corner.

  • To delete a variable, click the trash icon.

  • To hide a variable, click the eye icon.

You cannot change the variables of a deployed flow with a Deployed status. To change them, you must deploy the flow again.

Blocked variables

The variables listed below are reserved for internal use and cannot be assigned:

AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_REGION
AWS_DEFAULT_REGION
RESOURCES_DIR
CAMEL_* (any variable that begins with CAMEL_)

Examples (Source Code tab)

The example below references the variable "name". During the execution of this integration, the variable will be replaced with the registered name.

- from:
    uri: rest:get:/hello
    steps:
    - log:
          message: Hello {{name}}

source env variables hello

In this other example, we reference a variable in a URL.

- to:
    id: to-generic
    uri: https://{{url1}}
    parameters:
      httpMethod: POST

source env variables url1

Thanks for your feedback!
EDIT

Share your suggestions with us!
Click here and then [+ Submit idea]