Meilisearch icon

Meilisearch

Consume Meilisearch API

Overview

The "Get A Single Task" operation for the "Tasks" resource in this custom n8n node allows users to retrieve detailed information about a specific task from a Meilisearch instance. This is useful for monitoring the status or results of asynchronous operations (such as document indexing, updates, or deletions) managed by Meilisearch. Common scenarios include checking if a bulk import has completed, verifying the outcome of a settings update, or debugging failed tasks.

Practical Example:
Suppose you have triggered a document import into Meilisearch and received a task UID in response. You can use this node to fetch the current status and details of that task using its UID.

Properties

Name Meaning
Task UID The unique identifier (UID) of the task you want to retrieve. Must be a positive number.

Output

The output will be a JSON object containing the details of the requested task. While the exact structure depends on Meilisearch's API, typical fields include:

{
  "uid": 123,
  "indexUid": "my_index",
  "status": "succeeded",
  "type": "documentAddition",
  "enqueuedAt": "2023-01-01T12:00:00Z",
  "startedAt": "2023-01-01T12:00:01Z",
  "finishedAt": "2023-01-01T12:00:02Z",
  "details": { /* ... */ },
  "error": null
}
  • uid: The task's unique identifier.
  • indexUid: The index associated with the task.
  • status: Current status (e.g., enqueued, processing, succeeded, failed).
  • type: Type of operation performed.
  • enqueuedAt/startedAt/finishedAt: Timestamps for task lifecycle events.
  • details: Additional information about the task.
  • error: Error details if the task failed.

Dependencies

  • External Service: Requires access to a running Meilisearch instance.
  • API Key: Needs a valid Meilisearch API key configured in n8n credentials under meilisearchApi.
  • Environment Variable: The base URL for Meilisearch must be set in the credentials as host_url.

Troubleshooting

  • Invalid Task UID: If an invalid or non-existent UID is provided, the node may return a "Task not found" error. Ensure the UID is correct and exists in your Meilisearch instance.
  • Authentication Errors: If the API key is missing or incorrect, you may see authentication errors such as "401 Unauthorized." Double-check your credentials configuration.
  • Connection Issues: Network problems or incorrect host_url values can result in connection errors. Verify that the Meilisearch instance is reachable from your n8n environment.

Links and References

Discussion