Either an EntrypointOptions object, or a string for the name of the entrypoint
The function that executes this entrypoint
A Pregel instance that can be run to execute the workflow
A helper utility for use with the functional API that returns a value to the caller, as well as a separate state value to persist to the checkpoint. This allows workflows to maintain state between runs while returning different values to the caller.
An object with the value and save properties
Define a LangGraph workflow using the
entrypoint
function.Function signature
The wrapped function must accept at most two parameters. The first parameter is the input to the function. The second (optional) parameter is a LangGraphRunnableConfig object. If you wish to pass multiple parameters to the function, you can pass them as an object.
Helper functions
Streaming
To write data to the "custom" stream, use the getWriter function, or the LangGraphRunnableConfig.writer property.
State management
The getPreviousState function can be used to access the previous state that was returned from the last invocation of the entrypoint on the same thread id.
If you wish to save state other than the return value, you can use the entrypoint.final function.
Example: Using entrypoint and tasks
Example: Accessing the previous return value
Example: Using entrypoint.final to save a value