Apify icon

Apify

Access Apify tools for web scraping, data extraction, and automation.

Overview

This node integrates with Apify's platform to interact with its Key-Value Stores, which are used for storing and retrieving data records by key. Specifically, the "Get Key-Value Store Record" operation fetches a single record from a specified Key-Value Store using the record's key.

Common scenarios where this node is beneficial include:

  • Retrieving configuration or state data stored in Apify's Key-Value Store during automation workflows.
  • Accessing previously scraped or processed data saved in a Key-Value Store for further processing or analysis.
  • Integrating Apify data storage into broader n8n workflows that require dynamic data retrieval.

Practical example:

  • A workflow that scrapes product information and stores it in a Key-Value Store can later use this node to retrieve specific product details by key for reporting or notification purposes.

Properties

Name Meaning
Key-Value Store ID The identifier of the Key-Value Store from which to retrieve the record. Can be selected from a list or entered manually (alphanumeric only).
Key-Value Store Record Key The key of the specific record within the Key-Value Store to retrieve. Can be selected from a list or entered manually (any non-empty string).
Authentication Method of authentication to access Apify: either an API key credential or OAuth2 token.

Output

The node outputs the retrieved record as JSON in the json output field. This JSON represents the value stored under the specified key in the Key-Value Store.

If the record contains binary data, it would typically be represented in the binary output fields, but based on the provided code and properties, the focus is on JSON data retrieval.

Dependencies

  • Requires access to the Apify platform.
  • Needs either an API key credential or OAuth2 authentication configured in n8n to authorize requests.
  • The node relies on Apify's REST API endpoints for Key-Value Store operations.
  • No additional external dependencies beyond standard HTTP requests to Apify.

Troubleshooting

  • Invalid Key-Value Store ID: If the store ID does not match the expected alphanumeric pattern, the node will reject it. Ensure the ID is correct and contains only letters and numbers.
  • Record Key Not Found: If the specified record key does not exist in the store, the node may return an error or empty result. Verify the key exists in the target store.
  • Authentication Errors: Using incorrect or expired API keys or OAuth tokens will cause authorization failures. Confirm credentials are valid and have necessary permissions.
  • Empty Store ID or Record Key: Both fields are required. Leaving them empty will prevent execution.
  • Network Issues: Connectivity problems with Apify's API endpoint can cause timeouts or errors. Check network access and Apify service status.

Links and References

Discussion