Skip to main content
All CollectionsBuild AutomationsVariables
Workspace Variables in Torq: Optimal Data Management
Workspace Variables in Torq: Optimal Data Management

Learn how to use workspace variables in Torq for streamlined storage and access to workspace-relevant information across workflows.

Updated over a week ago

Use workspace variables in Torq to efficiently manage frequently used information, such as emails, IP addresses, or JSON settings, making it accessible across all workspace workflows. This guide offers detailed instructions on effectively managing and utilizing workspace variables to enhance efficiency and ensure seamless operations.

  • Workspace variables are limited to 4MB, except for table variables, which have a 50MB limit.

  • More information about table workspace variables is available here.

When to Use Workspace Variables

Workspace variables in Torq provide a robust solution for persistent storage, maintaining availability across all workflows within a workspace until explicitly deleted. These variables are easily accessible and manageable through the Workspace Variables page, offering a transparent and trackable method for reviewing and monitoring key data used in workflows.

Creating a New Workspace Variable

From within a Torq workflow, use the Create a workspace variable step. Or, from within Torq, follow these steps:

  1. Navigate to the Workspace Variables Tab: Navigate to Build > Workspace Variables.

  2. Initiate Variable Creation: Select Create Variable to begin the setup.

  3. Define the Variable: Assign your variable a unique and meaningful name. Names can include spaces, numbers, hyphens, and letters, but avoid special characters. Keep in mind that the name cannot be changed after creation.

  4. Select the Variable Type: Depending on your need, you can choose from the following types: Text, JSON (objects, arrays, or any valid format), Boolean, Number, or Table.

  5. Enter the Variable's Value: Input the desired data in the provided field.

  6. Save Your Settings: Confirm your entries and click Save to store the variable.

Editing an Existing Workspace Variable

From within a Torq workflow, use the Update a workspace variable step. Or, from within Torq, follow these steps:

  1. Access the Workspace Variables Tab: Navigate to Build > Workspace Variables.

  2. Select the Variable to Edit: Identify and click on the variable you wish to modify.

  3. Update the Variable: Alter the value as necessary. You can update both the type and the content.

  4. Save the Changes: Confirm the changes are accurate, as previous variable versions won't be saved. Click Save to apply the updates.

Deleting a Workspace Variable

From within a Torq workflow, use the Delete a workspace variable step. Or, from within Torq, follow these steps:

  1. Access the Workspace Variables Tab: Navigate to Build > Workspace Variables.

  2. Select the Variable to Delete: Identify and click on the variable you wish to delete.

  3. Initiate Deletion: Click the trash can icon next to the variable name to remove the variable.

  4. Confirm Deletion: Confirm your intention in the popup dialog. Please note that this action is irreversible, so ensure accuracy.

Using Workspace Variables in Workflows

  1. There are several steps available for workspace variables, so you can access or edit them from within your workflow in addition to the UI:

    • Create a workspace variable

    • Delete a workspace variable

    • Get a workspace variable

    • List workspace variables

    • Update a workspace variable

  2. Integrate Variables into Workflows: Use workspace variables in your workflows as you would use any integration, secret, or metadata event. Within your workflow, click on the parameter you want to populate with a variable.

  3. Select the Variable: In the autocomplete, scroll to Workspace Variables and choose the needed variable. Alternatively, directly type the variable name as {{ $.workspace_variables.VARIABLE_NAME }} to integrate it.

Did this answer your question?