> ## Documentation Index
> Fetch the complete documentation index at: https://trickest.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Managing Variables

> Learn how to create and use variables in Trickest workflows and nodes

## Overview

Variables allow you to create dynamic, reusable workflows by parameterizing values instead of hardcoding them. Use variables to store API keys, target domains, configuration values, and other parameters that change between runs or environments.

## Variable Scopes

Trickest supports two variable scopes:

**Global (Vault-level) Variables**

* Accessible across all workspaces in your organization
* Managed by [Super Admins](/docs/key-concepts/roles-and-permissions) only
* Ideal for organization-wide credentials and shared configuration

**Workspace Variables**

* Scoped to a specific workspace
* Managed by [Workspace Owners](/docs/key-concepts/roles-and-permissions#owner) only
* Ideal for workspace-specific targets and team credentials

<Note>
  When a variable exists at both levels with the same name, the workspace variable takes precedence.
</Note>

### Platform-Provided Variables

Trickest automatically provides several dynamic variables. These are maintained by the platform and can be referenced the same way as user-defined variables.

**Global Variables (Available everywhere)**

| Variable         | Description                                 | Usage                      |
| :--------------- | :------------------------------------------ | :------------------------- |
| `TRICKEST_TOKEN` | Your platform authentication token (secret) | `${{vars.TRICKEST_TOKEN}}` |
| `USER_ID`        | Your user ID                                | `${{vars.USER_ID}}`        |
| `USERNAME`       | Your username                               | `${{vars.USERNAME}}`       |
| `VAULT_ID`       | Your organization/vault ID                  | `${{vars.VAULT_ID}}`       |
| `VAULT_NAME`     | Your organization/vault name                | `${{vars.VAULT_NAME}}`     |

**Workspace Variables (Workspace-specific)**

| Variable        | Description                  | Usage                     |
| :-------------- | :--------------------------- | :------------------------ |
| `SPACE_ID`      | Current workspace/space ID   | `${{vars.SPACE_ID}}`      |
| `SPACE_NAME`    | Current workspace/space name | `${{vars.SPACE_NAME}}`    |
| `WORKFLOW_NAME` | Current workflow name        | `${{vars.WORKFLOW_NAME}}` |

***

## Creating Variables

Create variables from the Variables area in the platform, then reference them in node parameters and scripts.

### Create a global or workspace variable

<Steps>
  <Step title="Open Variables">
    In the global menu, open **Variables** under Workspace or Platform (Global), depending on the scope you want.
  </Step>

  <Step title="Create a new variable">
    Click **New** (or **Create variable**).
  </Step>

  <Step title="Set scope and details">
    Set **Scope** to **Global** or Workspace as needed. Enter a **Name** (for example, `TARGET_DOMAIN`) and a **Value** (for example, `trickest.com`).
  </Step>

  <Step title="Save">
    Save the variable.
  </Step>
</Steps>

<Note>
  Variable names are case-sensitive. Use consistent naming conventions across teams (for example, `UPPER_SNAKE_CASE`).
</Note>

***

## Using Variables

You can reference variables in any node parameter that accepts a value (for example, string inputs, flags, URLs, and tool parameters). The platform substitutes the values before execution, so treat them as string literals in your code.

### Use variables in tool/module parameters

In a tool node parameter field, enter the variable expression directly.

Example: set a domain input to a variable instead of a hardcoded value:

* `domain`: `${{vars.TARGET_DOMAIN}}`

This is the recommended approach for values you expect to reuse or change over time.

### Use variables in scripts

Variables can also be used inside script content. In the current editor, scripts do **not** provide a variable dropdown - type the variable reference directly.

Example (Bash):

```markdown theme={null}
# Access variables
TARGET="${{vars.TARGET_DOMAIN}}"

# Use in commands
echo "Scanning target: $TARGET"
curl  "https://api.example.com/scan?domain=$TARGET"
```

Example (Python):

```
#!/usr/bin/env python3

# Access variables
target = "${{vars.TARGET_DOMAIN}}"
threads = int("${{vars.MAX_THREADS}}")

# Use in your code
print(f"Scanning: {target}")
```
