> For the complete documentation index, see [llms.txt](https://developer.collibra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.collibra.com/api/guides/introduction/the-output-module-query-language/set-an-execution-timeout.md).

# Set an execution timeout

Queries that run on complicated or large amounts of data may be slower than expected. Usually, the best approach is to paginate the results. In cases where the complexity or amount of data is unknown, a timeout can break up the execution. The Output Module can timeout, not only on the execution logic level, but also break running database queries to protect the database load from stress.

You can set a timeout for each `ViewConfig` and `TableViewConfig` execution on the main config level. Defining it in the body of the query is optional.

If a timeout is not set in the `ViewConfig` or `TableViewConfig`, then a default value is added. You can configure the default value in the Collibra console, the default setting is eight hours.

{% hint style="danger" %}

* No single query may run longer than 24 hours, which is the maximum value.
* Pagination is recommended for queries that may run longer.&#x20;
* Those values will significantly smaller in the next major release, so it would be prudent to think about pagination.
* If the `queryTimeout` is more than 24 hours, the system will overwrite it with the maximum 24-hour limit value.
* Important exceptions are the `{{domain}}/rest/2.0/outputModule/export/{{csv | excel}}-job` endpoints. Here, data is calculated in chunks, with the size of the chunk defined in the Collibra Console. A separate query calculates each chunk and the timeout value set in the `TableViewConfig` will be a timeout value calculation for that chunk.
  {% endhint %}

| JSON key     | Minimum value | Default value          | Maximum value | Description                                                                                                                                                                                                                                                                 |
| ------------ | ------------- | ---------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| queryTimeout | 1 minute      | 8 hours (configurable) | 24 hours      | Timeout in number of seconds that computation of the output can last. No decimal point allowed. Negative values are invalid. Zero means no timeout. Positive values will stop execution and return an error if the execution takes longer than the given number of seconds. |

Example of ViewConfig with a timeout set:

{% tabs %}
{% tab title="JSON" %}

```json
{
  "ViewConfig": {
    "queryTimeout": 5,
    "Resources": {
      "Domain": {
        "name": "d",
        "Name": {
          "name": "vocName"
        },
        "Asset": {
          "name": "t",
          "Signifier": {
            "name": "assetName"
          },
          "AssetType": {
            "name": "tt",
            "Name": {
              "name": "assetType"
            }
          }
        }
      }
    }
  }
}
```

{% endtab %}

{% tab title="YAML" %}

```yaml
---
ViewConfig:
  queryTimeout: 5
  Resources:
    Domain:
      name: "d"
      Name:
        name: "vocName"
      Asset:
        name: "t"
        Signifier:
          name: "assetName"
        AssetType:
          name: "tt"
          Name:
            name: "assetType"
```

{% endtab %}
{% endtabs %}

After the timeout is reached, the REST request will receive a response with HTTP error code 408. Instead of a results message, the body will contain a JSON with the error description.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.collibra.com/api/guides/introduction/the-output-module-query-language/set-an-execution-timeout.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
