LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Graphs
  • Functional API
  • Pregel
  • Checkpointing
  • Storage
  • Caching
  • Types
  • Runtime
  • Config
  • Errors
  • Constants
  • Channels
  • Agents
LangGraph CLI
LangGraph SDK
LangGraph Supervisor
LangGraph Swarm
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewGraphsFunctional APIPregelCheckpointingStorageCachingTypesRuntimeConfigErrorsConstantsChannelsAgents
LangGraph CLI
LangGraph SDK
LangGraph Supervisor
LangGraph Swarm
Language
Theme
Pythonlanggraphpregeldebugmap_task_result_writes
Function●Since v0.6

map_task_result_writes

Folds task writes into a result dict and aggregates multiple writes to the same channel.

If the channel contains a single write, we record the write in the result dict as {channel: write} If the channel contains multiple writes, we record the writes in the result dict as {channel: {'$writes': [write1, write2, ...]}}

Copy
map_task_result_writes(
    writes: Sequence[tuple[str, Any]],
) -> dict[str, Any]
View source on GitHub