๐Ÿ”ฌ Parse files and URLs into structured JSON with Groq and Google Gemini

โšก 2 views ยท ๐Ÿ”ฌ Document Extraction & Analysis

Description

Quick overview

This sub-workflow accepts files or a URL from a parent workflow, extracts readable text from many formats, optionally converts that text into structured JSON using Groq and Google Gemini models, and returns one normalized result per input.

How it works

  1. Triggers when executed by another n8n workflow and receives binary attachments and an optional extraction object that can define required fields.
  2. Splits incoming attachments into one item per file (or converts a provided URL into a fetchable text source) and builds a JSON Schema from extraction.field_schemas.
  3. Routes each item by MIME type and extracts content using native n8n extractors (PDF, JSON, CSV, Excel, Google Sheets and text) or fetches web pages as text via an HTTP request.
  4. For image files, converts the image to a compatible format and uses a vision-capable LLM to extract visible information into JSON and add content_class and class_confidence.
  5. If a schema was provided, sends the extracted text to an LLM to produce structured JSON that matches the requested schema.
  6. Returns { status, error, data: { text, content_class, class_confidence } } for every input. File types it has no route for come back with a standardized unsupported status and an error payload, so the parent workflow keeps running.

Setup

  1. Add a credential for a vision-capable LLM to the Vision LLM node, which extracts structured data from images.
  2. Add a credential for an LLM to the Text LLM node, which structures extracted text into schema-compliant JSON. A free tier is enough, and any chat model node works in either place.
  3. From the parent workflow, use an Execute Workflow node to call this workflow and pass either binary_files (attachments) or a url, plus optional extraction.field_schemas and instructions for the fields you want returned.

Requirements

Customization

Additional info

Node-by-node documentation ยท Used by smart-folder2table and inbox-attachment-organizer

๐Ÿ”— Nodes Used

Edit Image, HTTP Request, Google Drive, Execute Workflow Trigger, Basic LLM Chain, Structured Output Parser

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup