# Rename variables in a flow

import { Steps } from "@astrojs/starlight/components"

When you rename a variable, Studio rewrites references across the flow: formula pills, **Transform data** rows, step
inputs, and other fields that pointed at the old name. That is different from **reassign**, where you keep the name and
change the value on a **Transform data** step.

## When to use

- A variable name no longer matches its purpose (`temp_url` → `search_url`) and you want one rename instead of manual
  edits in every step.
- You standardized naming after building a large flow.
- Prefer [Transform data and reassign variables](../transform-data-and-reassign-variables/) when the name stays the same
  and only the value should change as the run progresses.

Before you begin, open the flow in the designer with permission to edit it.

## Guide

### Rename a global variable

Global variables are declared on the flow **Configure** tab, **Variables** section.

<ol>
<li>

**Open Variables.** In the designer, choose **Configure**, then open the **Variables** tab.

</li>
<li>

**Edit the name.** Select the variable name field and type the new name. Studio opens a **Save** confirmation under the
field.

<div class="docs-screenshot-compact">

![Configure Variables tab with Save confirmation while renaming a global variable](./assets/flow-global-variable-rename-save.png)

</div>

</li>
<li>

**Confirm Save.** Choose **Save** (or press Enter). Studio updates formulas and references that used the previous name
throughout the flow.

</li>
<li>

**Cancel if needed.** Choose **Cancel** or press Escape to keep the old name.

</li>
</ol>
### Rename on a Transform data step

**Transform data** steps expose the same rename pattern on the **Variables** tab for step-scoped rows.

<ol>
<li>

**Select the Transform data step.** Open the **Variables** tab on that step.

</li>
<li>

**Rename the row.** Change the **Name** field, then **Save** when Studio prompts you. References in the same flow that
used the old name update automatically.

</li>
</ol>
## Example

A flow used `alert_id` in five **Transform data** steps and two service steps. The operator renames the global variable
to `incident_id` on the **Variables** tab and confirms **Save**. Every `/` pick and formula pill that referenced
`alert_id` now uses `incident_id` without editing each step by hand.

## Keep in mind

- Rename changes the identifier, not the stored value. Use **Transform data** when you need a new value under the same or
  a new name.
- You cannot rename the built-in **Mindflow** system variable. See
  [Use Mindflow built-in variables](../use-mindflow-built-in-variables/).
- After large renames, run a dry run or Live Run and spot-check **Logs** on steps that reference the variable.

## Related

[Transform data and reassign variables](../transform-data-and-reassign-variables/) · [Work with data](../) ·
[Transform functions](../transform-functions/)
