<!-- BusyBot node reference — https://busybot.net/tools/response-parser/ -->

> Node: Response Parser (`response_parser`) · Action · v1
> Category: AI · Credentials: none
> Updated: 2026-08-16

# 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

| Direction | Port(s) |
|-----------|--------|
| Input | `Input` |
| Output | `Output`, `Error` |

## Credentials

This tool does not require any credentials.

### Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Input | `string` | Yes | — | The AI response text to parse. Falls back to item.response or item.text if empty. Supports expressions. |
| Format | `options` | No | `json` | The 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) |
| Options | `collection` | No | `{}` | Optional output and format-specific settings. |
| — Response Field Name | `string` | No | `parsed` | The output field name where the parsed result will be stored. |
| — Code Language | `string` | No | — | For Code Block format: only extract blocks tagged with this language. Leave empty to extract all code blocks. |
| — Delimiter | `string` | No | `,` | For CSV format: the column delimiter character. |
| Include Input | `boolean` | No | `false` | Whether to include the original input item fields in the output alongside the parsed result. |
| Max Concurrency | `number` | No | `50` | Maximum 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.

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

The shape of the parsed value depends on the format:

| Format | Value written to the response field |
|--------|-------------------------------------|
| `json` | The parsed JSON value — object or array. When nothing parses, an object with `_raw` (the original text) and `_parseError` (the parser message) instead. |
| `codeBlock` | The code as a single string when exactly one block matched; otherwise an array of strings, empty when no block matched. |
| `keyValue` | An object built from the `key: value` lines found in the text. Lines that do not match are ignored. |
| `sections` | An object keyed by header text, e.g. `parsed["Summary"]`. Text appearing before the first header is kept under `_intro`. |
| `csv` | An 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`:

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

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

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

Parse key-value output with the original fields preserved:

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

Split a long LLM response into named sections:

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

Parse CSV output from an LLM with a tab delimiter:

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

Explicit input field, high-concurrency batch processing:

```json
{
  "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`:

```json
{
  "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`:

```json
{
  "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"]`:

```json
{
  "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:

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

### Error Handling

| Mode | Behavior |
|------|----------|
| **stop** | Halts workflow on first error |
| **continue** | Skips failed items, passes successful ones through |
| **errorPort** | Routes 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.