Reference · Tools

Response Parser

Extract structured data from AI responses — parse JSON, extract code blocks, split sections.

Action AI v1

Response Parser turns AI response text into structured data, with five extractors: JSON including markdown-fence detection, code blocks with language filtering, key-value pairs, markdown section splitting, and CSV. It makes no API calls. A typical build is placing it after an LLM node so downstream steps get clean data instead of prose.

Node type
Action
Parameters
5
Outputs
Output, Error
Credentials
None required

Response Parser

Extract structured data from AI responses — parse JSON, extract code blocks, split sections.

Overview

Parses AI model response text into structured data using multiple format extractors: JSON (with markdown fence detection), code block extraction (with optional language filter), key-value pair parsing, markdown section splitting, and CSV parsing. Pure local computation — no API calls. Each input item produces one parsed result stored in a configurable output field (default: “parsed”) along with the format used.

Category: AI
Tool Name: response_parser
Version: 1

Appearance: Icon: brain | Color: #6366f1

Node Type

Action — processes input items and produces output

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool does not require any credentials.

Parameters

ParameterTypeRequiredDefaultDescription
InputstringYesThe AI response text to parse. Falls back to item.response or item.text if empty. Supports expressions.
FormatoptionsNojsonThe parsing format to use for extracting structured data from the response.
Options: json (extract and parse JSON, handling markdown fences and embedded objects/arrays), codeBlock (extract code blocks from markdown fences, optionally filtered by language), keyValue (parse lines in “key: value” format into an object), sections (split text by markdown headers, # to ######, into named sections), csv (parse CSV text into an array of objects using the first row as headers)
OptionscollectionNo{}Optional output and format-specific settings.
— Response Field NamestringNoparsedThe output field name where the parsed result will be stored.
— Code LanguagestringNoFor Code Block format: only extract blocks tagged with this language. Leave empty to extract all code blocks.
— DelimiterstringNo,For CSV format: the column delimiter character.
Include InputbooleanNofalseWhether to include the original input item fields in the output alongside the parsed result.
Max ConcurrencynumberNo50Maximum number of items to process concurrently. Higher values are safe since this is pure text parsing.

Output Data

One output item per input item. The parsed result is written to the field named by Response Field Name (parsed by default), alongside format, which echoes the extractor that produced it. With Include Input off — the default — those two fields are the entire output item; turn it on to merge the original item fields underneath. Binary data is forwarded either way.

{
  "parsed": { "title": "Quarterly Review", "score": 8 },
  "format": "json"
}

The shape of the parsed value depends on the format:

FormatValue written to the response field
jsonThe parsed JSON value — object or array. When nothing parses, an object with _raw (the original text) and _parseError (the parser message) instead.
codeBlockThe code as a single string when exactly one block matched; otherwise an array of strings, empty when no block matched.
keyValueAn object built from the key: value lines found in the text. Lines that do not match are ignored.
sectionsAn object keyed by header text, e.g. parsed["Summary"]. Text appearing before the first header is kept under _intro.
csvAn array of objects, one per row after the first, keyed by the first row’s column names.

Reference the result downstream by expression, e.g. {{ $json.parsed.title }}.

Usage Examples

  • Extract JSON from a Claude response wrapped in markdown fences
  • Pull Python code blocks from a GPT coding response
  • Parse key-value metadata from a structured AI output
  • Split a long AI response into sections by markdown headers
  • Convert CSV data in an AI response into an array of objects

Example Configuration

Extract JSON from an LLM response, minimal config. input is empty, so the node falls back to item.response or item.text:

{
  "type": "response_parser",
  "parameters": {
    "input": "",
    "format": "json"
  }
}

Extract a Python code block and store it in a custom field:

{
  "type": "response_parser",
  "parameters": {
    "input": "",
    "format": "codeBlock",
    "includeInput": true,
    "options": {
      "responseFieldName": "generatedCode",
      "codeLanguage": "python"
    }
  }
}

Parse key-value output with the original fields preserved:

{
  "type": "response_parser",
  "parameters": {
    "input": "",
    "format": "keyValue",
    "includeInput": true,
    "options": {
      "responseFieldName": "metadata"
    }
  }
}

Split a long LLM response into named sections:

{
  "type": "response_parser",
  "parameters": {
    "input": "",
    "format": "sections",
    "options": {
      "responseFieldName": "documentSections"
    }
  }
}

Parse CSV output from an LLM with a tab delimiter:

{
  "type": "response_parser",
  "parameters": {
    "input": "",
    "format": "csv",
    "maxConcurrency": 20,
    "options": {
      "responseFieldName": "rows",
      "delimiter": "\t"
    }
  }
}

Explicit input field, high-concurrency batch processing:

{
  "type": "response_parser",
  "parameters": {
    "input": "{{ $json.llmOutput }}",
    "format": "json",
    "includeInput": false,
    "maxConcurrency": 100,
    "options": {
      "responseFieldName": "parsed"
    }
  }
}

LLM to parsed JSON to structured fields — a common pipeline where an upstream node generates a JSON object and this node converts it to usable fields. Downstream nodes then read item.parsed.fieldName:

{
  "type": "response_parser",
  "parameters": {
    "input": "",
    "format": "json",
    "includeInput": false,
    "options": {
      "responseFieldName": "parsed"
    }
  }
}

Extract only TypeScript code blocks from a code-generation response. includeInput: true preserves upstream fields, such as the original prompt, alongside item.tsCode:

{
  "type": "response_parser",
  "parameters": {
    "input": "",
    "format": "codeBlock",
    "includeInput": true,
    "options": {
      "responseFieldName": "tsCode",
      "codeLanguage": "typescript"
    }
  }
}

Parse a structured report into sections for routing. The output item.sections is an object keyed by header text, e.g. item.sections["Summary"] and item.sections["Recommendations"]:

{
  "type": "response_parser",
  "parameters": {
    "input": "",
    "format": "sections",
    "includeInput": false,
    "options": {
      "responseFieldName": "sections"
    }
  }
}

Batch-process many items at high concurrency. Because this is pure text processing with no I/O, maxConcurrency can safely be set high:

{
  "type": "response_parser",
  "parameters": {
    "input": "",
    "format": "keyValue",
    "maxConcurrency": 100,
    "options": {
      "responseFieldName": "kvData"
    }
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Response Parser transforms AI response text into structured data using five format extractors: JSON with markdown fence detection, code block extraction with language filtering, key-value pairs, markdown section splitting, and CSV. Use it after LLM nodes when downstream steps need clean structured data rather than raw text, with no API calls required. Each input item outputs one result with parsed content in a configurable field and a format field naming the extractor used.

Which options apply to which format

  • responseFieldName applies to every format.
  • codeLanguage is only read by the codeBlock format; it is ignored everywhere else.
  • delimiter is only read by the csv format; it is ignored everywhere else.
  • All three live inside options — never at the top level of the node’s parameters.

Frequently asked questions

Does it handle JSON wrapped in markdown fences?

Yes — fence detection is built in, which matters because models frequently wrap JSON in a code fence even when asked not to.

What does it output?

One result per input item with the parsed content in a configurable field, plus a format field naming which extractor produced it.

Can it pull out only code in a particular language?

Yes — code block extraction supports language filtering, so you can take just the SQL or just the Python from a mixed response.

When would I use this over structured output?

When you cannot constrain the model's response — for example with a model or node that has no schema enforcement. If schema enforcement is available, prefer it and skip the parsing.

Build with the Response Parser node

Drop it into a workflow, wire it to an agent, or call it on a schedule.

Open BusyBot

Last updated . Spotted something wrong? Tell us.