Actions12
Pop from Array
AI-generatedSummary
Remove and return the last element from an array stored in ephemeral session data at the specified key and scope.
Inputs
- Scope — Select the scope of the storage: 'execution' (data isolated to the current workflow run), 'workflow' (shared in-memory across all executions of this workflow), or 'global' (shared in-memory across all workflows). Data is always ephemeral and lost on restart.
- Key (required) — The dot-notation key identifying the target array in the session store from which to pop the last element.
Output shape
A single JSON object containing the operation result with keys: 'success' (boolean), 'key' (string, the targeted key), 'value' (the popped element), 'length' (number, the new length of the array), and 'op' (string, operation name).
Throws an error if the targeted key does not exist or is not an array. Data is stored in-memory and lost upon n8n restart. This operation works per input item; outputs correspond to inputs.
Examples
Example 1: Pop the last element of an array stored under key 'user.favorites' in the current workflow execution scope.
Scope set to 'execution', Key set to 'user.favorites'.