Skip to main content
Indexing operations run asynchronously. When you send an indexing request, Algolia queues the operation and typically returns a taskID. A successful response means Algolia accepted the request but the change might not be available yet. These operations include adding, updating, or deleting , and changing settings, rules, synonyms, or dictionary entries. Task completion time depends on server load and the number of queued tasks. Until a task finishes, searches can return the data from before the change.

When to wait

If a later action depends on a change, wait for the task to finish. Wait in these cases:
  • Managing indices: wait for an index operation to finish if the next operation depends on its result. For example, wait for an index copy to finish before changing the copy’s settings.
  • Testing: wait for the task to finish before you test a search on the updated index.
  • User feedback: wait for the task to finish before you tell users the change is available or reload data that depends on it. Otherwise, users might see old data and assume the change failed.
If later operations don’t need the change, continue without waiting. This prevents unnecessary delays. For atomic reindexing, use replaceAllObjects. It fills a temporary index, then replaces the original without interrupting searches. The method waits for each step, so you don’t need to call waitForTask.

Wait for index tasks

Use the method that matches what the operation changes. Operations that change an index return an index task ID. These include:
  • Adding, updating, and deleting records, including batch operations, deleting by query, and clearing an index
  • Changing settings, rules, and synonyms
  • Copying, moving, and deleting an index
Pass the name of the index where the task ran and the returned taskID to waitForTask. Some methods, such as saveObjects, return a task ID for each batch. If later actions depend on all batches, wait for each task or set the method’s waitForTasks option to true. waitForTask polls until the task status is published. If waitForTask reaches the retry limit, it returns an error, but the task can still finish. Use getTask to check its status, or adjust the retry limit when calling waitForTask.

Wait for app-level tasks

Dictionaries apply to all indices in your Algolia application. Operations that change dictionary entries or dictionary settings return app-level task IDs. Pass the returned taskID to waitForAppTask. App-level tasks aren’t tied to an index, so don’t pass an index name.

Other task IDs

  • Connectors use different identifiers: a task ID identifies the connector’s configuration, and a run ID identifies one execution of it. Check a run’s status in the Algolia dashboard or with the Ingestion API getRun operation. Don’t pass either to waitForTask or waitForAppTask.
  • API key operations don’t return a task ID. To wait for them, use waitForApiKey.
Last modified on November 16, 2026