LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Graphs
    • Functional API
    • Pregel
    • Checkpointing
    • Storage
    • Caching
    • Types
    • Runtime
    • Config
    • Errors
    • Constants
    • Channels
    • Agents
    LangGraph Checkpoint
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    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 Checkpoint
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    PythonlanggraphstreamtransformersTasksTransformer
    Class●Since v1.1

    TasksTransformer

    Copy
    TasksTransformer(
        self,
        scope: tuple[str, ...] = (),
    )

    Bases

    StreamTransformer

    Constructors

    Attributes

    Methods

    Inherited fromStreamTransformer

    Attributes

    Arequires_async: boolAsupports_sync: boolAscope: tuple[str, ...]

    Methods

    Maprocess
    —

    Handle an event on the async lane.

    View source on GitHub
    Mfinalize
    —

    Called when the run ends normally (sync lane).

    Mafinalize
    —

    Called when the run ends normally (async lane).

    Mfail
    —

    Called when the run ends with an error (sync lane).

    Mafail
    —

    Called when the run ends with an error (async lane).

    Mschedule
    —

    Schedule a coroutine tied to this transformer's lifecycle.

    constructor
    __init__
    NameType
    scopetuple[str, ...]
    attribute
    required_stream_modes
    method
    init
    method
    process

    Capture raw task events as a drainable stream.

    Surfaces stream_mode="tasks" data on run.tasks as a StreamChannel[dict[str, Any]]. Each item is a task payload (start or result).

    LifecycleTransformer and SubgraphTransformer also consume tasks events for subgraph discovery and lifecycle tracking. This transformer captures the raw payloads independently for consumers who need task-level detail.

    Only events at the run's own scope are captured; task data from deeper subgraphs is available on the respective subgraph handle's .tasks projection.

    Native transformer — run.tasks is a direct attribute.