Actions12
Decrement
AI-generatedSummary
Decrement a numeric value stored under a specified key in an ephemeral session store at a defined scope by a given amount.
Inputs
- Scope — Select the scope of the storage from 'Execution' (current run only), 'Workflow' (shared across executions of this workflow), or 'Global' (shared across all workflows). Data is ephemeral and lost on restart.
- Key (required) — The key (supports dot-notation) identifying the numeric value to decrement.
- Amount — The amount by which to decrement the stored numeric value. Defaults to 1.
Output shape
An array with one JSON object containing the original value, the new decremented value, the key, and the operation performed.
If the key does not exist or is not a number, it is treated as zero before decrementing. The store is in-memory and ephemeral, per selected scope, and data is lost on n8n restart.
Examples
Example 1: Decrement a counter named 'settings.viewCount' by 2 within the current workflow's session store.
Scope set to 'Workflow', Key set to 'settings.viewCount', Amount set to 2.