Algolia icon

Algolia

Use Algolia in your n8n workflows

Overview

The Algolia "Records" resource with the "Batch" operation allows users to add, update, or delete multiple records in a single index using one API request. This batch processing reduces latency and improves data integrity by applying all actions in the specified order. It is particularly useful when managing large datasets where multiple record modifications are needed simultaneously, such as bulk importing product catalogs, updating user profiles, or deleting outdated entries.

Practical examples:

  • Uploading a list of new products to an e-commerce search index.
  • Updating multiple user records with new attributes after a system migration.
  • Deleting a set of obsolete records from an index in one go.

Properties

Name Meaning
Index Name The name of the Algolia index where the batch operations will be performed.
Batch Write Params Parameters specifying which batch write options to use; currently supports "Requests".
Requests A JSON array containing the batch requests (add, update, delete) to be executed on the index.

Details:

  • Index Name: Required string option loaded dynamically from available Algolia indices.
  • Batch Write Params: Multi-options field that currently only includes "Requests", representing the batch actions.
  • Requests: JSON input where users specify the batch operations. Each request typically includes the action type (e.g., addObject, updateObject, deleteObject) and the corresponding record data.

Output

The node outputs the response from the Algolia API for the batch operation. The json output contains details about the success or failure of each individual request within the batch, including task IDs for asynchronous indexing operations. There is no binary data output.

Dependencies

  • Requires an Algolia account with an application ID and an API key credential configured in n8n.
  • The node uses Algolia's REST API endpoint specific to the user's application.
  • Proper permissions on the API key are necessary to perform batch operations on the specified index.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication errors.
    • Specifying a non-existent index name will result in an error.
    • Malformed batch requests JSON can cause request failures.
    • Exceeding Algolia's indexing rate limits may lead to throttling or errors.
  • Error messages:

    • Authentication errors indicate invalid or missing API keys.
    • "Index not found" errors suggest the provided index name does not exist.
    • Validation errors on batch requests usually mean incorrect formatting or missing required fields.
  • Resolutions:

    • Verify API credentials and ensure they have appropriate permissions.
    • Confirm the index name exists in your Algolia application.
    • Validate the JSON structure of batch requests before sending.
    • Monitor and respect Algolia's rate limits; consider batching smaller sets if limits are exceeded.

Links and References

Discussion