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

# Project Variables

> Store a reusable value once and reference it from any step in any flow

Project Variables are named values, scoped to a single project, that you can reference from any step in any flow. Use them for things you'd otherwise paste into a dozen steps: an API key, a webhook URL, a Slack channel ID, a feature flag.

Unlike step output, a variable's value isn't tied to a single flow run. It stays the same until you change it, and it stays out of your flow's steps, so rotating a key means editing it once instead of hunting through every flow that uses it.

> [!TIP]
>
> If you're storing credentials for a specific piece (Slack, Stripe, Google Sheets, etc.), create a connection for that piece instead. Variables are for plain values you want to reuse, not for piece authentication.

## Creating a variable

1. Go to **Variables** in the left sidebar, or open the **Variables** tab in a step's Data Selector while editing a flow.
2. Click **New variable**.
3. Enter a **Name**. Names can only contain letters, numbers, and underscores (e.g. `STRIPE_PROD`, `SLACK_CHANNEL_ID`).
4. Enter the **Value** and click **Create**.

![Creating a project variable](https://mintcdn.com/activepieces/o_Bw8pIaWCsuFQYY/resources/screenshots/project-variables/new-variable-dialog.png?fit=max\&auto=format\&n=o_Bw8pIaWCsuFQYY\&q=85\&s=9a2bff91692055250fd9198a4837a15c)

## Referencing a variable in a flow

Insert `{{variables['NAME']}}` into any step input. The easiest way is from the Data Selector: open the **Variables** tab and click the variable you want, it's inserted at your cursor automatically.

![Inserting a variable from the Data Selector](https://mintcdn.com/activepieces/Dhz0g00bGK6cNUcW/resources/screenshots/project-variables/data-selector-variables-tab.png?fit=max\&auto=format\&n=Dhz0g00bGK6cNUcW\&q=85\&s=93450560de1cce3034d2e083b9e4f7fc)

You can also copy a variable's reference from the Variables page: open the row's menu and click **Copy reference**.

## Rotating a value

A variable's value is encrypted at rest and never displayed in the variables list or the edit dialog. To change it, open the variable and click **Rotate value**, then enter the new value.

Members with write access (Editor or Admin) can retrieve the plaintext through the reveal endpoint (`POST /v1/variables/:id/reveal`) with their signed-in session. API keys cannot reveal a value. On platforms with audit logs enabled, each reveal is recorded as a `VARIABLE_VALUE_REVEALED` event.

## Deleting a variable

> [!WARNING]
>
> Deleting a variable doesn't touch the flows that reference it. Any step still referencing `{{variables['NAME']}}` will fail at runtime the next time it runs.

Before deleting a variable, search your flows for its reference and remove or replace those steps first.

## Managing variables from your backend

Use the [Variables API](https://www.activepieces.com/docs/endpoints/variables/schema.md) with a platform API key to create, list, update, and delete variables in any project of your platform. This is how you store per-tenant secrets when you embed Activepieces.

## Permissions

Reading and writing variables are separate permissions (`READ_VARIABLE`, `WRITE_VARIABLE`) tied to your project role, same as any other resource. A member with read-only access can use existing variables in flows but can't create, edit, or delete them.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.