Skip to main content
Stream from a Functional API entrypoint in two ways. Custom data is a side channel: you push progress with a writer, then read custom chunks. Values are state snapshots the runtime records, including the entrypoint return value. You do not call a writer for values. For concepts, see the Functional API overview. For messages and other typed projections, see event streaming.

Emit custom data

The Functional API uses the same stream as the Graph API. Emit with a writer, then consume custom chunks. For stream modes, see Streaming.

View example trace

Open a public LangSmith run for this example.
  1. Take config as the second argument to the entrypoint.
  2. Emit custom data with config.writer before and after the computation.
  3. Call stream(..., { streamMode: "custom" }) and iterate the chunks.

Stream values

Reuse the main entrypoint from Emit custom data. Iterate stream.values for state snapshots. For messages and other projections, see event streaming.

See also