Latency with TaskList Search Variable API?

Hi ! I’m using Camunda with a synchronization mechanism that fetch created tasks and then get variables from these newly created tasks (with the the nodejs @camunda8/sdk client).

When we search variables for a task (by its taskId), it appears that sometimes Camunda returns an error 404 :
Response code 404 (Not Found) (request to https://bru-2.tasklist.camunda.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxx/v1/tasks/xxxxxxxxxxxxx/variables/search)

The code that make this request :

      return await this.camunda8
        .getTasklistApiClient()
        .getVariables({ taskId, variableNames: [] });

Is it possible that this endpoint have a latency between “the task is created” and “the task contains variables” ?
After a retry, this endpoint returns all the variables we need.

We are using Camunda 8.5+gen12 on a dev cluster.

Thank you for your time.

you are seeing latency due to data need to be exported into ElasticSearch.

Tasklist API uses ElasticSearch to get the data.

Thanks for your response.
Does it mean that if we fetch variables from the “search task” endpoint, we can get the same symptom ? When I used the “includedVariables” parameter, I always had the variables linked to the task.

ex :

return await this.camunda8.getTasklistApiClient().searchTasks({
      state: 'CREATED',
      includeVariables: [...],
    });