{
  "nodes": [
    {
      "parameters": {
        "operation": "text",
        "options": {}
      },
      "id": "71f88351-3536-4555-82ee-49895154c8d5",
      "name": "Extract Document Text",
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [
        -768,
        768
      ],
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 2
          },
          "conditions": [
            {
              "id": "has-schema-condition",
              "leftValue": "={{ $('Modify File & Input').first().json.extraction?.field_schemas?.length > 0 }}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "a1b2c3d4-has-schema-if",
      "name": "Has Schema?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -416,
        416
      ]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.text || $json.data || (typeof $json.concatenated_data === 'string' ? $json.concatenated_data : JSON.stringify($json)) }}",
        "hasOutputParser": true,
        "messages": {
          "messageValues": [
            {
              "message": "=You are a Document Data Extractor. Given extracted text from a document, organize the information into a structured JSON object.\n\n**Output Requirements:**\n- Respond with ONLY the JSON object. No explanations or other text.\n- If no readable content exists, respond with: {}\n\n**Classification (REQUIRED):**\nAlways include these two fields:\n- content_class: \"primary_document\" (text-heavy document needing storage: invoices, receipts, contracts, letters) | \"style_element\" (logos, signatures, banners, decorative images) | \"unclassified\" (doesn't fit either)\n- class_confidence: 0.0 to 1.0 (your confidence in the classification)\n\n{{ (() => { const e = $('Input Validator').first().json.extraction || {}; let ctx = ''; if (e.type) ctx += `Document type: ${e.type}\\n`; if (e.focus_fields?.length) ctx += `Priority fields: ${e.focus_fields.join(', ')}\\n`; if (e.instructions) ctx += `Instructions: ${e.instructions}\\n`; return ctx ? '**Caller Context:**\\n' + ctx + '\\n' : ''; })() }}**Key Naming Rules:**\n1. Use `snake_case` in English\n2. Derive keys from visible labels (e.g., \"Invoice #:\" \u2192 `invoice_number`, \"Date:\" \u2192 `date`)\n3. For unlabeled data, create descriptive `snake_case` keys\n4. Prefix uncertain mappings with `uncertain_`\n5. Omit keys for missing information\u2014never invent data"
            }
          ]
        }
      },
      "id": "b2c3d4e5-text-to-structured",
      "name": "Text-to-Structured",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -336,
        640
      ],
      "typeVersion": 1.4
    },
    {
      "parameters": {
        "model": "openai/gpt-oss-120b",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "typeVersion": 1,
      "position": [
        -352,
        800
      ],
      "id": "c3d4e5f6-text-language-model",
      "name": "Groq Chat Model",
      "credentials": {
        "groqApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "={{ JSON.stringify($('Modify File & Input').first().json.output_schema) }}"
      },
      "id": "d4e5f6g7-text-output-schema",
      "name": "Text Output Schema",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -192,
        800
      ],
      "typeVersion": 1.2
    },
    {
      "parameters": {
        "operation": "pdf",
        "options": {}
      },
      "id": "6bf5eca2-8555-4ea8-b2f1-594af5563299",
      "name": "Extract PDF Text",
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [
        -736,
        416
      ]
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "options": {}
      },
      "id": "3bcc35ca-5a3d-4f1a-9669-30a65862f297",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        -544,
        912
      ]
    },
    {
      "parameters": {
        "fieldsToSummarize": {
          "values": [
            {
              "aggregation": "concatenate",
              "field": "data"
            }
          ]
        },
        "options": {}
      },
      "id": "21bdece4-27c7-4d06-979d-9e0e41c2adc6",
      "name": "Summarize",
      "type": "n8n-nodes-base.summarize",
      "typeVersion": 1,
      "position": [
        -544,
        768
      ]
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 1
                },
                "conditions": [
                  {
                    "id": "e3a4d243-5c9e-4363-aeda-4afe1afab79e",
                    "leftValue": "={{ $binary.values()[0].mimeType }}",
                    "rightValue": "image",
                    "operator": {
                      "type": "string",
                      "operation": "startsWith"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 1
                },
                "conditions": [
                  {
                    "leftValue": "={{ $binary.values()[0].mimeType }}",
                    "rightValue": "application/pdf",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "id": "59677ac7-7038-4f77-94a3-69df1b6544a2"
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 1
                },
                "conditions": [
                  {
                    "id": "d7c8331d-3ac1-43cb-9774-9f18cda2abc4",
                    "leftValue": "={{ $binary.values()[0].mimeType }}",
                    "rightValue": "application/json",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 1
                },
                "conditions": [
                  {
                    "id": "2ae7faa7-a936-4621-a680-60c512163034",
                    "leftValue": "={{ $binary.values()[0].mimeType }}",
                    "rightValue": "application/vnd.ms-excel",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 1
                },
                "conditions": [
                  {
                    "id": "fc193b06-363b-4699-a97d-e5a850138b0e",
                    "leftValue": "={{ $binary.values()[0].mimeType }}",
                    "rightValue": "=application/vnd.google-apps.spreadsheet",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 1
                },
                "conditions": [
                  {
                    "id": "b69f5605-0179-4b02-9a32-e34bb085f82d",
                    "leftValue": "={{ $binary.values()[0].mimeType }}",
                    "rightValue": "application/vnd.google-apps.document",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 1
                },
                "conditions": [
                  {
                    "id": "f30330d4-a83c-4e9e-9a0b-7de8a1767dc2",
                    "leftValue": "={{ $binary.data.mimeType }}",
                    "rightValue": "text/csv",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 1
                },
                "conditions": [
                  {
                    "id": "url-route-condition",
                    "leftValue": "={{ $binary.data.mimeType }}",
                    "rightValue": "text/x-url",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "id": "aa494995-2e49-4f04-a519-e7f56eb34171",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3,
      "position": [
        -992,
        400
      ]
    },
    {
      "parameters": {
        "operation": "xlsx",
        "options": {}
      },
      "id": "2d60a23a-1abc-4e7b-8ed8-8da1593cfacf",
      "name": "Extract from Excel",
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [
        -768,
        1056
      ]
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [
        -768,
        912
      ],
      "id": "13d15b17-7094-43b5-a3a6-c3bfa3ec2fb1",
      "name": "Extract from CSV"
    },
    {
      "parameters": {
        "inputSource": "jsonExample",
        "jsonExample": "{\n  \"binary_files\": {\n    \"attachment_0\": {\"mimeType\": \"...\", \"data\": \"...\", \"fileName\": \"...\"}\n  },\n  \"extraction\": {\n    \"type\": \"document_analysis\",\n    \"focus_fields\": [\"vendor_name\", \"invoice_number\"],\n    \"instructions\": \"Extract priority fields with these exact key names\"\n  }\n}"
      },
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1.1,
      "position": [
        -1456,
        400
      ],
      "id": "348208e4-d9e9-492d-be7a-f388bf8ab45d",
      "name": "When Executed by Another Workflow"
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": {
          "__rl": true,
          "value": "https://drive.google.com/file/d/1V4ZuvFi_c1X7jn6fGmRlZ6q_5CYTQ9G7/view?usp=drive_link",
          "mode": "url"
        },
        "options": {}
      },
      "id": "cb19ad57-5345-4bb1-8ba4-fb56ba5632c4",
      "name": "Download File1",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        -1456,
        608
      ],
      "executeOnce": true,
      "disabled": true
    },
    {
      "parameters": {
        "content": "## Any\u2011file to JSON converter\n\n### How it works\n1. Another workflow triggers this sub\u2011workflow and sends binary files and an optional `extraction` object.\n2. The Input Validator defaults `extraction`, then a code node flattens each attachment into its own item.\n3. A Switch node examines the MIME type of each file and routes it:\n   - Images \u2192 editImage \u2192 Gemini OCR prompt \u2192 structured JSON.\n   - PDFs \u2192 PDF text extractor.\n   - JSON files \u2192 direct JSON extraction.\n   - CSV/Excel \u2192 text extraction, aggregation, and summarization.\n4. Each branch normalises the extracted text, runs an optional LLM summarizer, and returns a JSON object with `content_class` and `class_confidence`.\n5. Unsupported types are caught by the Unresolved Handler and marked for manual review.\n\n### Setup\n- [ ] Connect a Google Gemini (PaLM) credential for the image\u2011to\u2011text model.\n- [ ] Ensure the calling workflow sends binary files with proper MIME types.\n- [ ] Verify the Output Schema node matches your desired JSON fields.\n- [ ] Test each file type (image, PDF, JSON, CSV, Excel) to confirm routing.\n- [ ] Adjust the Switch rules if you need to support additional MIME types.\n- [ ] Deploy the workflow and reference its ID in the parent workflow.",
        "height": 796,
        "width": 460
      },
      "id": "f3f9259a-b29f-4ad5-874a-ff91c74d795d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2112,
        368
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "Extract all data from this document.",
        "hasOutputParser": true,
        "messages": {
          "messageValues": [
            {
              "message": "=You are a Document Data Extractor. Given a document image, extract all visible information into a structured JSON object.\n\n**Output Requirements:**\n- Respond with ONLY the JSON object. No explanations or other text.\n- If no readable content exists, respond with: {}\n\n**Classification (REQUIRED):**\nAlways include these two fields:\n- content_class: \"primary_document\" (text-heavy document needing storage: invoices, receipts, contracts, letters) | \"style_element\" (logos, signatures, banners, decorative images) | \"unclassified\" (doesn't fit either)\n- class_confidence: 0.0 to 1.0 (your confidence in the classification)\n\n{{ (() => { const e = $('Input Validator').first().json.extraction || {}; let ctx = ''; if (e.type) ctx += `Document type: ${e.type}\\n`; if (e.focus_fields?.length) ctx += `Priority fields: ${e.focus_fields.join(', ')}\\n`; if (e.instructions) ctx += `Instructions: ${e.instructions}\\n`; return ctx ? '**Caller Context:**\\n' + ctx + '\\n' : ''; })() }}**Key Naming Rules:**\n1. Use `snake_case` in English\n2. Derive keys from visible labels (e.g., \"Invoice #:\" \u2192 `invoice_number`, \"Date:\" \u2192 `date`)\n3. For unlabeled data, create descriptive `snake_case` keys\n4. Prefix uncertain mappings with `uncertain_`\n5. Omit keys for missing information\u2014never invent data"
            },
            {
              "type": "HumanMessagePromptTemplate",
              "messageType": "imageBinary"
            }
          ]
        }
      },
      "id": "94b72956-776f-4410-8a9c-1b494eed1c67",
      "name": "Image-to-text",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -688,
        80
      ],
      "typeVersion": 1.4
    },
    {
      "parameters": {
        "borderWidth": 1,
        "borderHeight": 1,
        "options": {
          "fileName": "data"
        }
      },
      "id": "52e8cb62-4f10-46a7-9736-d1f66109b0d2",
      "name": "conversion",
      "type": "n8n-nodes-base.editImage",
      "position": [
        -832,
        80
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "jsCode": "const items = $input.all();\nconst extraction = items[0]?.json?.extraction || {};\nconst fieldSchemas = extraction.field_schemas || [];\n\nconst schema = {\n  type: 'object',\n  properties: {\n    content_class: { type: 'string', enum: ['primary_document', 'style_element', 'unclassified'] },\n    class_confidence: { type: 'number' }\n  },\n  required: ['content_class', 'class_confidence'],\n  additionalProperties: true\n};\n\nfor (const field of fieldSchemas) {\n  const prop = {};\n  if (field.type === 'int') prop.type = 'number';\n  else if (field.type === 'list') { prop.type = 'array'; prop.items = { type: 'string' }; }\n  else if (field.type === 'class' && field.classes) { prop.type = 'string'; prop.enum = field.classes.split(',').map(c => c.trim()); }\n  else prop.type = 'string';\n  schema.properties[field.name] = prop;\n  schema.required.push(field.name);\n}\n\nreturn items.flatMap(item => {\n  const url = item.json.url || item.json.source_url || null;\n  const isUrl = url && /^https?:\\/\\/.+/.test(url) && !item.binary;\n  if (isUrl) {\n    return [{ json: { ...item.json, output_schema: schema, _inputType: 'url', _jinaUrl: 'https://r.jina.ai/' + url }, binary: { data: { mimeType: 'text/x-url', data: '', fileName: url } } }];\n  }\n  return item.binary ? Object.keys(item.binary).map(key => ({ json: { ...item.json, output_schema: schema }, binary: { data: item.binary[key] } })) : [{ json: { ...item.json, output_schema: schema } }];\n});"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -1136,
        400
      ],
      "id": "29d01b4b-ec16-496e-9b9f-d551ae815bff",
      "name": "Modify File & Input"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "input-validator-extraction",
              "name": "extraction",
              "value": "={{ $json.extraction || {} }}",
              "type": "object"
            }
          ]
        },
        "includeOtherFields": true,
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -1296,
        400
      ],
      "id": "d444e35f-ccad-417d-a758-4649749c7fc9",
      "name": "Input Validator",
      "notes": "Pin test data here. See Testing sticky note for examples."
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -1616,
        608
      ],
      "id": "51196187-9710-4710-a4d2-938a24171d35",
      "name": "Testing n8n sub-workflow",
      "disabled": true
    },
    {
      "parameters": {
        "content": "\n\n\n\nThis node requires an LLM API which accpets images. Google works nicely, leave this model if possible.",
        "height": 96,
        "width": 400
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -832,
        288
      ],
      "id": "bab52de7-f2e4-4a6d-92cf-eac15d094a58",
      "name": "Sticky Note15"
    },
    {
      "parameters": {
        "content": "## Any-file2json converter\n# \u00b7 Image Understanding\nOCR, captioning, object detection, and structured extraction\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n```\n```\n# \u00b7 pdf\n\n\n\n\n\n```\n```\n# \u00b7 json\n\n\n```\n```\n# \u00b7 csv / excel / etc.\n\n\n\n\n\n",
        "height": 1384,
        "width": 432,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -848,
        -16
      ],
      "id": "f3ce7b26-f00a-402a-8ae0-9a00c77dfcb8",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "**Optional:** LLM confidence scoring via `class_confidence` field. See `docs/observability-through-llm-confidence-estimate.md`",
        "height": 80,
        "width": 300
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -336,
        336
      ],
      "id": "b0c8696a-178c-4d7c-b0be-0c15b9e81a9d",
      "name": "Confidence Note"
    },
    {
      "parameters": {
        "operation": "fromJson",
        "binaryPropertyName": "=data",
        "destinationKey": "data.unpacked",
        "options": {}
      },
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [
        -736,
        576
      ],
      "id": "95d8a1ac-ede3-4c64-b6c6-cf2534192287",
      "name": "Extract from JSON",
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "={{ JSON.stringify($('Modify File & Input').first().json.output_schema) }}"
      },
      "id": "eb1fbc57-1ab1-4776-934d-5a7a3124ee0c",
      "name": "Output Schema",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -592,
        208
      ],
      "typeVersion": 1.2
    },
    {
      "parameters": {
        "modelName": "models/gemini-3-flash-preview",
        "options": {}
      },
      "id": "e23fb0ad-c743-4e0a-9cf4-fba0736730a7",
      "name": "image-language-model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -752,
        208
      ],
      "typeVersion": 1,
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "uh-status",
              "name": "status",
              "value": "unresolved",
              "type": "string"
            },
            {
              "id": "uh-error-code",
              "name": "error_code",
              "value": "UNSUPPORTED_MIME_TYPE",
              "type": "string"
            },
            {
              "id": "uh-mime-type",
              "name": "mimeType",
              "value": "={{ $binary.data?.mimeType || 'unknown' }}",
              "type": "string"
            },
            {
              "id": "uh-file-name",
              "name": "fileName",
              "value": "={{ $binary.data?.fileName || 'unknown' }}",
              "type": "string"
            },
            {
              "id": "uh-file-size",
              "name": "fileSize",
              "value": "={{ $binary.data?.fileSize || 'unknown' }}",
              "type": "string"
            },
            {
              "id": "uh-original-item",
              "name": "originalItem",
              "value": "={{ $json }}",
              "type": "object"
            },
            {
              "id": "uh-resolver-hint",
              "name": "resolver_hint",
              "value": "Unsupported file type. Route to resolver workflow for AI interpretation or human review.",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -992,
        784
      ],
      "id": "49859284-724f-4d50-b952-27fbe38e9696",
      "name": "Unresolved Handler"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "d783b0b2-3058-49db-a543-0a405c5d815e",
              "name": "data.text",
              "value": "={{ typeof $json.text === 'string' ? $json.text : JSON.stringify($json.output || $json) }}",
              "type": "string"
            },
            {
              "id": "a1b2c3d4-content-class",
              "name": "data.content_class",
              "value": "={{ $json.output?.content_class || $json.content_class || 'UNK' }}",
              "type": "string"
            },
            {
              "id": "a1b2c3d4-class-confidence",
              "name": "data.class_confidence",
              "value": "={{ $json.output?.class_confidence ?? $json.class_confidence ?? 'UNK' }}",
              "type": "string"
            },
            {
              "id": "return-status",
              "name": "status",
              "value": "={{ $json.status || 'resolved' }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -192,
        416
      ],
      "id": "1c9206c0-5927-4c4a-a124-72c9726e3668",
      "name": "Return node"
    },
    {
      "parameters": {
        "url": "={{ $json._jinaUrl }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "text"
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -544,
        1152
      ],
      "id": "d3b152ce-fb60-4814-a242-74b10eb6153b",
      "name": "Fetch URL (Jina)"
    },
    {
      "parameters": {
        "content": "## Testing\n\n\n\n\n\n\n\n\n\n\n\n\nPin data to **Input Validator** node:\n\n**URL Input:**\n```json\n{\"url\": \"https://en.wikipedia.org/wiki/N8n\"}\n```\n\n**Binary Input:**\n```json\n{\n  \"binary_files\": {\n    \"attachment_0\": {\n      \"mimeType\": \"image/jpeg\",\n      \"data\": \"base64...\",\n      \"fileName\": \"test.jpg\"\n    }\n  }\n}\n```",
        "height": 504,
        "width": 460,
        "color": 7
      },
      "id": "676adb44-466e-4f7d-829a-2eb5996ab366",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1632,
        560
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "content": "## Use case",
        "height": 188,
        "width": 460,
        "color": 7
      },
      "id": "48900309-8646-43ad-9567-c1237f5df371",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1632,
        368
      ],
      "typeVersion": 1
    }
  ],
  "connections": {
    "Extract Document Text": {
      "main": [
        [
          {
            "node": "Has Schema?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract PDF Text": {
      "main": [
        [
          {
            "node": "Has Schema?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Summarize",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize": {
      "main": [
        [
          {
            "node": "Has Schema?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "conversion",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract PDF Text",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract from JSON",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract from Excel",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract from CSV",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract Document Text",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract from CSV",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Fetch URL (Jina)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Unresolved Handler",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from Excel": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from CSV": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Input Validator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download File1": {
      "main": [
        [
          {
            "node": "Input Validator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image-to-text": {
      "main": [
        [
          {
            "node": "Return node",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "conversion": {
      "main": [
        [
          {
            "node": "Image-to-text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Modify File & Input": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Input Validator": {
      "main": [
        [
          {
            "node": "Modify File & Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Testing n8n sub-workflow": {
      "main": [
        [
          {
            "node": "Download File1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from JSON": {
      "main": [
        [
          {
            "node": "Has Schema?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Output Schema": {
      "ai_outputParser": [
        [
          {
            "node": "Image-to-text",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "image-language-model": {
      "ai_languageModel": [
        [
          {
            "node": "Image-to-text",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Unresolved Handler": {
      "main": [
        [
          {
            "node": "Return node",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch URL (Jina)": {
      "main": [
        [
          {
            "node": "Has Schema?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has Schema?": {
      "main": [
        [
          {
            "node": "Text-to-Structured",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Return node",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Text-to-Structured": {
      "main": [
        [
          {
            "node": "Return node",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Groq Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Text-to-Structured",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Text Output Schema": {
      "ai_outputParser": [
        [
          {
            "node": "Text-to-Structured",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "templateCredsSetupCompleted": true
  }
}