Guides

Tasks

Create asynchronous tasks, export large results, and understand how tasks are queued and limited.

Sometimes you need to get access to the full list of documents, the full list of your entities or any large result.
To do that, you can either make multiple requests using the Pagination or use an asynchronous task.

This asynchronous task will be faster than doing multiple requests.

The download urls are valid for the next 5 minutes.

Task results are deleted after 1 week.

loop [Polling status] POST /[endpoint]/export Create task 202 Accepted {task_id} GET /tasks/{task_id}/status Task status Save results. Update status POST /tasks/{task_id}/download 200 OK {urls} Use the download urls to get the results Client API Task
Sequence diagram showing a successful export

Exporting a large result consists of three steps:

  1. Asking for a export task, using POST /[endpoint]/export.
  2. Polling the status of the task, using GET /tasks/{task_id}/status.
  3. Retrieving download urls, using POST /tasks/{task_id}/download.

Exports consists of one or multiple csv files. Columns order might change between releases.

Task queuing

Only a limited number of tasks can run at the same time, so every task you create goes into a queue:

  • If you are under the limit, the task starts immediately.
  • Otherwise, the task is created with a pending status and waits its turn. It starts automatically as soon as one of the running tasks finishes.

There are several queues, and the one your task joins depends on its type. They are independent from each other: an AI Report waiting in its queue never delays an export, and the other way around.

The AI Report queue

AI Report generation tasks (esg_due_diligence, deal_screening, legal_screening, supplier_chain_screening, secondary_and_credit_screening, good_governance_screening) all go into the same queue, shared with all clients using the platform.

See Limitations for the exact number of reports each client can run at once.

How queued AI Report tasks are picked

Whenever a running report task completes or fails, the queue is re-checked to see if a pending task can now start.

Pending tasks are considered smallest-first: a report covering fewer companies is picked before a larger one, since it finishes and makes room for the next one sooner. Among tasks of the same size, the pick is randomized rather than strictly first-in-first-out. This is deliberate: without it, a client that queues many similarly-sized reports at once could take every place that frees up, blocking other clients from ever being served while that queue is being worked through.

The export and universe ESG report queues

Export tasks (export) and universe ESG report tasks (universe_esg_report) each have their own queue, separate from the AI Report one above and from each other. Exports waiting in the queue therefore never delay your universe ESG reports, and the other way around.

Universe ESG report tasks come from both the ESG Cases Report and the ESG Events Report routes, which share the same queue.

These two queues are per client: they contain the tasks requested by every user of your client account.

Unlike the AI Report queue, these two also have a maximum size: once yours is full, new tasks of that type are refused with a 429 Too Many Requests until one of the queued ones starts.

See Limitations for the exact number of tasks you can run and queue at once, and for the error returned when a queue is full.

Task status

StatusMeaning
pendingThe task has been created and is waiting its turn in the queue. A task also stays pending for a short moment after it has been picked from the queue, until execution actually begins.
startingThe task has been dispatched and execution is being initialized.
runningThe task is actively being processed.
completedThe task finished successfully. Results can be retrieved, see the steps above or Generate an AI Report.
failedThe task could not be completed.

pending, starting, and running are all non-final states: you should keep polling GET /tasks/{task_id}/status until you reach completed or failed.