---
title: rate-limit-max-wait
description: An experimental_rateLimit() call could not get a slot within its maxWait.
docs_index: /llms.txt
lastUpdated: 2026-11-23
type: troubleshooting
summary: "Handle RateLimitMaxWaitError when a rate-limited call's next slot is later than its maxWait."
prerequisites:
  - /docs/api-reference/workflow/rate-limit
related:
  - /docs/foundations/rate-limits
  - /docs/api-reference/workflow/rate-limit
---

> For an index of all documentation, see [/llms.txt](/llms.txt).

This error is thrown by [`experimental_rateLimit()`](/docs/api-reference/workflow/rate-limit) when the key's next free slot is later than the call's `maxWait`. The call reserved nothing, so it used up none of the key's capacity.

It is also thrown, after waiting, by a call whose run woke [so late](/docs/api-reference/workflow/rate-limit#calls-that-wake-late) that it was given new slots and ended up past its `maxWait`. That call had reserved a slot.

## Error message

```text
Rate limit "<key>" has no slot within the call's maxWait (next slot at <time>)
```

## Why this happens

Every call on a key takes the next slot, `period / limit` after the one before. When more calls arrive than the limit admits, slots move into the future, and a call whose slot would be past its `maxWait` fails at once instead of waiting.

## How to fix it

- Catch it with `RateLimitMaxWaitError.is(error)` from `workflow/errors` and skip, defer or report the work. `error.wouldAcquireAt` is when the call would have gone ahead (for a call that woke late, the slot it missed).
- Raise the `maxWait`, or leave it out to wait as long as it takes (up to 30 days).
- Spread the work across keys that the upstream limits separately.

---

For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md)

For an index of all available documentation, see [/llms.txt](/llms.txt)

For agent-facing discovery, including API and MCP surfaces, see [/agents.md](/agents.md)