Actions3
- Index Actions
- Objects Actions
Overview
The Add Object operation for the Objects resource in this custom n8n node allows you to add a new object (record) to a specified Algolia index. This is useful when you want to programmatically insert data into your Algolia search indices from within an n8n workflow.
Common scenarios:
- Automating the addition of user profiles, product listings, or any structured data to Algolia for instant search capabilities.
- Integrating with other systems (e.g., databases, CRMs) to sync or push new records into Algolia as part of a workflow.
- Enriching Algolia indices with data collected or transformed in n8n.
Practical example:
After collecting form submissions via a webhook, you can use this node to add each submission as a searchable object in your Algolia index.
Properties
| Name | Type | Meaning |
|---|---|---|
| Index Name | options (string) | The name of the Algolia index where the object will be added. Populated dynamically from your Algolia app. |
| Object | options | Determines how the object data is provided: either as raw JSON or as key-value fields below. |
| JSON | json | If "From JSON" is selected, paste the full JSON object here. |
| Object Fields | fixedCollection | If "Using Fields Below" is selected, specify object properties as name/value pairs. |
Output
- The output is the standard response from Algolia's "add object" API endpoint.
- The
jsonfield in the output typically contains:objectID: The unique identifier assigned by Algolia to the newly created object.taskID: The task ID for tracking indexing operations.- Any additional metadata returned by Algolia.
Example output:
{
"objectID": "123456",
"taskID": 78901234
}
Note: This node does not output binary data.
Dependencies
- External Service: Requires access to an Algolia account and a valid API Key with write permissions.
- n8n Credentials: You must configure Algolia credentials (
appIdandapiKey) in n8n under the credential typealgoliaApi. - Environment: No special environment variables are required beyond n8n's standard configuration.
Troubleshooting
Common issues:
- Invalid Index Name: If the specified index does not exist, Algolia will return an error. Ensure the index name is correct and exists in your Algolia dashboard.
- Malformed JSON: If providing object data as JSON, ensure it is valid. Invalid JSON will cause parsing errors.
- Missing Required Fields: If required fields for your Algolia index are missing, the object may not be indexed as expected.
- Authentication Errors: If credentials are incorrect or lack write permissions, you will receive authentication/authorization errors.
Error messages and resolutions:
"Invalid Application-ID or API key": Check your Algolia credentials in n8n."Index does not exist": Verify the index name in the "Index Name" property."Unexpected token ... in JSON": Double-check the syntax of your JSON input.