{
  "name": "Split batch-scanned invoices with the Decisions API",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "split-invoices-flat",
        "authentication": "headerAuth",
        "responseMode": "lastNode",
        "options": {}
      },
      "id": "9103df83-260a-42c8-8965-a8d508e3037e",
      "name": "Receive Batch PDF",
      "webhookId": "9b4e7d20-3f6a-4c81-a5d2-7e1c0b9f4a66",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        -208,
        -112
      ],
      "credentials": {
        "httpHeaderAuth": {
          "id": "8amzwg7C8bEgBbEy",
          "name": "Invoice Splitter Webhook Secret"
        }
      }
    },
    {
      "parameters": {},
      "id": "6d99f1b5-02e5-44cf-b4c2-db4e45987086",
      "name": "Batch PDF",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        16,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.stirling.com/api/v1/convert/pdf/img",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "parameterType": "formBinaryData",
              "name": "fileInput",
              "inputDataFieldName": "data"
            },
            {
              "name": "pageNumbers",
              "value": "all"
            },
            {
              "name": "imageFormat",
              "value": "jpg"
            },
            {
              "name": "singleOrMultiple",
              "value": "multiple"
            },
            {
              "name": "colorType",
              "value": "greyscale"
            },
            {
              "name": "dpi",
              "value": "72"
            }
          ]
        },
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "id": "0c8cf771-fa87-4ddc-b048-dd13aba4effd",
      "name": "Render Pages as Images",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        384,
        0
      ],
      "credentials": {
        "httpHeaderAuth": {
          "id": "g3rlhnflvkMUGrdL",
          "name": "StirlingPDF (cloud) 20261009"
        }
      }
    },
    {
      "parameters": {},
      "id": "ad83f3df-e3b0-4d8e-be09-84a68eb8c897",
      "name": "Unzip Page Images",
      "type": "n8n-nodes-base.compression",
      "typeVersion": 1.1,
      "position": [
        608,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// Turns one decision per page into page ranges, one range per invoice.\n//\n// Thresholds: tune these against batches where you know the right answer.\n// Two invoices merged into one PDF is the costlier mistake (the second one\n// goes unseen), so the split threshold deliberately leans towards splitting.\n// On a labelled 125-page test batch, pages that did not start an invoice all\n// scored 0 and pages that did scored 0.28 or more.\nconst SPLIT_AT = 0.15;             // start a new invoice at or above this probability\nconst REVIEW_BAND = [0.05, 0.8];   // anything strictly inside this range is flagged for a human check\nconst BLANK_SURE = 0.9;            // a page set aside as blank with less confidence than this is flagged too\n\n// The answers come back in the order the pages were asked about.\nconst asked = $('Build One Request per Page').all();\nconst results = $input.all().map((item, i) => ({ page: asked[i]?.json.page, answers: item.json.answers }));\nif (results.length !== asked.length || results.some((result, i) => result.page !== i + 1)) {\n  throw new Error('Some pages came back without a decision, so the PDF was not split.');\n}\n\nconst pages = results.map((result, i) => {\n  const answers = Object.fromEntries((result.answers ?? []).map((a) => [a.name, a]));\n  const start = answers.starts_new_invoice ?? {};\n  const kind = answers.page_type ?? {};\n  // A refusal (or a missing answer) is treated as \"cannot tell\": split and flag.\n  const undecided = typeof start.probability !== 'number';\n  const probability = i === 0 ? 1 : undecided ? null : start.probability;\n  return {\n    page: result.page,\n    probability,\n    pageType: kind.type === 'choice' ? kind.choice : 'invoice',\n    typeConfidence: kind.type === 'choice' && typeof kind.confidence === 'number' ? kind.confidence : null,\n    startsNew: i === 0 || undecided || probability >= SPLIT_AT,\n    uncertain: i > 0 && (undecided || (probability > REVIEW_BAND[0] && probability < REVIEW_BAND[1])),\n  };\n});\n\nconst groups = [];\nfor (const page of pages) {\n  if (page.startsNew || groups.length === 0) groups.push([]);\n  groups[groups.length - 1].push(page);\n}\n\n// The PDF is cut into segments that together cover every page, and every segment\n// is filed. A segment is either an invoice or a run of blank pages (duplex backs, feeder misfires)\n// trimmed from the start or end of one. A blank run is kept as a file of its own,\n// never thrown away: \"blank\" is the model's judgement, and a page it gets wrong\n// must not go missing.\nconst invoices = [];\nconst blankRuns = [];\nconst segments = [];\nconst range = (list) => (list.length === 1 ? String(list[0].page) : list[0].page + '-' + list[list.length - 1].page);\nconst addSegment = (segmentPages, entry) => {\n  segments.push({ first: segmentPages[0].page, last: segmentPages[segmentPages.length - 1].page, ...entry });\n};\nconst addBlankRun = (run) => {\n  if (run.length === 0) return;\n  const reviewPages = run.filter((p) => p.typeConfidence === null || p.typeConfidence < BLANK_SURE).map((p) => p.page);\n  blankRuns.push({ pages: range(run), pageCount: run.length, needsReview: reviewPages.length > 0, reviewPages });\n  addSegment(run, { invoice: null, blankRun: blankRuns.length });\n};\nfor (const group of groups) {\n  let from = 0;\n  let to = group.length;\n  while (from < to && group[from].pageType === 'blank') from++;\n  while (to > from && group[to - 1].pageType === 'blank') to--;\n  const kept = group.slice(from, to);\n  addBlankRun(group.slice(0, from));\n  if (kept.length > 0) {\n    const reviewPages = kept.filter((p) => p.uncertain).map((p) => p.page);\n    invoices.push({\n      invoice: invoices.length + 1,\n      pages: range(kept),\n      pageCount: kept.length,\n      needsReview: reviewPages.length > 0,\n      reviewPages,\n    });\n    addSegment(kept, { invoice: invoices.length });\n  }\n  addBlankRun(group.slice(to));\n}\n\nif (invoices.length === 0) {\n  throw new Error('No invoice pages were found in this PDF.');\n}\n\nreturn [{\n  json: {\n    pages: invoices.map((inv) => inv.pages).join(','),\n    blankPages: blankRuns.map((run) => run.pages).join(','),\n    // Stirling PDF splits after each page listed here.\n    splitAfter: segments.map((segment) => segment.last).join(','),\n    pageCount: pages.length,\n    invoices,\n    blankRuns,\n    segments,\n    decisions: pages,\n  },\n  // The next node uploads the original PDF again, so it travels with this item.\n  binary: { data: $('Batch PDF').first().binary.data },\n}];"
      },
      "id": "ed0611fe-0c16-49b1-ad5a-0ee4871090d3",
      "name": "Find Invoice Boundaries",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1408,
        -32
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.stirling.com/api/v1/general/split-pages",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "parameterType": "formBinaryData",
              "name": "fileInput",
              "inputDataFieldName": "data"
            },
            {
              "name": "pageNumbers",
              "value": "={{ $json.splitAfter }}"
            }
          ]
        },
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "id": "1910a460-2c56-4e51-9050-1eb20bb0fd10",
      "name": "Split PDF by Invoice",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        1728,
        0
      ],
      "credentials": {
        "httpHeaderAuth": {
          "id": "g3rlhnflvkMUGrdL",
          "name": "StirlingPDF (cloud) 20261009"
        }
      }
    },
    {
      "parameters": {},
      "id": "1f7a2a5f-1d84-42f0-b7cb-3caa35b76863",
      "name": "Unzip Invoice Files",
      "type": "n8n-nodes-base.compression",
      "typeVersion": 1.1,
      "position": [
        1920,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// The ZIP holds one PDF per segment, in order: batch_1.pdf, batch_2.pdf, ...\n// Each one becomes its own item with a readable file name. Runs of blank pages\n// are filed too, so every page of the batch ends up in one of the files.\nconst { segments, invoices, blankRuns } = $('Find Invoice Boundaries').first().json;\nconst batchName = ($('Batch PDF').first().binary.data.fileName || 'batch').replace(/\\.pdf$/i, '');\n\nconst files = Object.values($input.first().binary ?? {})\n  .map((file) => ({ file, number: Number((file.fileName ?? '').match(/_(\\d+)\\.pdf$/i)?.[1]) }))\n  .sort((a, b) => a.number - b.number);\nif (files.length !== segments.length || files.some((entry) => Number.isNaN(entry.number))) {\n  throw new Error('Expected ' + segments.length + ' files from the split but received ' + files.length + '.');\n}\n\nreturn segments.map((segment, i) => {\n  const blank = segment.invoice === null;\n  const inv = blank ? blankRuns[segment.blankRun - 1] : invoices[segment.invoice - 1];\n  const label = blank ? 'blank pages' : 'invoice ' + String(inv.invoice).padStart(2, '0');\n  const fileName = batchName + ' - ' + label + ' (p' + inv.pages + ')' + (inv.needsReview ? ' REVIEW' : '') + '.pdf';\n  return {\n    json: { invoice: blank ? null : inv.invoice, pages: inv.pages, needsReview: inv.needsReview, fileName },\n    binary: { data: { ...files[i].file, fileName } },\n  };\n});"
      },
      "id": "845202a7-8ec8-48bb-bebf-166025d33008",
      "name": "Name Each Invoice",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2112,
        0
      ]
    },
    {
      "parameters": {
        "name": "={{ $json.fileName }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultName": "/ (Root folder)"
        },
        "options": {}
      },
      "id": "a09e712c-4d5c-47ef-834f-9eda06f73bfb",
      "name": "Upload to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        2304,
        0
      ],
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "4mRlQWMsk8IKohsI",
          "name": "Google Drive account"
        }
      }
    },
    {
      "parameters": {
        "mode": "raw",
        "jsonOutput": "={{\n{\n  \"pageCount\": $('Find Invoice Boundaries').first().json.pageCount,\n  \"invoiceCount\": $('Find Invoice Boundaries').first().json.invoices.length,\n  \"needsReviewCount\": $('Name Each Invoice').all().filter(i => i.json.needsReview).length,\n  \"invoices\": $('Name Each Invoice').all().map((item, i) => ({\n    \"invoice\": item.json.invoice,\n    \"pages\": item.json.pages,\n    \"needsReview\": item.json.needsReview,\n    \"fileName\": item.json.fileName,\n    \"link\": $input.all()[i].json.webViewLink ?? null\n  })).filter(entry => entry.invoice !== null),\n  \"blankPages\": $('Name Each Invoice').all().map((item, i) => ({\n    \"blank\": item.json.invoice === null,\n    \"pages\": item.json.pages,\n    \"needsReview\": item.json.needsReview,\n    \"fileName\": item.json.fileName,\n    \"link\": $input.all()[i].json.webViewLink ?? null\n  })).filter(entry => entry.blank).map(entry => ({\n    \"pages\": entry.pages,\n    \"needsReview\": entry.needsReview,\n    \"fileName\": entry.fileName,\n    \"link\": entry.link\n  })),\n  \"decisions\": $('Find Invoice Boundaries').first().json.decisions\n}\n}}",
        "options": {}
      },
      "id": "71a0b7fc-f1b4-44ea-a1ba-fe4c3216540b",
      "name": "Summarise the Result",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "executeOnce": true,
      "position": [
        2608,
        0
      ]
    },
    {
      "parameters": {
        "authentication": "n8nUserAuth",
        "formTitle": "Split a batch of scanned invoices",
        "formDescription": "Upload one PDF that holds several scanned invoices. Each invoice is saved to Google Drive as its own PDF.",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Scanned invoices (PDF)",
              "fieldType": "file",
              "fieldName": "data",
              "multipleFiles": false,
              "acceptFileTypes": ".pdf",
              "requiredField": true
            }
          ]
        },
        "responseMode": "lastNode",
        "options": {
          "buttonLabel": "Split invoices",
          "path": "upload-invoices-flat",
          "respondWithOptions": {
            "values": {
              "formSubmittedText": "Done. The invoices have been split and saved to Google Drive."
            }
          }
        }
      },
      "id": "a398b842-12e8-43f1-a3ec-c06b254c056c",
      "name": "Upload Batch PDF",
      "webhookId": "c1a85f3e-6d2b-4e97-b0c4-2f8d7a3e9b15",
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.6,
      "position": [
        -208,
        112
      ]
    },
    {
      "parameters": {
        "jsCode": "// The ZIP holds one image per page, named like batch_1.jpg, batch_2.jpg, ...\n// The Decisions API only accepts images inline, so each is read and base64-encoded.\n// Reading them all at once is much quicker than one after another.\n// Each page's image is kept once. \"Ask Decisions API\" puts the request together\n// and looks up the page before, so no image is stored twice.\nconst images = Object.entries($input.first().binary ?? {})\n  .map(([key, file]) => ({ key, page: Number((file.fileName ?? '').match(/_(\\d+)\\.[a-z0-9]+$/i)?.[1]) }))\n  .sort((a, b) => a.page - b.page);\nif (images.length === 0 || images.some((image, i) => image.page !== i + 1)) {\n  throw new Error('The page images did not come back numbered from 1 upwards.');\n}\n\nreturn await Promise.all(images.map(async (image) => {\n  const file = Buffer.from(await this.helpers.getBinaryDataBuffer(0, image.key));\n  return { json: { page: image.page, image: 'data:image/jpeg;base64,' + file.toString('base64') } };\n}));"
      },
      "id": "61e77991-eda4-4f64-b468-6f51e62ccb1c",
      "name": "Build One Request per Page",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        960,
        -32
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.openai.com/v1/decisions",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "openAiApi",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{\n{\n  \"model\": \"gpt-6-luna\",\n  \"input\": [{ \"role\": \"user\", \"content\": $itemIndex === 0\n    ? [\n        { \"type\": \"input_text\", \"text\": \"There is no PREVIOUS PAGE: this is the first page of the file.\" },\n        { \"type\": \"input_text\", \"text\": \"CURRENT PAGE:\" },\n        { \"type\": \"input_image\", \"image_url\": $json.image }\n      ]\n    : [\n        { \"type\": \"input_text\", \"text\": \"PREVIOUS PAGE:\" },\n        { \"type\": \"input_image\", \"image_url\": $input.all()[$itemIndex - 1].json.image },\n        { \"type\": \"input_text\", \"text\": \"CURRENT PAGE:\" },\n        { \"type\": \"input_image\", \"image_url\": $json.image }\n      ]\n  }],\n  \"questions\": [\n    {\n      \"type\": \"predicate\",\n      \"name\": \"starts_new_invoice\",\n      \"instructions\": \"Is the CURRENT PAGE the first page of a new invoice? Answer yes only when the current page is itself the opening page of an invoice, bill or credit note: it shows that document's own header details, such as its invoice number, invoice date, billing address and amount due, and it is not a later page of the invoice on the PREVIOUS PAGE. Answer no when the current page continues the previous page's invoice: the same invoice number, a 'page 2 of 3' style marker, a line-item table that carries on, or totals for the lines before it. Also answer no for any page that is not an invoice page, because such pages travel with the invoice before them: payment instructions, remittance slips, terms and conditions, price or service notices, information sheets, advertising and blank pages. A repeated letterhead alone does not make a new invoice. If there is no previous page, judge the current page on its own.\"\n    },\n    {\n      \"type\": \"choice\",\n      \"name\": \"page_type\",\n      \"instructions\": \"What is on the CURRENT PAGE?\",\n      \"choices\": [\n        { \"value\": \"invoice\", \"description\": \"Any page of an invoice, credit note or similar billing document, including continuation and totals pages.\" },\n        { \"value\": \"blank\", \"description\": \"An empty page: nothing meaningful beyond scanner noise, specks or shadows.\" },\n        { \"value\": \"other\", \"description\": \"Anything else, such as a cover sheet, separator page, letter or delivery note.\" }\n      ]\n    }\n  ]\n}\n}}",
        "options": {
          "batching": {
            "batch": {
              "batchSize": 25
            }
          }
        }
      },
      "id": "eb6efa53-245a-44f1-9e50-ac96f8afd482",
      "name": "Ask Decisions API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "retryOnFail": true,
      "maxTries": 2,
      "waitBetweenTries": 5000,
      "position": [
        1184,
        -32
      ],
      "credentials": {
        "openAiApi": {
          "id": "3rGrBH6ZPZYnXDjw",
          "name": "Subworkflow.ai 2 20261009"
        }
      }
    },
    {
      "parameters": {
        "content": "## Split a batch-scanned invoices PDF with the Decisions API\n\nSeveral paper invoices scanned into **one PDF** go in. **One PDF per invoice** comes out, with multi-page invoices kept together.\n\n### How it works\n1. The PDF arrives through the upload form or the webhook.\n2. Stirling PDF renders every page as an image.\n3. OpenAI's Decisions API looks at each page next to the page before it and returns the **probability** that it starts a new invoice.\n4. A short Code node turns those probabilities into page ranges and flags the uncertain ones.\n5. Stirling PDF splits the original PDF and each invoice is saved to Google Drive.\n\n### Set up\n- Add your **OpenAI** and **Google Drive** credentials.\n- For **Stirling PDF**, create a **Header Auth** credential named `X-API-KEY` holding your Stirling API key, and select it in **Render Pages as Images** and **Split PDF by Invoice**. Self-hosting Stirling PDF? Change the address in those two nodes.\n- Create a second **Header Auth** credential holding a secret of your own and attach it to **Receive Batch PDF**. The webhook rejects calls without it.\n- The upload form only opens for people logged in to your n8n. To open it to others, change **Authentication** in **Upload Batch PDF**.\n- Pick the destination folder in **Upload to Google Drive**.\n- Upload a PDF through the form, or POST one to the webhook URL with `Content-Type: application/pdf` and your secret header.\n\n### Tune\nThresholds live at the top of **Find Invoice Boundaries**. Requests go out 25 a second: change **Options > Batching** in **Ask Decisions API** if your OpenAI account has a low rate limit.\n",
        "height": 772,
        "width": 500
      },
      "id": "fa957081-6e3e-4c3f-9caf-34e69cfaa07b",
      "name": "About",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -832,
        -384
      ]
    },
    {
      "parameters": {
        "content": "## 1. Receive\nTwo ways in: POST the PDF to the webhook with your secret header, or upload it through the form.",
        "height": 528,
        "width": 560,
        "color": 7
      },
      "id": "e60ad448-2c65-4fd1-93db-c8272f331aff",
      "name": "Note: Receive",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -304,
        -240
      ]
    },
    {
      "parameters": {
        "content": "## 2. Render each page\nThe Decisions API reads images, not PDFs. Stirling PDF returns a ZIP with one JPG per page.\n\n**Note:** StirlingPDF provides an easy way try this workflow out with their generous free tier. However, if you're working with internal or otherwise sensitive docs, you may want to try a self-hosted solution instead.",
        "height": 448,
        "width": 560,
        "color": 7
      },
      "id": "4c90ee40-6c03-4822-8053-d5393455492a",
      "name": "Note: Render",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        272,
        -240
      ]
    },
    {
      "parameters": {
        "content": "## 3. Decide where each invoice starts\nEvery page image is encoded and sent with two questions: a **predicate** (does this page start a new invoice?) and a **choice** (invoice, blank or other). One request goes out per page, 25 a second. The probabilities become page ranges such as `1,2-4,5-6`.",
        "height": 384,
        "width": 736,
        "color": 5
      },
      "id": "403d23eb-c216-401c-a57e-d68d6769750a",
      "name": "Note: Decide",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        864,
        -176
      ]
    },
    {
      "parameters": {
        "content": "## 4. Split and file\nOne Stirling PDF call splits the original PDF at those boundaries. Files whose boundary was uncertain get **REVIEW** in the name so a person can check them.",
        "height": 384,
        "width": 864,
        "color": 7
      },
      "id": "73bfd5d5-6c93-4f79-ae13-fd16c7d097dd",
      "name": "Note: File",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1632,
        -176
      ]
    },
    {
      "parameters": {
        "content": "## Need a test document? Use ours!\nThis is a 126 page, 9mb pdf file that contains 30 faux invoices from a fictitious electric service provider. It's also made to mimic scans to further demonstrate the value of multimodal input.\n\n**Download file:** [https://cdn.subworkflow.ai/n8n-templates/acme-electricity-company-batched-invoices.pdf](https://cdn.subworkflow.ai/n8n-templates/acme-electricity-company-batched-invoices.pdf)\n\nIn our testing, it takes 7.4 seconds for the decision API to identify all 30 invoices correctly! The total cost was $0.02.\n",
        "height": 224,
        "width": 560,
        "color": 6
      },
      "id": "33a3fe9c-d160-4da7-8067-58bc8458e698",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -304,
        320
      ]
    },
    {
      "parameters": {
        "content": "[![](https://cdn.subworkflow.ai/marketing/banner-300x100.png?v=20260918)](https://subworkflow.ai)",
        "width": 336,
        "color": 7
      },
      "id": "afa29999-6310-4851-a43a-b64c23e31df1",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -832,
        400
      ]
    }
  ],
  "pinData": {},
  "connections": {
    "Receive Batch PDF": {
      "main": [
        [
          {
            "node": "Batch PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Batch PDF": {
      "main": [
        [
          {
            "node": "Render Pages as Images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Render Pages as Images": {
      "main": [
        [
          {
            "node": "Unzip Page Images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Unzip Page Images": {
      "main": [
        [
          {
            "node": "Build One Request per Page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Invoice Boundaries": {
      "main": [
        [
          {
            "node": "Split PDF by Invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split PDF by Invoice": {
      "main": [
        [
          {
            "node": "Unzip Invoice Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Unzip Invoice Files": {
      "main": [
        [
          {
            "node": "Name Each Invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Name Each Invoice": {
      "main": [
        [
          {
            "node": "Upload to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Google Drive": {
      "main": [
        [
          {
            "node": "Summarise the Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Batch PDF": {
      "main": [
        [
          {
            "node": "Batch PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build One Request per Page": {
      "main": [
        [
          {
            "node": "Ask Decisions API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ask Decisions API": {
      "main": [
        [
          {
            "node": "Find Invoice Boundaries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate"
  },
  "versionId": "d95126e7-9d3b-4757-89b0-aa55c27f1b45",
  "meta": {
    "instanceId": "b9f144fdc910a1e14e522063b576e7e28af8b611858295f590957fc8454b2836"
  },
  "nodeGroups": [],
  "id": "nCGY7Vk4eSbMiF0S",
  "tags": []
}