{
  "name": "Auto-fill PDF forms with AI using Autype, OpenAI, and Google Drive",
  "nodes": [
    {
      "id": "fdee74d8-7a0f-4b7f-8c2b-2bf2936eab99",
      "name": "Run Workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        416,
        848
      ]
    },
    {
      "id": "d00a35ac-3e97-4a5c-9cd7-48fb0d7743ac",
      "name": "Download PDF Form",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        656,
        848
      ]
    },
    {
      "id": "a20f6ae9-4030-4698-aa10-fafd740d5027",
      "name": "Upload PDF Form",
      "type": "n8n-nodes-autype.autype",
      "position": [
        896,
        848
      ]
    },
    {
      "id": "8094144a-4eb9-4077-a1a7-e437ce4200e2",
      "name": "Get Form Fields",
      "type": "n8n-nodes-autype.autype",
      "position": [
        1136,
        848
      ]
    },
    {
      "id": "e0cccee6-0888-4f06-9b0e-3c9ec40bc645",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        704,
        1280
      ]
    },
    {
      "id": "395304b3-96cf-4681-8817-487f0803e96a",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        704,
        1488
      ]
    },
    {
      "id": "abefa7ee-b65b-4993-8f8b-159176b65dd0",
      "name": "Prepare Fill Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1024,
        1280
      ]
    },
    {
      "id": "b0c18c27-1a8d-40a0-86df-f402d14dcc6d",
      "name": "Fill PDF Form",
      "type": "n8n-nodes-autype.autype",
      "position": [
        1264,
        1280
      ]
    },
    {
      "id": "4c0773d0-6d26-41ba-aa16-9b3f5ad36e41",
      "name": "Save Filled PDF to Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1472,
        1280
      ]
    },
    {
      "id": "220b9eb1-0b10-4a3b-bef3-be632309c441",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        464
      ],
      "parameters": {
        "width": 576,
        "height": 992,
        "content": "## Auto-Fill PDF Forms with AI Using Autype and OpenAI\n### This workflow downloads a fillable PDF form from a URL, extracts all form fields using Autype, sends the field list to an AI Agent (OpenAI) t"
      }
    },
    {
      "id": "5b4bdb7b-c445-4d14-88d9-3331961c939d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        608,
        656
      ],
      "parameters": {
        "width": 972,
        "height": 368,
        "content": "### 1. Download & Extract Form Fields\nDownloads the PDF form from a URL and uploads it to Autype. The Get Form Fields operation returns all field names, types, current values, and options as metadata "
      }
    },
    {
      "id": "cb3cdc91-7371-445b-a87b-5043d040bc27",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        608,
        1088
      ],
      "parameters": {
        "width": 548,
        "height": 368,
        "content": "### 2. AI Agent Fills Fields\nThe AI Agent node receives the form fields and applicant data directly in its prompt (no separate Code node needed). The system message instructs the AI to return only a r"
      }
    },
    {
      "id": "a814d65f-433c-43f7-b78e-0d0a4181baea",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        1088
      ],
      "parameters": {
        "width": 576,
        "height": 336,
        "content": "### 3. Fill Form & Save\nThe Prepare Fill Data code node parses and validates the AI JSON, then passes it to the Autype Fill Form operation. Fields are flattened (non-editable). The result is saved to "
      }
    },
    {
      "id": "244791c0-c74a-4c66-abef-92f001778d13",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1280,
        848
      ]
    },
    {
      "id": "cfcbc604-e525-4c19-8338-6e58cddc9177",
      "name": "Get tool job status",
      "type": "n8n-nodes-autype.autype",
      "position": [
        1440,
        848
      ]
    }
  ],
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Get tool job status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Prepare Fill Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Workflow": {
      "main": [
        [
          {
            "node": "Download PDF Form",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fill PDF Form": {
      "main": [
        [
          {
            "node": "Save Filled PDF to Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Form Fields": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload PDF Form": {
      "main": [
        [
          {
            "node": "Get Form Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download PDF Form": {
      "main": [
        [
          {
            "node": "Upload PDF Form",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Fill Data": {
      "main": [
        [
          {
            "node": "Fill PDF Form",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get tool job status": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}