# get_session_key

> **Function** in `langchain_aws`

📖 [View in docs](https://reference.langchain.com/python/langchain-aws/tools/utils/get_session_key)

Build a session key from RunnableConfig.

Uses thread_id as the base key and appends checkpoint_ns
when present.  This ensures parallel LangGraph subgraphs get
separate sessions even when they share a thread_id.

Examples::

    Top-level agent:   "thread-001"
    Subagent A:        "thread-001:research-acme:abc123"
    Subagent B:        "thread-001:research-beta:def456"

## Signature

```python
get_session_key(
    config: Optional[RunnableConfig] = None,
) -> str
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `config` | `Optional[RunnableConfig]` | No | LangGraph ``RunnableConfig`` passed to tool invocations. (default: `None`) |

## Returns

`str`

String key for indexing session dictionaries.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-aws/blob/ea22fe3d744a3248b0b74ed555e9c34844b35a54/libs/aws/langchain_aws/tools/utils.py#L57)