# writes_sort_key

> **Function** in `langgraph.checkpoint`

📖 [View in docs](https://reference.langchain.com/python/langgraph.checkpoint/base/writes_sort_key)

Sort key for the writes of one super-step.

Live execution applies a super-step's tasks in this order, so a saver
that replays stored writes, as `get_delta_channel_history` does, must
sort them by it too, or an order-sensitive reducer rebuilds a different
value than the run produced. `task_path` is the string passed to
`put_writes`.

## Signature

```python
writes_sort_key(
    task_path: str,
    task_id: str = '',
    idx: int = 0,
) -> tuple[str, str, int]
```

---

[View source on GitHub](https://github.com/langchain-ai/langgraph/blob/3521f08e21a7d89c28331191374bc85c11ecb6e2/libs/checkpoint/langgraph/checkpoint/base/__init__.py#L185)