# Variable Update

> Use the FastGPT Workflow Variable Update node to mutate global variables and intermediate state across workflow steps and loops.

Source: https://doc.fastgpt.io/guide/build/workflow/nodes/variable_update
Last Updated: 2026-11-12

## Features

* Can be added multiple times
* Has external inputs
* Trigger-based execution
* Manual configuration

![Features — interface example](https://cdn.jsdelivr.net/gh/labring/fastgpt-img@main/optimized/current/node-variable-update.png.webp)

## Function

* A single node can update global variables and upstream node outputs together. This configuration applies numeric addition, boolean inversion, array append, and question replacement.

![Function — interface example](https://cdn.jsdelivr.net/gh/labring/fastgpt-img@main/optimized/current/variable-update-config.png.webp)

![Function — interface example](https://cdn.jsdelivr.net/gh/labring/fastgpt-img@main/optimized/current/variable-update-detail.png.webp)

* Numeric operators and the resulting values are shown below: the count becomes `3`, the switch becomes `true`, and `second` is appended to the array.

![Function — interface example](https://cdn.jsdelivr.net/gh/labring/fastgpt-img@main/optimized/current/variable-number-operators.png.webp)

![Function — interface example](https://cdn.jsdelivr.net/gh/labring/fastgpt-img@main/optimized/current/variable-update-result.png.webp)

## Use Cases

Common scenarios include:

* Assign a value to an "Internal Variable" type global variable, so the global variable doesn't require user input
* Update a workflow node's output upstream of the Variable Update node, so downstream nodes use the new value

## Configuration, order, and boundaries

For each update, select a global variable or node output as the target, then choose a manual value or upstream reference. Manual operations depend on type: numbers support assignment and arithmetic, booleans support setting and negation, and arrays support replacement, appending one item, and clearing. Reference mode assigns the complete referenced value.

Updates within one node run in order; later updates can read earlier changes. The template has no separate data outputs. Downstream nodes reference the updated target, and execution details record update results.

## Example: record processing status

1. Create a string global variable named `status` with the **Internal Variable** type.
2. Connect Start → Variable Update → Assigned Reply.
3. Select `status` as the update target, choose manual input, and enter `ready`.
4. Reference global variable `status` in Assigned Reply. Debug and expect `ready`, with the same value in execution details.

For an unchanged value, inspect target references and types. Parallel tasks writing the same target produce completion-order-dependent values; use the parallel node's aggregate output for deterministic results. See [Loop](https://doc.fastgpt.io/guide/build/workflow/nodes/loop_run) and [Parallel Run](https://doc.fastgpt.io/guide/build/workflow/nodes/parallel_run) for container writeback behavior.
