n8n-nodes-json-extract
v1.1.0
Published
n8n node to extract and parse JSON from AI-generated text
Downloads
431
Maintainers
Readme
n8n-nodes-json-extract
AI生成テキストから JSON を自動抽出・パースする n8n カスタムノード。完全自動、設定不要。
n8n node to extract and parse JSON from AI-generated text. Fully automatic, zero configuration.
Installation
npm install n8n-nodes-json-extractFeatures
- Automatic pattern detection - Tries multiple extraction patterns and stops at first success:
- Markdown code blocks: ```json ... ```
- JSON objects:
{ ... } - JSON arrays:
[ ... ]
- Dual outputs - Success/Fail branches for explicit error handling
- Fixed output format - Consistent structure across all results
- Object input support - Pass through already-parsed JSON objects
- Zero configuration - Only one parameter: Text
- Duplicate removal - Automatically removes duplicate JSON objects
Output Format
All outputs (Success and Fail) use the same structure:
Success output (Output 1):
{
"source": "AI response: Here is the user data: {\"name\":\"太郎\",\"age\":30}",
"isSuccess": true,
"errorMessage": null,
"jsons": [
{ "name": "太郎", "age": 30 }
],
"count": 1,
"first_json": { "name": "太郎", "age": 30 },
"last_json": { "name": "太郎", "age": 30 },
"largest_json": { "name": "太郎", "age": 30 }
}isSuccess: trueerrorMessage: nulljsons: Array of extracted JSON objects/arrayscount: Number of extracted JSONsfirst_json: First extracted JSON (or null if none)last_json: Last extracted JSON (or null if none)largest_json: Largest JSON by string size (or null if none)
Fail output (Output 2):
{
"source": "No JSON found in this text",
"isSuccess": false,
"errorMessage": "No valid JSON found in text",
"jsons": [],
"count": 0,
"first_json": null,
"last_json": null,
"largest_json": null
}isSuccess: falseerrorMessage: Error descriptionjsons: []count: 0- All extra fields are
null
Usage
- Add the "JSON Extract" node to your workflow
- Connect text input from AI agents (Claude, ChatGPT, Gemini, etc.)
- Enter text or use expressions like
{{ $json.output }} - Connect Success/Fail outputs to different branches
Example workflow:
AI Agent → JSON Extract → [Success] → Process Data
→ [Fail] → Error HandlerUse Cases
- Extract JSON from AI chat responses
- Parse structured data from unstructured text
- Handle AI output with mixed text and JSON
- Extract multiple JSON objects from single response
Version History
- v1.1.0 - Added convenience fields: count, first_json, last_json, largest_json
- v1.0.0 - Automatic pattern detection, zero configuration
- v0.6.0 - Removed Extraction Mode parameter
- v0.5.0 - Fixed output format
- v0.4.0 - Removed On Parse Error parameter
- v0.3.0 - Added Success/Fail dual outputs
- v0.2.0 - Changed to direct text input
License
MIT
