> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/technical-reference/connections-and-tool-execution/provider-rate-limits-timeouts-and-retries.md).

# Provider Rate Limits, Timeouts, and Retries

Providers limit request rates and execution time. Diagnose those limits separately from invalid credentials or malformed input.

![Classify the failure before retrying](https://1957915746-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQ1Sgy933krTyK0S4JpP%2Fuploads%2FPJavG6qWUwaKGYYRvQLw%2Fprovider-rate-limits-timeouts-and-retries.png?alt=media)

Illustrative application logic, not a StackAI SDK. Implement these helpers using the selected provider’s documented errors and retry contract. Do not assume every action retries automatically.

<details>

<summary>Copy the example</summary>

```python
if result.is_rate_limited:
    follow_provider_retry_delay(result)
    reduce_request_concurrency()
elif result.is_authentication_error:
    repair_connection()  # Retrying will not fix credentials.
elif result.outcome_is_uncertain:
    reconcile_provider_result()  # Check before another write.
else:
    handle_operation_specific_error(result)
```

</details>

## Before you begin

The provider response, action name, and affected run ID.

## Key concepts

| Term              | Definition                                                                                                                                                                                                |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Rate limit        | A restriction on request volume over a provider-defined interval. Reduce request pressure and follow any returned retry delay.                                                                            |
| Timeout           | A limit on how long a particular client or operation waits. It does not always establish that execution or an external write stopped.                                                                     |
| Retry             | A repeated attempt after a failed or uncertain operation. It can repeat external changes; use it only when the result is understood.                                                                      |
| Transient failure | A failure that can resolve without changing the intended input, such as a temporary service interruption. Retry guidance is operation-specific; invalid credentials or fields usually require correction. |
| Idempotency       | A contract under which repeating the same intended operation does not create an additional change. Use it only where the provider or public operation explicitly supports it.                             |

## Handle provider request limits

1. Inspect the status and error message.
2. Follow a returned retry delay where the provider supplies one. Reduce concurrency or request size when appropriate.
3. Check the destination before repeating an operation that changes data.

The workflow can recover without repeatedly exceeding the same limit.

## Behavior and limitations

Rate limits differ by provider, account, and operation. Not every action retries automatically. A timeout can occur after a provider accepts a write, so retrying can create duplicates. Reconnection does not solve a quota error, and increasing a workflow timeout does not remove a provider rate limit.

## Related resources

[Connection Ownership, Sharing, and Permissions](https://docs.stackai.com/technical-reference/connections-and-tool-execution/connection-ownership-sharing-and-permissions.md)


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/technical-reference/connections-and-tool-execution/provider-rate-limits-timeouts-and-retries.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
