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

# Set Variable

> Set or compute variables for use in the flow

The **Set Variable** node assigns a value to a named variable. The value can be a static string or a computed expression.

## Behavior

* Sets the named variable to the configured value
* Supports both static values and dynamic expressions
* The variable is available to all downstream nodes via `{{variableName}}`
* Emits `SET_VARIABLE.SUCCESS` on completion or `SET_VARIABLE.ERROR` on failure

## Configuration

| Parameter      | Type   | Default    | Options                | Description                                                 |
| -------------- | ------ | ---------- | ---------------------- | ----------------------------------------------------------- |
| `variableName` | string | `""`       | —                      | Name of the variable to set                                 |
| `source`       | enum   | `"static"` | `static`, `expression` | How the value is determined                                 |
| `value`        | string | `""`       | —                      | Static value (used when `source` is `static`)               |
| `expression`   | string | `""`       | —                      | Expression to evaluate (used when `source` is `expression`) |

### Source types

| Source       | Description                                                                              |
| ------------ | ---------------------------------------------------------------------------------------- |
| `static`     | Set the variable to a literal string value                                               |
| `expression` | Evaluate an expression (e.g., concatenation, arithmetic, or referencing other variables) |

## Output handles

| Handle      | Description                                       |
| ----------- | ------------------------------------------------- |
| **Success** | Variable set successfully                         |
| **Error**   | Failed to set variable (e.g., invalid expression) |

## Use cases

<AccordionGroup>
  <Accordion title="Default values">
    Set `language` to `"en"` at the start of the flow. Override it later based on caller input.
  </Accordion>

  <Accordion title="Computed values">
    Use `expression` source to combine variables: set `greeting` to `"Hello, " + {{customer_name}}`.
  </Accordion>

  <Accordion title="Flow state tracking">
    Set a `status` variable at different points in the flow (e.g., `"verified"`, `"transferred"`) for use in API calls or logging.
  </Accordion>
</AccordionGroup>
