# capture_turn

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/turn_trace/capture_turn)

Return current-turn roots, or `None` when no scoped trace is active.

## Signature

```python
capture_turn(
    config: RunnableConfig,
) -> TurnTrace | None
```

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/efa9f5364b83e9367ea57d9c21b15b4d81fdcb7a/libs/code/deepagents_code/turn_trace.py#L110)