# get_async_connection

> **Function** in `langchain_neo4j`

📖 [View in docs](https://reference.langchain.com/python/langchain-neo4j/checkpoint/_ainternal/get_async_connection)

Get an async Neo4j driver from various connection types.

Supports:
- Direct AsyncDriver instance (passed through)
- Connection string URI (creates new driver)

## Signature

```python
get_async_connection(
    conn: AsyncConn,
) -> AsyncIterator[AsyncDriver]
```

## Description

**Example:**

>>> async with get_async_connection("bolt://localhost:7687") as driver:
...     async with driver.session() as session:
...         await session.run("MATCH (n) RETURN n")

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `conn` | `AsyncConn` | Yes | Either an AsyncDriver instance or a connection string URI. |

---

[View source on GitHub](https://github.com/langchain-ai/langchain-neo4j/blob/cb87fdba5ae2f6bc5092eb76a322e27c46512846/libs/neo4j/langchain_neo4j/checkpoint/_ainternal.py#L15)