Find Key
AI-generatedOverview
This node, named "Find Key," is designed to search for and retrieve data by a specified key from a JSON Vault stored in the workflow's global static data. It supports nested key paths using dot notation (e.g., "users.admin"). The node is useful in scenarios where you need to extract specific pieces of data from a centralized JSON data store within an n8n workflow, such as fetching user details, configuration settings, or any structured data stored in the vault. It can optionally throw an error if the specified key does not exist, allowing for strict data validation.
Use Case Examples
- Extracting user information stored under nested keys like "users.admin" from a JSON Vault.
- Retrieving configuration parameters stored in the vault by their keys for use in subsequent workflow steps.
- Validating the existence of required data keys and handling missing data gracefully by throwing errors if needed.
Properties
| Name | Meaning |
|---|---|
| Key | The key to search for in the JSON Vault. Supports nested paths with dots (e.g., "users.admin"). This is a required string input. |
| Error if Not Exists | A boolean flag indicating whether the node should throw an error if the specified key does not exist in the vault. Defaults to false. |
Output
JSON
key- The key that was searched for.found- Boolean indicating whether the key was found in the vault.value- The value associated with the key if found; null otherwise.success- Boolean indicating if the operation was successful.vaultSize- The total number of keys stored in the JSON Vault.error- Error message if the operation failed (present only on failure).
Dependencies
- Requires access to a JSON Vault stored in the workflow's global static data.
Troubleshooting
- If the JSON Vault is not initialized or empty, the node returns a default response indicating the key was not found.
- If the key format is invalid (contains characters other than letters, numbers, dots, hyphens, and underscores), the node throws an error.
- If 'Error if Not Exists' is enabled and the key is missing, the node throws an error specifying the missing key.
- Errors include context with the item index to help identify which input caused the failure.
- To handle errors gracefully, enable 'Continue On Fail' in the node settings.