Session Store (Ephemeral)

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

Set Value(s)

AI-generated

Summary

Store one or more key-value pairs in an ephemeral in-memory session store scoped to execution, workflow, or globally across all workflows.

Inputs

  • Scope (required) — Select the storage scope: 'execution' (current run only), 'workflow' (shared across all executions of the workflow), or 'global' (shared across the entire n8n instance). All data is ephemeral and lost on restart.
  • Set Mode (required) — Choose how values are set: 'Always Set' to overwrite or create, 'Set If Not Exists (NX)' to set only if the key does not exist, or 'Set If Exists (XX)' to set only if the key exists.
  • Values to Set (required) — Specify one or more key-value pairs to store. Each key supports dot notation for nested objects. Supported value types are string, number, boolean, array, and object. Arrays and objects are entered as JSON. Values exceeding ~10 MB will throw an error.

Output shape

a single item containing JSON with the operation result and updates, merged from all input items

Output includes 'success' status, operation type ('set'), and an 'updates' object listing all keys set with their assigned values. The operation applies to all input items independently.

Examples

Example 1: Set multiple values in workflow scope with 'Always Set' mode

Scope: workflow; Set Mode: Always Set; Values to Set: user.name (string), user.age (number)

Example 2: Set value only if it does not exist in global scope

Scope: global; Set Mode: Set If Not Exists (NX); Values to Set: settings.theme (string)

Discussion