Delete Variable
Controlled node
Overview
The Delete Variable node removes a variable from the workflow's local variable store. This is useful for cleaning up temporary data, removing sensitive information after use, or managing memory in long-running workflows.
Unlike the Set Variable node, Delete Variable only operates on local workflow variables (not global variables) and does not require specifying a scope.
The Name input supports Handlebars templating syntax ({{variableName}}). When you include template variables in the name field, additional input sockets are automatically created to accept values for those variables, allowing you to construct dynamic variable names at runtime.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Fires when the node should execute and delete the variable. | - |
| Name | Text | The name or path of the variable to delete. Supports dot notation for nested properties (e.g., user.profile.tempData) and Handlebars templates. | - |
Dynamic Inputs
When the Name field contains Handlebars template syntax (e.g., {{prefix}}_tempData), the node automatically generates additional input sockets matching the template variable names (e.g., an input called prefix). These inputs accept the values needed to construct the final variable name at runtime.
Outputs
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the variable has been successfully deleted (or if the variable did not exist). |
Runtime Behavior and Defaults
- Scope: This node only deletes variables from the local workflow scope. It cannot delete global variables set with the
isGlobalflag on the Set Variable node. - Path Support: Supports nested path deletion using dot notation (e.g., deleting
user.settingswill remove the entire settings object, whileuser.settings.tempremoves just the temp property). - Missing Variables: If the specified variable does not exist, the node completes silently without throwing an error.
- Template Resolution: If using Handlebars syntax in the name field, the template is resolved at runtime using available workflow variables and connected inputs before deletion occurs.
Example Usage
Basic Variable Cleanup
Use this node to clean up temporary calculation variables after they've been used:
- Create a variable using Set Variable with name
tempCalculation - Process your data using the variable
- Connect the final node's Done event to the Delete Variable node's Run input
- Set the Delete Variable Name to
tempCalculation - The variable is removed from memory when the workflow reaches this node
Dynamic Variable Deletion
Delete variables with dynamically constructed names:
- Set the Name input to
{{userId}}_sessionData - The node automatically creates an input socket called
userId - Connect a data source (e.g., from a form or database) to the
userIdinput - When run, if
userIdis "user123", the node deletes the variable nameduser123_sessionData
Nested Property Removal
Remove specific properties from an object without deleting the entire object:
- Name:
user.profile.temporaryToken - This removes only the
temporaryTokenproperty from the user profile object, leaving other profile data intact.