{
  "name": "Split an applicant's document packet with the Decisions API",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "split-packet-flat",
        "authentication": "headerAuth",
        "responseMode": "lastNode",
        "options": {}
      },
      "id": "25c0ae03-934c-42f1-8dba-1470df575910",
      "name": "Receive Packet PDF",
      "webhookId": "2d7f9a14-5c3e-4b68-8e01-6a9c4d2f7b83",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        -208,
        -112
      ],
      "credentials": {
        "httpHeaderAuth": {
          "id": "8amzwg7C8bEgBbEy",
          "name": "Invoice Splitter Webhook Secret"
        }
      }
    },
    {
      "parameters": {},
      "id": "4525d2b8-6209-4f3e-a4d3-f414ebe59946",
      "name": "Packet 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": "7cfccc3a-7b47-411b-9ec1-351df2f72f7e",
      "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": "dbd87c54-096f-4c26-a883-c56004a9ae84",
      "name": "Unzip Page Images",
      "type": "n8n-nodes-base.compression",
      "typeVersion": 1.1,
      "position": [
        608,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// Turns one set of answers per page into page ranges, one range per document.\n//\n// Thresholds: tune these against packets where you know the right answer.\n// On four labelled test packets (178 pages), every page with the header\n// scored 0.96 or more, every page without it scored 0, and the lowest\n// confidence in a document type was 0.82.\nconst SPLIT_AT = 0.5;              // a page starts a new document at or above this probability\nconst REVIEW_BAND = [0.05, 0.9];   // a probability strictly inside this range is flagged for a human check\nconst TYPE_CONFIDENCE = 0.6;       // a document type the API is less sure of than this is flagged too\nconst BLANK_AT = 0.5;              // a page is treated as blank at or above this probability\nconst BLANK_SURE = 0.9;            // a page set aside as blank below this probability is flagged for a human check\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_document ?? {};\n  const type = answers.document_type ?? {};\n  const blank = answers.is_blank ?? {};\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 = undecided ? null : start.probability;\n  const blankProbability = typeof blank.probability === 'number' ? blank.probability : null;\n  return {\n    page: result.page,\n    probability,\n    startsNew: i === 0 || undecided || probability >= SPLIT_AT,\n    uncertain: undecided || (probability > REVIEW_BAND[0] && probability < REVIEW_BAND[1]),\n    documentType: type.type === 'choice' ? type.choice : null,\n    typeConfidence: type.type === 'choice' ? type.confidence : null,\n    blank: blankProbability !== null && blankProbability >= BLANK_AT,\n    blankProbability,\n  };\n});\n\nconst groups = [];\nfor (const page of pages) {\n  if (page.startsNew) groups.push([]);\n  groups[groups.length - 1].push(page);\n}\n\n// letter_of_recommendation -> \"Letter of recommendation\", for file names.\nconst typeName = (value) => value.charAt(0).toUpperCase() + value.slice(1).replace(/_/g, ' ');\n\n// The PDF is cut into segments that together cover every page, and every segment\n// is filed. A segment is either a document or a run of blank pages (the empty reverse of a scanned sheet)\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 documents = [];\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 unsure = run.filter((p) => p.blankProbability < BLANK_SURE).map((p) => p.page);\n  const review = unsure.length > 0 ? ['may not be blank: page ' + unsure.join(', ')] : [];\n  blankRuns.push({ pages: range(run), pageCount: run.length, needsReview: review.length > 0, review });\n  addSegment(run, { document: 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].blank) from++;\n  while (to > from && group[to - 1].blank) to--;\n  const kept = group.slice(from, to);\n  addBlankRun(group.slice(0, from));\n  if (kept.length > 0) {\n    // The document's first page carries the header, so its answer names the type.\n    const type = kept[0].documentType;\n    const listed = Boolean(type) && type !== 'none' && type !== 'other';\n    const review = [];\n    const unsure = kept.filter((p) => p.uncertain).map((p) => p.page);\n    if (unsure.length > 0) review.push('uncertain boundary at page ' + unsure.join(', '));\n    if (!listed) review.push(type === 'other' ? 'document type is not in the list' : 'no document type was read');\n    else if (kept[0].typeConfidence < TYPE_CONFIDENCE) review.push('uncertain document type');\n    documents.push({\n      document: documents.length + 1,\n      type: listed ? type : type === 'other' ? 'other' : 'unknown',\n      typeName: listed ? typeName(type) : type === 'other' ? 'Other document' : 'Unknown document',\n      pages: range(kept),\n      pageCount: kept.length,\n      needsReview: review.length > 0,\n      review,\n    });\n    addSegment(kept, { document: documents.length });\n  }\n  addBlankRun(group.slice(to));\n}\n\nif (documents.length === 0) {\n  throw new Error('No document pages were found in this PDF.');\n}\n\nreturn [{\n  json: {\n    pages: documents.map((doc) => doc.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    documents,\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: $('Packet PDF').first().binary.data },\n}];"
      },
      "id": "d0404750-d22c-4cad-a359-e365587fa12e",
      "name": "Find Document Boundaries",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1408,
        0
      ]
    },
    {
      "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": "674fd687-acd1-4569-81d6-0bc72d416a3e",
      "name": "Split PDF by Document",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        1728,
        0
      ],
      "credentials": {
        "httpHeaderAuth": {
          "id": "g3rlhnflvkMUGrdL",
          "name": "StirlingPDF (cloud) 20261009"
        }
      }
    },
    {
      "parameters": {},
      "id": "2c3a241a-ac8f-49c2-ad3b-c8787abd8c95",
      "name": "Unzip Document Files",
      "type": "n8n-nodes-base.compression",
      "typeVersion": 1.1,
      "position": [
        1920,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// The ZIP holds one PDF per segment, in order: packet_1.pdf, packet_2.pdf, ...\n// Each one becomes its own item, named after its type. Runs of blank pages are\n// filed too, so every page of the packet ends up in one of the files.\nconst { segments, documents, blankRuns } = $('Find Document Boundaries').first().json;\nconst packetName = ($('Packet PDF').first().binary.data.fileName || 'packet').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.document === null;\n  const doc = blank ? blankRuns[segment.blankRun - 1] : documents[segment.document - 1];\n  // The number keeps the packet's order and tells documents of the same type apart.\n  const label = blank ? 'Blank pages' : String(doc.document).padStart(2, '0') + ' ' + doc.typeName;\n  const fileName = packetName + ' - ' + label + ' (p' + doc.pages + ')' + (doc.needsReview ? ' REVIEW' : '') + '.pdf';\n  return {\n    json: { document: blank ? null : doc.document, type: blank ? 'blank_pages' : doc.type, pages: doc.pages, needsReview: doc.needsReview, review: doc.review, fileName },\n    binary: { data: { ...files[i].file, fileName } },\n  };\n});"
      },
      "id": "fc2fbd09-6641-4029-9c64-847c0906ed04",
      "name": "Name Each Document",
      "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": "90ea6f88-5f51-4143-a998-b724eceb313e",
      "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 Document Boundaries').first().json.pageCount,\n  \"documentCount\": $('Find Document Boundaries').first().json.documents.length,\n  \"needsReviewCount\": $('Name Each Document').all().filter(i => i.json.needsReview).length,\n  \"documents\": $('Name Each Document').all().map((item, i) => ({\n    \"document\": item.json.document,\n    \"type\": item.json.type,\n    \"pages\": item.json.pages,\n    \"needsReview\": item.json.needsReview,\n    \"review\": item.json.review,\n    \"fileName\": item.json.fileName,\n    \"link\": $input.all()[i].json.webViewLink ?? null\n  })).filter(entry => entry.document !== null),\n  \"blankPages\": $('Name Each Document').all().map((item, i) => ({\n    \"blank\": item.json.document === null,\n    \"pages\": item.json.pages,\n    \"needsReview\": item.json.needsReview,\n    \"review\": item.json.review,\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    \"review\": entry.review,\n    \"fileName\": entry.fileName,\n    \"link\": entry.link\n  })),\n  \"decisions\": $('Find Document Boundaries').first().json.decisions\n}\n}}",
        "options": {}
      },
      "id": "0d61cbcd-8544-4679-a4b2-fa0a3d5a8fa0",
      "name": "Summarise the Result",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "executeOnce": true,
      "position": [
        2608,
        0
      ]
    },
    {
      "parameters": {
        "authentication": "n8nUserAuth",
        "formTitle": "Split an applicant's packet into documents",
        "formDescription": "Upload one PDF that holds every document an applicant submitted. Each document is saved to Google Drive as its own PDF, named after its type.",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Applicant packet (PDF)",
              "fieldType": "file",
              "fieldName": "data",
              "multipleFiles": false,
              "acceptFileTypes": ".pdf",
              "requiredField": true
            }
          ]
        },
        "responseMode": "lastNode",
        "options": {
          "buttonLabel": "Split packet",
          "path": "upload-packet-flat",
          "respondWithOptions": {
            "values": {
              "formSubmittedText": "Done. The packet has been split and each document saved to Google Drive."
            }
          }
        }
      },
      "id": "e34dcda3-c613-47f0-bbb2-8d4a3630246d",
      "name": "Upload Packet PDF",
      "webhookId": "e6b3c8d5-1f4a-4a72-9d30-8c5e2b7a1f49",
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.6,
      "position": [
        -208,
        112
      ]
    },
    {
      "parameters": {
        "jsCode": "// The ZIP holds one image per page, named like packet_1.jpg, packet_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 is judged on its own: the portal's header is either on it or not.\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": "81c81a4c-d675-47a6-a691-e212c1799aec",
      "name": "Build One Request per Page",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        960,
        0
      ]
    },
    {
      "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\": [{ \"type\": \"input_image\", \"image_url\": $json.image }] }],\n  \"questions\": [\n    {\n      \"type\": \"predicate\",\n      \"name\": \"starts_new_document\",\n      \"instructions\": \"Does this page have the application portal's header strip at the very top? The strip is a shaded band across the top edge of the page, above the page's own content. It shows a document type in large bold type, such as Statement of Purpose, Transcript or Application Summary, together with the applicant's name and ID, a file name and a date. It appears only on the first page of each document in the packet. Answer yes only when the strip is on this page. Answer no for every other page, including pages whose own content has a title, letterhead, running title or heading that names a document type, and including blank pages.\"\n    },\n    {\n      \"type\": \"choice\",\n      \"name\": \"document_type\",\n      \"instructions\": \"What document type is printed in the header strip at the very top of this page? The strip is the shaded band across the top edge that also shows the applicant's name and ID. Go by the words printed in the strip, not by what the rest of the page says or looks like. Choose none only when the page has no header strip.\",\n      \"choices\": [\n        { \"value\": \"application_summary\", \"description\": \"The strip reads Application Summary.\" },\n        { \"value\": \"statement_of_purpose\", \"description\": \"The strip reads Statement of Purpose.\" },\n        { \"value\": \"personal_statement\", \"description\": \"The strip reads Personal Statement.\" },\n        { \"value\": \"curriculum_vitae\", \"description\": \"The strip reads Resume, CV or Curriculum Vitae.\" },\n        { \"value\": \"transcript\", \"description\": \"The strip reads Transcript.\" },\n        { \"value\": \"letter_of_recommendation\", \"description\": \"The strip reads Letter of Recommendation.\" },\n        { \"value\": \"test_scores\", \"description\": \"The strip reads Test Scores.\" },\n        { \"value\": \"english_proficiency_scores\", \"description\": \"The strip reads English Proficiency Scores.\" },\n        { \"value\": \"writing_sample\", \"description\": \"The strip reads Writing Sample.\" },\n        { \"value\": \"research_proposal\", \"description\": \"The strip reads Research Proposal.\" },\n        { \"value\": \"degree_certificate\", \"description\": \"The strip reads Degree Certificate.\" },\n        { \"value\": \"financial_documentation\", \"description\": \"The strip reads Financial Documentation.\" },\n        { \"value\": \"identity_document\", \"description\": \"The strip reads Passport, ID or another identity document.\" },\n        { \"value\": \"other\", \"description\": \"The strip names a document type that is not in this list.\" },\n        { \"value\": \"none\", \"description\": \"There is no header strip on this page.\" }\n      ]\n    },\n    {\n      \"type\": \"predicate\",\n      \"name\": \"is_blank\",\n      \"instructions\": \"Is this page blank? Answer yes when it shows nothing meaningful beyond scanner noise, specks, shadows or faint show-through from the other side. Answer no when it carries any text, table, picture, stamp or header.\"\n    }\n  ]\n}\n}}",
        "options": {
          "batching": {
            "batch": {
              "batchSize": 25
            }
          }
        }
      },
      "id": "738217ae-c52c-45d9-adb8-7fa86d4808d9",
      "name": "Ask Decisions API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "retryOnFail": true,
      "maxTries": 2,
      "waitBetweenTries": 5000,
      "position": [
        1184,
        0
      ],
      "credentials": {
        "openAiApi": {
          "id": "3rGrBH6ZPZYnXDjw",
          "name": "Subworkflow.ai 2 20261009"
        }
      }
    },
    {
      "parameters": {
        "content": "## Split an applicant's document packet with the Decisions API\n\nOne PDF holding **every document an applicant uploaded** goes in. **One PDF per document** comes out, each named after its type: transcript, statement of purpose, letter of recommendation and so on.\n\nIt relies on the header an application portal prints at the top of each document to say what it is.\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 and returns the **probability** that it carries the portal's header, and the **document type** the header names.\n4. A short Code node turns those answers into one page range per document and flags the uncertain ones.\n5. Stirling PDF splits the original PDF and each document 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 Document**. 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 Packet 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 Packet PDF**.\n- In **Ask Decisions API**, describe your own portal's header and list your own document types.\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 Document Boundaries**. Requests go out 25 a second: change **Options > Batching** in **Ask Decisions API** if your OpenAI account has a low rate limit.",
        "height": 880,
        "width": 500
      },
      "id": "07102dc6-c542-4ffc-9486-1ed9b7a792ee",
      "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": "63b935e5-a893-4187-a718-d7ea1131624e",
      "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 to 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": "36190921-93b2-4dc7-906f-a32a62a2a25e",
      "name": "Note: Render",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        272,
        -240
      ]
    },
    {
      "parameters": {
        "content": "## 3. Decide where each document starts\nEvery page image is encoded and sent with three questions: a **predicate** (does this page carry the portal's header?), a **choice** (which document type does the header name?) and a second **predicate** (is the page blank?). One request goes out per page, 25 a second. A page that carries the portal's header starts a new document, which gives page ranges such as `1-3,4-6,7`.",
        "height": 384,
        "width": 736,
        "color": 5
      },
      "id": "33788e77-5db0-429c-8343-2b032c7346a4",
      "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. Each file is named after its document type. Files with an uncertain boundary or type get **REVIEW** in the name so a person can check them.",
        "height": 384,
        "width": 864,
        "color": 7
      },
      "id": "ff4681bb-9a49-4e92-ac30-74762ab18d5f",
      "name": "Note: File",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1632,
        -176
      ]
    },
    {
      "parameters": {
        "content": "[![](https://cdn.subworkflow.ai/marketing/banner-300x100.png?v=20260918)](https://subworkflow.ai)",
        "height": 128,
        "width": 336,
        "color": 7
      },
      "id": "2477af9a-72c5-4a78-850c-02a7911420b9",
      "name": "Note: Banner",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -832,
        512
      ]
    },
    {
      "parameters": {
        "content": "## Need a test document? Use ours!\nThis is a 42 page, 5mb pdf file that contains 15 faux documents which make up a mock application packet. 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/merrodale-university-admissions-packet.pdf](https://cdn.subworkflow.ai/n8n-templates/merrodale-university-admissions-packet.pdf)\n\nIn our testing, it takes 1.8 seconds for the decision API to identify all 15 documents correctly! The total cost was $0.006.\n",
        "height": 224,
        "width": 560,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -304,
        320
      ],
      "id": "1fb62cbb-fed1-4686-a3b0-584dfd7bc767",
      "name": "Sticky Note"
    }
  ],
  "pinData": {},
  "connections": {
    "Receive Packet PDF": {
      "main": [
        [
          {
            "node": "Packet PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Packet 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 Document Boundaries": {
      "main": [
        [
          {
            "node": "Split PDF by Document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split PDF by Document": {
      "main": [
        [
          {
            "node": "Unzip Document Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Unzip Document Files": {
      "main": [
        [
          {
            "node": "Name Each Document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Name Each Document": {
      "main": [
        [
          {
            "node": "Upload to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Google Drive": {
      "main": [
        [
          {
            "node": "Summarise the Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Packet PDF": {
      "main": [
        [
          {
            "node": "Packet 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 Document Boundaries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate"
  },
  "versionId": "e569366c-1df6-4454-b32f-4872a9de13ca",
  "meta": {
    "instanceId": "b9f144fdc910a1e14e522063b576e7e28af8b611858295f590957fc8454b2836"
  },
  "nodeGroups": [],
  "id": "ULquFMqi2Rqoeecu",
  "tags": []
}