Meilisearch icon

Meilisearch

Consume Meilisearch API

Overview

The Meilisearch node for n8n allows you to interact with the Meilisearch API. Specifically, when using the Tasks resource and the Delete Tasks operation, this node enables you to delete tasks from your Meilisearch instance based on various filter criteria. This is useful for managing and cleaning up background tasks (such as document indexing or updates) that are no longer needed or were created in error.

Common scenarios:

  • Removing old or unnecessary tasks to keep your Meilisearch instance organized.
  • Deleting tasks that match specific statuses, types, or timeframes.
  • Automating cleanup of canceled or failed tasks as part of a workflow.

Practical example:
You might use this node in an automation that runs nightly to delete all completed or failed tasks older than 30 days, ensuring your task list remains manageable.


Properties

Name Meaning
Additional Fields A collection of optional filters to specify which tasks to delete. Each field below can be used individually or in combination.
UIDs Comma-delimited list of Task UID(s) to filter results by.
Index UIDs Comma-delimited list of Index UID(s) to filter results by.
Statuses Comma-delimited list of Task Status(es) to filter results by.
Types Comma-delimited list of Task Type(s) to filter results by.
Canceled By Comma-delimited list of Task UID(s) that canceled another task(s).
Before Enqueued At Filter tasks enqueued before this date/time.
After Enqueued At Filter tasks enqueued after this date/time.
Before Started At Filter tasks started before this date/time.
After Started At Filter tasks started after this date/time.
Before Finished At Filter tasks finished before this date/time.
After Finished At Filter tasks finished after this date/time.

Output

The output will be a JSON object containing the result of the delete operation. Typically, this includes information about the deleted tasks or a summary of the deletion action. The exact structure depends on the Meilisearch API response, but you can expect fields such as:

{
  "taskUid": 123,
  "indexUid": "my_index",
  "status": "deleted",
  "enqueuedAt": "2023-01-01T12:00:00Z",
  ...
}

If multiple tasks are deleted, the output may be an array of such objects.

Note: This node does not output binary data.


Dependencies

  • External Service: Requires access to a running Meilisearch instance.
  • API Key: You must provide valid Meilisearch API credentials (meilisearchApi).
  • n8n Configuration: The host_url credential must be set to point to your Meilisearch server.

Troubleshooting

Common issues:

  • Invalid Credentials: If the API key or host URL is incorrect, you may receive authentication errors. Double-check your credentials.
  • No Tasks Deleted: If your filters are too restrictive or do not match any tasks, the node may report that no tasks were deleted.
  • Date Format Errors: Ensure date/time fields are provided in a valid format; otherwise, the API may reject the request.

Error messages:

  • "401 Unauthorized": Check your API key and permissions.
  • "400 Bad Request": Review your filter values, especially date formats and comma-separated lists.
  • "404 Not Found": The specified task or index does not exist.

Links and References

Discussion