Clear JSON
AI-generatedOverview
This node, named Clear JSON, is designed to clear data stored in a JSON Vault within the workflow's static data. It supports two modes: clearing all data from the vault or clearing a specific key within the vault. This is useful in scenarios where you want to reset or selectively remove stored JSON data during workflow execution, such as clearing cached data or resetting state information.
Use Case Examples
- Clear all stored JSON data in the vault to reset the workflow state.
- Clear a specific key (e.g., 'users.list') from the JSON Vault to remove only targeted data without affecting other stored information.
Properties
| Name | Meaning |
|---|---|
| Clear Mode | Determines whether to clear all data from the vault or just a specific key. |
| Key | The specific key to clear from the vault, used only when Clear Mode is set to 'Clear Specific Key'. |
Output
JSON
jsonsuccess- Indicates if the clear operation was successful (true or false).action- Describes the action performed: 'cleared_all' or 'cleared_key'.key- The key that was cleared when Clear Mode is 'Clear Specific Key'; undefined otherwise.vaultSize- The number of keys remaining in the JSON Vault after the clear operation.
Dependencies
- Requires access to the workflow's static data storage to manage the JSON Vault.
Troubleshooting
- If 'Clear Specific Key' mode is selected but no key is provided, the node throws an error indicating the key is required.
- If the specified key does not exist in the vault, no error is thrown; the operation simply does not remove anything.
- Errors during execution are caught and can be handled with 'continue on fail' to allow workflow continuation despite failures.