Session Store (Ephemeral)

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

Unshift to Array

AI-generated

Summary

Add a value to the beginning of an array stored in an ephemeral session context at the specified key.

Inputs

  • Scope — Select the storage scope: 'execution' (current run only), 'workflow' (shared across executions), or 'global' (shared across all workflows); storage is ephemeral and lost on restart.
  • Key (required) — The key (supports dot-notation) identifying the target array in the session storage.
  • Value Type (required) — The data type of the value to unshift into the array (string, number, boolean, array, or object).
  • Value (required) — The value to unshift to the front of the array; input type varies based on 'Value Type' selection.

Output shape

a single JSON object containing operation result details

The output JSON confirms success, key targeted, resulting array length, and operation ('unshift'). Throws an error if the target key is not an array. The storage is in-memory and ephemeral, scoped as per user selection, and data is lost on n8n restart.

Examples

Example 1: Unshift a string to an array at 'user.tasks' in workflow scope

Scope: workflow; Key: user.tasks; Value Type: string; Value: 'newTask'

Discussion