# Latency with TaskList Search Variable API?

**URL:** <https://forum.camunda.io/t/latency-with-tasklist-search-variable-api/57303>\
**Category:** Camunda 8 Topics\
**Tags:** tasklist, node-js-sdk\
**Created:** [November 22, 2024, 4:06pm UTC](https://forum.camunda.io/t/latency-with-tasklist-search-variable-api/57303 "2024-11-22T16:06:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc\_Bouteiller](https://forum.camunda.io/user_avatar/forum.camunda.io/marc_bouteiller/32/30873_2.png) [@Marc\_Bouteiller](https://forum.camunda.io/u/Marc_Bouteiller)\
**Post date:** [November 22, 2024, 4:06pm UTC](https://forum.camunda.io/t/latency-with-tasklist-search-variable-api/57303/1 "2024-11-22T16:06:05Z")

</div>

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 :

```ts
      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.

---

<div class="post-metadata">

**Author:** ![cpbpm](https://forum.camunda.io/letter_avatar_proxy/v4/letter/c/919ad9/32.png) [@cpbpm](https://forum.camunda.io/u/cpbpm)\
**Post date:** [November 22, 2024, 4:19pm UTC](https://forum.camunda.io/t/latency-with-tasklist-search-variable-api/57303/2 "2024-11-22T16:19:58Z")

</div>

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

Tasklist API uses ElasticSearch to get the data.

---

<div class="post-metadata">

**Author:** ![Marc\_Bouteiller](https://forum.camunda.io/user_avatar/forum.camunda.io/marc_bouteiller/32/30873_2.png) [@Marc\_Bouteiller](https://forum.camunda.io/u/Marc_Bouteiller)\
**Post date:** [November 25, 2024, 7:49am UTC](https://forum.camunda.io/t/latency-with-tasklist-search-variable-api/57303/3 "2024-11-25T07:49:38Z")

</div>

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 :

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

```

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [December 2, 2024, 7:50am UTC](https://forum.camunda.io/t/latency-with-tasklist-search-variable-api/57303/4 "2024-12-02T07:50:26Z")

</div>

Closed on December 2, 2024, 7:50am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
