Skip to main content
All indexing operations run asynchronously. Algolia queues each operation and returns a taskID. A successful response means Algolia accepted the request, not that the change is live. These operations include adding, updating, or deleting , and changing settings, rules, synonyms, or dictionary entries. Most tasks finish in milliseconds or seconds. The 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

Wait for a task if later requests need its change. 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 show a success message or reload data that depends on the change. Otherwise, the user can see the 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 index name and the returned taskID to waitForTask. Some methods, such as saveObjects, return a task ID for each batch. If later requests depend on all the changes, wait for all returned tasks. waitForTask polls until the task status is published. If it reaches the retry limit first, it returns an error. The task can still complete after polling stops. You can set the retry limit when you call 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 October 22, 2026