Skip to main content

Reference Variables

Reference variables are crucial for data transfer and state management within Stacks, templates, and stack workflows. They allow the seamless utilization of output variables from one element (such as a workflow or template) as input references in subsequent elements, thereby streamlining processes and enhancing system modularity.

Referencing Variables​

Begin by navigating to Org > Workflow Group > Workflow > Stack, and select the desired workflow. In the stack workflow, access the settings tab and locate the referencing section.

To reference a variable, click the gear icon (βš™) next to the input field. This is essential each time a resource needs to:

  • Reference an already created resource.
  • Include a secret from the vault.
  • Use a value from another template.
note

The 'reference builder' is utilized for these purposes. Access it by choosing your workflow, or Stack, then go to 'Settings'. In the 'FORM' section, click the settings wheel next to the desired input field.

Reference variables can be implemented in the following methods:

  1. Workflow: Enable the use of output variables from one workflow as inputs in another for seamless data flow.
  2. Secret: Manage and reference sensitive information within workflows securely.
  3. Template: Utilize predefined variables in templates for consistent and efficient workflow integration.
note

The Template type is exclusive to the Stack Templates, as it allows referencing other templates within the same group, relevant primarily for Stack Template constructions.

a) Workflow​

  • To create a output reference, click the Reference Value link β€” or, in some cases, the gear icon (βš™) β€” next to the input field where you want to add a reference.
  • Select Workflow as the reference type.
  • From the dropdown, choose the Workflow Group Name, Stack Name (optional), and Workflow Name.
  • After selecting the workflow, choose the Output Key (for example, public_subnets.value, public_subnets.name) from the available outputs.
  • As the final step, click Use to confirm your selection.

Reference Variable Structure

When referencing variables, use the following structures based on the context:

  1. Standard Workflow: This structure is used to reference output variables from a workflow within a workflow group.
${workflow::<WORKFLOW_GROUP_ID>.<WORKFLOW_ID>.<OUTPUT_KEY>}

# For Nested Workflow Group
${workflow::<PARENT_WORKFLOW_GROUP_ID>/<WORKFLOW_GROUP_ID>.<WORKFLOW_ID>.<OUTPUT_KEY>}
  1. Workflow in a Stack: This structure is used to reference output variables from a workflow that is part of a stack.
${workflow::<WORKFLOW_GROUP_ID>.<STACK_ID>.<WORKFLOW_ID>.<OUTPUT_KEY>}

# For Nested Workflow Group
${workflow::<PARENT_WORKFLOW_GROUP_ID>/<WORKFLOW_GROUP_ID>.<STACK_ID>.<WORKFLOW_ID>.<OUTPUT_KEY>}

Reference a Workflow Output​

1. Choose a Workflow​

From the dropdown, pick the workflow you want to pull the value from. Once selected, the system will automatically fetch all the available output keys for that workflow.

2. Select an Output Key​

You have two ways to provide the output key:

  • Paste a specific Key

    If you already know the exact key you want to reference, simply paste it directly into the Output Key input field.

    This is helpful when you already know the output path (for example, from a previous workflow run) and don’t need to browse.

  • Select from the dropdown

    If you don’t know the exact key, you can use the interactive dropdown to browse all available outputs from that workflow.

    1. Click on the Search Output References field.
    2. A dropdown will open, showing all available output references.
    3. You can search or scroll to find the correct output.
    4. The outputs are displayed in nested folders, making it easier to locate the specific value you want to reference.

3. Pick Your Output​

  • From the dropdown, click on the specific output you wish to use.

  • When you select an output (for example, artifact_content.value), it will appear in the input field, confirming your choice.

    Once selected, a preview of the output reference is displayed below, showing the output key and its corresponding value path.

4. Review Your Selection​

  • After selecting your desired output, a new section called Selected Output Reference will appear.

  • This section displays the actual value of the selected output reference.

  • You can view it to confirm that you’ve selected the correct key.

  • The value preview area may also include contextual details (for example, data type or content hints).

    You can copy the value directly if needed for debugging or for use in another workflow. Once you’ve verified that it’s the correct output, click Use to confirm your selection. The system will then populate the reference string as an input for the current workflow or template.

info

When the referenced workflow is a Terraform workflow, the structure of the available output keys is slightly different from custom workflows.

  • For Terraform workflows, only the value folder is displayed. This means you’ll directly see outputs like artifact_content.value instead of multiple nested layers. It simplifies the experience and ensures you can quickly identify the actual usable values without navigating through deeper folder levels.
  • For custom workflows, the full nested folder structure remains visible, so you can explore all available output groups and subkeys as before.

This distinction helps keep Terraform outputs cleaner and more intuitive to use, while still allowing flexibility for custom workflows.

b) Secret​

Similarly, referencing secrets is straightforward. Select any item from your Vault for reference.

Reference variable structure: ${secret::vault_name}

c) Template​

Navigate to Develop -> Library -> Organization Templates -> Workflow & Stack Templates and select create template and then stack template To connect different templates within your Stack, select a template and proceed as follows:

In the 'Environment Variable' field, click the settings icon and select 'Template' type. Then, choose a template from the dropdown for reference and specify the "Output Key".

Reference variable structure: ${reference::template-group.0.outputs.cluster_name}

Viewing Output Variables​

To review all reference variables in your workflow, go to Orchestrator > Workflow Groups and select the pertinent workflow. Under the "Outputs" tab, locate "Workflow Outputs" to see all reference points for an active workflow. Each point has associated values, which can be copied using the settings icon.