> ## Documentation Index
> Fetch the complete documentation index at: https://docs.asteroid.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Live limit reached

> The 429 problem type returned when your organization is at a live limit, such as concurrent executions or environments.

Your organization is at one of its live limits, so the request was refused. Nothing was created. The limit frees as soon as one of your running resources ends.

```
https://docs.asteroid.ai/errors/limit-reached
```

This URL is the `type` of the error. Match on `type`, not on `message`. The message text can change.

## When you get it

| Request | `capability` |
| - | - |
| Start an execution | `concurrent_executions` |
| Start an environment | `concurrent_environments` |

A resource counts while it runs. It stops counting when it ends, or when it passes its deadline:

* An execution counts until its workflow timeout, plus 5 minutes.
* An environment counts until its expiry time.

## Response

The status is `429 Too Many Requests`. The body follows [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457).

```json theme={null}
{
  "type": "https://docs.asteroid.ai/errors/limit-reached",
  "title": "Live limit reached",
  "status": 429,
  "detail": "Your organisation is at its limit of 5. Retry once one ends",
  "instance": "/agents/v2/workflows/0b6e.../execute",
  "capability": "concurrent_executions",
  "used": 5,
  "limit": 5,
  "code": 429,
  "message": "Your organisation is at its limit of 5. Retry once one ends"
}
```

<ResponseField name="type" type="string" required>
  Always `https://docs.asteroid.ai/errors/limit-reached` for this problem.
</ResponseField>

<ResponseField name="title" type="string" required>
  `Live limit reached`.
</ResponseField>

<ResponseField name="status" type="integer" required>
  `429`.
</ResponseField>

<ResponseField name="detail" type="string" required>
  A sentence you can show to a person.
</ResponseField>

<ResponseField name="instance" type="string">
  The request path that was refused.
</ResponseField>

<ResponseField name="capability" type="string" required>
  The limit you reached. See [When you get it](#when-you-get-it).
</ResponseField>

<ResponseField name="used" type="integer" required>
  Resources of this kind running when the request arrived.
</ResponseField>

<ResponseField name="limit" type="integer" required>
  Your organization's limit for `capability`.
</ResponseField>

<ResponseField name="code" type="integer">
  The same as `status`. Kept for older clients.
</ResponseField>

<ResponseField name="message" type="string">
  The same text as `detail`. Kept for older clients.
</ResponseField>

## Handle it

<Steps>
  <Step title="Queue the execution instead">
    For executions, send `"onCapacityLimit": "queue"`. The execution waits as `queued` and starts by itself, oldest first, when a slot frees. You never see this error. See [Queue when capacity is full](/integrate/call-a-workflow#queue-when-capacity-is-full).
  </Step>

  <Step title="Or retry later">
    Wait for a running execution or environment to end, then send the request again. Back off between attempts.
  </Step>

  <Step title="Raise the limit if you hit it often">
    Limits come from your plan. Contact [support](/support-security/support) to change them.
  </Step>
</Steps>

<CodeGroup>
  ```ts TypeScript theme={null}
  const LIMIT_REACHED = 'https://docs.asteroid.ai/errors/limit-reached';

  type LimitReached = { type: string; capability: string; used: number; limit: number };

  const { data, error, response } = await workflowExecutePost({
    path: { workflowId },
    body: { inputs },
  });

  if (response.status === 429 && error?.type === LIMIT_REACHED) {
    // capability, used and limit say which limit is full.
    const problem = error as unknown as LimitReached;
    console.log(`${problem.capability}: ${problem.used} of ${problem.limit} in use`);
  }
  ```

  ```python Python theme={null}
  import json

  from asteroid_odyssey.exceptions import ApiException

  LIMIT_REACHED = "https://docs.asteroid.ai/errors/limit-reached"

  try:
      workflows_api.workflow_execute_post(
          workflow_id=workflow_id,
          workflows_workflow_execute_request=request,
      )
  except ApiException as e:
      problem = json.loads(e.body or "{}")
      if e.status == 429 and problem.get("type") == LIMIT_REACHED:
          # problem["capability"], problem["used"] and problem["limit"] say which limit is full.
          print(f'{problem["capability"]}: {problem["used"]} of {problem["limit"]} in use')
      else:
          raise
  ```
</CodeGroup>

## Related errors

| Response | Meaning |
| - | - |
| `403` with `capability_required` | Your plan has a limit of `0` for this resource. Retrying does not help. |
| `429` with any other `type` | Too many requests arrived at once to check the limit, or the execution queue is full. Retry after a short wait. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.