# Decrement Variable

**Decrement Variable** node is designed to decrease the value of a specified variable by a given amount. This node is useful for countdowns, reverse iterative processes, or any scenario where you need to systematically decrease a numeric value in your workflow.

### Properties Panel

<table data-header-hidden><thead><tr><th width="166"></th><th width="336"></th><th></th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Description</strong></td><td><strong>Required</strong></td></tr><tr><td>Node name</td><td><a href="../../../node-name">Node Name</a></td><td>true</td></tr><tr><td>Variable Name</td><td>The name of the variable whose value will be decremented.</td><td>true</td></tr><tr><td>Value</td><td>The amount by which the variable will be decremented.</td><td>true</td></tr></tbody></table>

### Usage

1. Specify the name of the variable you want to decrement.
2. Enter the decrement value (the amount by which the variable will be decreased).

### Behaviour

* The node will retrieve the current value of the specified variable.
* It will then subtract the provided decrement value from this variable.
* The result of the subtraction will be stored back in the same variable, overwriting its previous value.
* If the variable doesn't exist, it'll raise an error.

### Returns

The node updates the value of the specified variable with the result of the decrement operation. You can access this updated value using Magical Autocomplete (e.g.,`$.variables.<variable_name>`) in any node below this node.

### Example

Let's say you want to decrement a countdown timer by 1. You already have a variable `countdown`:

1. Set Variable name to `$.variables.countdown`
2. Set Value to `1`

If `countdown` initially had a value of 10, it will now be 9.

### Best Practices

* Ensure that the variable you're decrementing contains a numeric value to avoid type conversion errors.
* Always ensure that the variable is initialised before using this node.
