# gather_with_concurrency

> **Function** in `langchain_core`

📖 [View in docs](https://reference.langchain.com/python/langchain-core/runnables/utils/gather_with_concurrency)

Gather coroutines with a limit on the number of concurrent coroutines.

## Signature

```python
gather_with_concurrency(
    n: int | None,
    *coros: Coroutine[Any, Any, Any] = (),
) -> list[Any]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `n` | `int \| None` | Yes | The number of coroutines to run concurrently. |
| `*coros` | `Coroutine[Any, Any, Any]` | No | The coroutines to run. (default: `()`) |

## Returns

`list[Any]`

The results of the coroutines.

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/01d8481ae3d457ec3751cbb0331ea3a4b720fa90/libs/core/langchain_core/runnables/utils.py#L65)