All nodes/AI/LLM

Json Parser

An extension tool for the agent: forces the LLM to respond in JSON format per a schema. Injects the schema into the system prompt and parses the response. Connects to an AI Agent via link_extension.

Json ParserT
Output

Type in the graph: json_parser

Tool

Try it

Minimal working workflow

Entry
AI Agent
Json ParserT
LLM
Buffer MemoryS
Exit
  • Execute + Data
  • Extension
  • LLM
  • Memory
  • Execute + Data + Streaming
Press “Copy nodes”, open the editor and hit Ctrl+V on the canvas.

Runs as pasted

When to use it

An extension for the AI Agent: the agent still uses its tools and memory, but its final answer arrives as an object matching your schema instead of free text. Reach for this node when the agent’s result travels on through the graph as data — into a condition, a database, an HTTP request. If no tools are needed and a single model call is enough, Structured Output LLM is the sturdier choice: there the format is enforced by the provider, here by text in the prompt.

How it works

The schema is appended to the agent’s system prompt together with an instruction to reply with a single JSON object and write nothing around it. When the agent’s turn is over, its answer is parsed, and the agent node’s output becomes an object: {{ nodes.<agent id>.output.<field> }}.

The schema can be authored two ways — the “Schema Mode” switch: a field builder or raw JSON Schema. The default schema has one string field, result, so a freshly dropped node works right away; replace it with your own shape.

The node produces no value of its own: it has a single output, and that output goes into the agent’s Extensions port. On the canvas it sits beside the agent, not in the execution chain.

The chat, meanwhile, shows what the model typed, braces and all: tokens are streamed as they are generated, that is, before parsing. Only the nodes further along the graph see the finished object.

Common mistakes

  • Treating the schema as a guarantee. It is a request inside the prompt, not a provider mode. Parsing is best-effort: if no object can be extracted, the agent returns the original string and there is no error. When the format really matters, check the result in the next step, or use Structured Output LLM.
  • A string came back instead of an object. The usual cause is nested objects in an answer that is not wrapped in a code block: such text cannot be parsed. Asking the agent, in its system prompt, to format the reply as a json code block helps.
  • An empty schema. With an empty schema the node does nothing: the prompt is unchanged, the reply is not parsed, and the agent’s output stays ordinary text.
  • Fields without descriptions. The model reads the schema as an instruction, so a precise description on a field often does more than a whole paragraph in the system prompt.

Inputs

Outputs

PortWirePayloadNotes
OutputoutputExtensionlink_extension

Configuration

FieldTypeDefaultDescription
Schema Modeschema_modestringbuilder

How the output schema is authored: field builder or raw JSON Schema.

Options: builder — Fields Builder, json — Raw JSON Schema

Output Schemastructured_outputobject{"type":"object","properties":{"result":{"type":"string","description":"The m…

JSON Schema injected into the agent's system prompt and used to parse its reply. An empty schema makes this node a no-op.