Overview
The "Variables Dashboard" node provides a way to view, manage, and manipulate global workflow variables within n8n. It is useful for scenarios where you want to inspect all current global variables, set multiple variables at once, or clear all variables in bulk. This node helps maintain and audit the state of global variables during workflow execution.
Practical examples:
- Viewing all global variables with their types and formatted JSON values for debugging.
- Bulk setting several global variables from a table input to initialize or update workflow state.
- Clearing all global variables to reset the workflow environment before starting a new process.
Properties
Name | Meaning |
---|---|
Operation | The action to perform: - View All Variables: Display all current global variables in a table. - Bulk Set Variables: Set multiple variables at once from a table. - Clear All Variables: Remove all global variables. |
Variables Table | (Only for Bulk Set Variables) A table to define multiple variables with: - Name: Variable name (required). - Value: The value to store (string, number, boolean, object, or array). - Type: Data type for proper parsing (String, Number, Boolean, Object, Array). |
Confirm Clear All | (Only for Clear All Variables) Checkbox to confirm clearing all global variables. Must be checked to proceed. |
Display Options | Options affecting output display when viewing variables: - Show Variable Types: Include variable types in output (boolean). - Format JSON: Pretty-format JSON values for readability (boolean). - Sort Variables: How to sort variables in output: • Name (A-Z) • Name (Z-A) • Type • None |
Output
The node outputs a single item with a json
field whose structure depends on the selected operation:
View All Variables:
{ "dashboard": "Global Variables", "totalVariables": 5, "variables": [ { "name": "variableName", "value": "...", // Value as-is or pretty JSON string if object/array and formatting enabled "type": "string", // Included if Show Variable Types is true "rawValue": "..." // Original unformatted value } // ... more variables ], "variablesSummary": { "totalCount": 5, "byType": { "string": 3, "number": 1, "object": 1 } }, "lastUpdated": "2024-06-01T12:00:00.000Z" }
This output provides a snapshot of all global variables, optionally sorted and formatted.
Bulk Set Variables:
{ "operation": "bulkSet", "variablesProcessed": 3, "successCount": 2, "errorCount": 1, "results": [ { "name": "var1", "value": 123, "status": "success" }, { "name": "var2", "value": "abc", "status": "error", "error": "Cannot convert \"abc\" to number" } // ... ], "timestamp": "2024-06-01T12:00:00.000Z" }
Shows the result of attempting to set multiple variables, including success/error status per variable.
Clear All Variables:
{ "operation": "clearAll", "clearedVariables": ["var1", "var2", "var3"], "clearedCount": 3, "timestamp": "2024-06-01T12:00:00.000Z", "message": "Successfully cleared 3 variables" }
Confirms which variables were cleared and how many.
The node does not output binary data.
Dependencies
- No external services or API keys are required.
- Uses n8n's internal global static data storage for managing variables.
- No special environment variables or credentials needed.
Troubleshooting
Error: "Please confirm that you want to clear all variables by checking the confirmation checkbox"
Occurs if trying to clear all variables without enabling the confirmation checkbox. To fix, enable the confirmation option before running the clear operation.Error: "Cannot convert "..." to number" or "Cannot convert "..." to boolean"
Happens during bulk set if the provided value cannot be parsed into the specified type. Ensure values match the declared type or provide valid JSON for objects/arrays.Invalid JSON error
When setting variables of type object or array, invalid JSON strings will cause errors. Validate JSON syntax before input.Sorting options may not visibly change output if variables have identical names or types.