LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    โŒ˜I

    Chat LangChain

    What can I help with?

    Enter to sendยทShift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-corerunnablesbaseRunnablemap
    Methodโ—Since v1.8

    map

    Copy
    map(
        self,
    ) -> Runnable[Sequence[Input], list[Output]
    View source on GitHub
    ]

    Return a new Runnable that maps a list of inputs to a list of outputs.

    Calls invoke with each input.

    Example:

    from langchain_core.runnables import RunnableLambda
    
    def _lambda(x: int) -> int:
        return x + 1
    
    runnable = RunnableLambda(_lambda)
    print(runnable.map().invoke([1, 2, 3]))  # [2, 3, 4]