Session Store (Ephemeral)

Store and retrieve data from in-memory session during a workflow execution

Increment

AI-generated

Summary

Atomically increase a numeric value stored under a specified key in ephemeral session storage, scoped to execution, workflow, or globally across the n8n instance.

Inputs

  • Scope — Select the storage scope: 'execution' for current run only, 'workflow' for shared across all executions of the workflow, or 'global' for shared across all workflows (all scopes are in-memory and ephemeral). Defaults to 'execution'.
  • Key (required) — The dot-notation key identifying the numeric value to increment.
  • Amount — The numeric amount to increment by (default is 1).

Output shape

a single JSON object containing the increment operation result for each input item

The output JSON includes the key, the old value before incrementing, the new incremented value, and the operation ('increment'). If the key does not exist or is not numeric, it is treated as zero before incrementing. Data is stored in-memory and lost on n8n restart.

Examples

Example 1: Increment a session counter for user logins in the 'workflow' scope by 1

Scope set to 'workflow', Key set to 'user.loginCount', Amount omitted (defaults to 1).

Example 2: Increment a global request count by 5

Scope set to 'global', Key set to 'global.requestCount', Amount set to 5.

Discussion