node_data_json#

langchain_core.runnables.graph.node_data_json(node: Node, *, with_schemas: bool = False) dict[str, str | dict[str, Any]][source]#

Convert the data of a node to a JSON-serializable format.

Parameters:
  • node (Node) – The node to convert.

  • with_schemas (bool) – Whether to include the schema of the data if it is a Pydantic model. Defaults to False.

Returns:

A dictionary with the type of the data and the data itself.

Return type:

dict[str, str | dict[str, Any]]