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

# Set Variable

> Create and store a per-execution variable for use throughout your flow.

The **Set Variable** action lets you define a value for a <Tooltip tip="Local Variable" headline="The Set Variable action defines local variables, which are available only per execution and do not persist between requests.">local variable</Tooltip> that can be reused anywhere later in your endpoint flow.

<Frame>
  <img src="https://mintcdn.com/avicenna-a10e7e50/ohxpUs0r7PI1asBY/images/setvar.png?fit=max&auto=format&n=ohxpUs0r7PI1asBY&q=85&s=ee424531d840820e4d38990f055242ee" alt="Set Variable" width="1158" height="352" data-path="images/setvar.png" />
</Frame>

***

### Name

The **name** field defines the variable identifier. This is the key you will use when referencing the value later in the flow. For example, if you're variable's name is `points`, the reference variable will be `{local.points}`.

<Note>
  If another **Set Variable** block uses the same name later in the flow, the previous value will be overridden.
</Note>

### Value

The **Value** field defines what is actually stored in the variable. This can be:

* Static text (for example, `Hello world`)
* A number (for example, `42`)
* A boolean (`true` / `false`)
* A dynamic reference (for example, `{request.body.name}`)
* A computed value from previous blocks or input from a query parameter

***

## Referencing Variables

To reference the value of a local se the following syntax:

```text theme={null}
{local.VARIABLE_NAME}
```

For example, a variable with the name `points` can be referenced with `{local.points}`.

<Info>
  Variables created with this block are scoped to the current execution only, and will not persist after the request is completed.
</Info>

***

## Behavior & Scope

Local variables are available only during the current endpoint execution and do not persist between requests. In addition, they can be overridden within a request if another **Set Variable** action uses the same identifier name.
