Variable Update
Use the FastGPT Workflow Variable Update node to mutate global variables and intermediate state across workflow steps and loops.
Features
- Can be added multiple times
- Has external inputs
- Trigger-based execution
- Manual configuration

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.


- Numeric operators and the resulting values are shown below: the count becomes
3, the switch becomestrue, andsecondis appended to the array.


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
- Create a string global variable named
statuswith the Internal Variable type. - Connect Start → Variable Update → Assigned Reply.
- Select
statusas the update target, choose manual input, and enterready. - Reference global variable
statusin Assigned Reply. Debug and expectready, 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 and Parallel Run for container writeback behavior.
Last updated