{
  "name": "Extract structured invoice data from JotForm PDFs with GPT-4.1-mini & Sheets",
  "nodes": [
    {
      "id": "bcd1e88b-4435-4862-960e-86f284884681",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -544,
        -32
      ]
    },
    {
      "id": "84b85e47-b3aa-4c61-85ce-c17aba383b8e",
      "name": "Formatted Structured Data Extract",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        -352,
        -32
      ]
    },
    {
      "id": "f7f77bb3-eb70-4000-aace-061d022e2882",
      "name": "Download Invoice",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        0,
        -32
      ]
    },
    {
      "id": "cc1a28b8-a287-43c3-9bb3-118a89570562",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        416,
        -32
      ]
    },
    {
      "id": "e9a4d6af-2efc-4d6b-8f72-5b49f60181ca",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        736,
        160
      ]
    },
    {
      "id": "c60bd005-d03e-4053-93a1-7137c90b8e80",
      "name": "Structured Data Extract",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        640,
        -32
      ]
    },
    {
      "id": "2d0f93f5-6372-4c2c-97a0-61275648fc58",
      "name": "OpenAI Chat Model for Structured Data",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        576,
        176
      ]
    },
    {
      "id": "48d81c63-ed97-4229-a63d-ad1a2a8959ae",
      "name": "OpenAI Chat Model for Output Parser",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        672,
        368
      ]
    },
    {
      "id": "a54f0c84-82ca-439e-8cd8-86dabe04f69b",
      "name": "OpenAI Chat Model for Structured Data Formatted Content",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -352,
        176
      ]
    },
    {
      "id": "a21275f7-fc1b-47ab-ba6a-06bcde58875e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        -432
      ],
      "parameters": {
        "width": 352,
        "height": 272,
        "content": "![Logo](https://www.jotform.com/resources/assets/logo-nb/min/jotform-logo-white-400x200.png)\n\nUses OpenAI gpt-4.1-mini for structured data extraction of the invoice PDF content"
      }
    },
    {
      "id": "569de30c-835b-4ed3-aa7c-21052f4c06c9",
      "name": "Write File from Disk for Inbound Invoice Processing",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        208,
        -32
      ]
    },
    {
      "id": "9f3662ac-82cf-48fd-b04e-979d8d4d9310",
      "name": "Append or update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1120,
        144
      ]
    },
    {
      "id": "707dd08c-6896-4888-9b16-699557d09320",
      "name": "Write the Structured Invoice to Disk",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        1296,
        -192
      ]
    },
    {
      "id": "12cb7d07-9233-4081-92d9-11ebbe70270d",
      "name": "Create a Binary Response",
      "type": "n8n-nodes-base.function",
      "position": [
        1120,
        -192
      ]
    },
    {
      "id": "077170e7-ca49-49be-a8d9-892b999a6724",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        384
      ],
      "parameters": {
        "width": 512,
        "height": 512,
        "content": "### **Purpose:**\nAutomates extraction of structured invoice data (ID, company, client, items, totals, etc.) from uploaded **JotForm PDF invoices** and stores results in **Google Sheets** and as JSON o"
      }
    },
    {
      "id": "575ee55d-ff5f-4ec1-a9a5-e9f711f2b05c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        -160
      ],
      "parameters": {
        "width": 656,
        "height": 672,
        "content": "## Structured Data Extraction Using OpenAI"
      }
    },
    {
      "id": "47621c4a-20cc-455c-b901-d12b93447bb8",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        -288
      ],
      "parameters": {
        "width": 400,
        "height": 800,
        "content": "## Export Data Handling"
      }
    },
    {
      "id": "73c0cc88-4604-4f19-83a2-10ce1bb9ea40",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        -128
      ],
      "parameters": {
        "width": 512,
        "height": 464,
        "content": "## Webhook Receiver & Data Formatting"
      }
    },
    {
      "id": "1f92db74-0623-4785-a62b-18ff14405463",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -128
      ],
      "parameters": {
        "width": 432,
        "height": 464,
        "content": "## Invoice Download & Write to Disk "
      }
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Formatted Structured Data Extract",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Invoice": {
      "main": [
        [
          {
            "node": "Write File from Disk for Inbound Invoice Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Structured Data Extract",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Data Extract": {
      "main": [
        [
          {
            "node": "Append or update row in sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create a Binary Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a Binary Response": {
      "main": [
        [
          {
            "node": "Write the Structured Invoice to Disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Structured Data Extract",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Formatted Structured Data Extract": {
      "main": [
        [
          {
            "node": "Download Invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model for Output Parser": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model for Structured Data": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Data Extract",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Write File from Disk for Inbound Invoice Processing": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model for Structured Data Formatted Content": {
      "ai_languageModel": [
        [
          {
            "node": "Formatted Structured Data Extract",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}