Meilisearch icon

Meilisearch

Consume Meilisearch API

Overview

This node integrates with the Meilisearch API to manage search tasks. Specifically, the Cancel Tasks operation under the Tasks resource allows users to cancel one or multiple ongoing or pending tasks in Meilisearch by applying various filters.

Typical use cases include:

  • Stopping long-running or stuck indexing or update tasks.
  • Managing task queues by selectively cancelling tasks based on their status, type, or timing.
  • Automating cleanup of tasks that are no longer relevant or were triggered erroneously.

For example, a user might want to cancel all indexing tasks enqueued before a certain date or cancel tasks of a specific type that have not yet started.

Properties

Name Meaning
Additional Fields A collection of optional filters to specify which tasks to cancel. These include:
- UIDs Comma-separated list of Task unique identifiers (UIDs) to target specific tasks.
- Index UIDs Comma-separated list of Index UIDs to filter tasks related to particular indexes.
- Statuses Comma-separated list of task statuses to filter by (e.g., enqueued, processing).
- Types Comma-separated list of task types to filter by (e.g., indexing, deletion).
- Canceled By Comma-separated list of Task UIDs that canceled other tasks, to filter tasks canceled by them.
- Before Enqueued At Filter tasks enqueued before this datetime (ISO 8601 format).
- After Enqueued At Filter tasks enqueued after this datetime.
- Before Started At Filter tasks started before this datetime.
- After Started At Filter tasks started after this datetime.
- Before Finished At Filter tasks finished before this datetime.
- After Finished At Filter tasks finished after this datetime.

All date/time fields accept ISO 8601 formatted timestamps and are used to narrow down the set of tasks to cancel.

Output

The node outputs JSON data representing the result of the cancel tasks request. This typically includes information about the cancellation status of the filtered tasks, such as:

  • Confirmation of which tasks were successfully cancelled.
  • Metadata about the cancellation operation.

No binary data output is involved in this operation.

Dependencies

  • Requires an active connection to a Meilisearch instance.
  • Needs an API key credential for authenticating requests to the Meilisearch API.
  • The base URL of the Meilisearch server must be configured in the node credentials.

Troubleshooting

  • No tasks cancelled: If the filters do not match any existing tasks, no tasks will be cancelled. Verify the filter values, especially UIDs and date ranges.
  • Invalid date formats: Date/time filters must be valid ISO 8601 strings. Incorrect formats may cause errors or unexpected behavior.
  • Authentication errors: Ensure the API key credential is correctly configured and has sufficient permissions to cancel tasks.
  • Network issues: Confirm that the Meilisearch host URL is reachable from n8n and there are no firewall restrictions.
  • API errors: If the Meilisearch API returns errors, check the error message for details. Common issues include invalid parameters or attempting to cancel tasks that are already completed.

Links and References

Discussion