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

# Set variable node

> Store a workflow variable during execution

Sets or replaces a workflow variable and then advances through the `next` edge.

## Configuration

* `variable_name`: Variable name to set
* `variable_value`: Value to store
* `value_type`: string, number, boolean, or json

## Workflow library example

```javascript theme={null}
workflow.addNode("mark_priority", {
  type: "set_variable",
  variableName: "priority",
  variableValue: "high",
  valueType: "string"
});
```

## API payload shape

When using the Platform API directly, use snake\_case keys:

```json theme={null}
{
  "node_type": "set_variable",
  "config": {
    "variable_name": "priority",
    "variable_value": "high",
    "value_type": "string"
  }
}
```

## Usage patterns

**Store routing state**

```mermaid theme={null}
graph LR
    A[Decide] --> B[Set variable<br/>priority = high]
    B --> C[Handoff]
```

**Prepare data for a function**

```mermaid theme={null}
graph LR
    A[Set variable] --> B[Function]
```
