{
  "name": "Parse Google Drive documents to RAG-ready Markdown with Landing.ai and Supabase cache",
  "nodes": [
    {
      "id": "ae71b344-7c55-44c4-aa85-0bf7c98b01ed",
      "name": "Google Drive Trigger",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -4752,
        1056
      ]
    },
    {
      "id": "a1ddcd25-b6ed-4e7f-997d-6f0f893b5579",
      "name": "Download File",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -4512,
        1056
      ]
    },
    {
      "id": "58bfad03-641b-435b-b82b-9c0d3e7e6cfa",
      "name": "Build Metadata",
      "type": "n8n-nodes-base.code",
      "position": [
        -4256,
        1056
      ]
    },
    {
      "id": "837cba7e-cbfa-46e3-a41c-0af41cb9c79c",
      "name": "Check Cache",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -4064,
        1408
      ]
    },
    {
      "id": "91528ec2-6093-416b-92a5-b815fccaeef8",
      "name": "Debug Cache Results",
      "type": "n8n-nodes-base.code",
      "position": [
        -3872,
        1408
      ]
    },
    {
      "id": "ccffb457-d7c9-42db-b844-2f2c76f8b634",
      "name": "If Cache Exists",
      "type": "n8n-nodes-base.if",
      "position": [
        -3664,
        1408
      ]
    },
    {
      "id": "43498f50-76e1-4306-9250-676af4a6472f",
      "name": "STOP — Cached",
      "type": "n8n-nodes-base.code",
      "position": [
        -3504,
        1216
      ]
    },
    {
      "id": "1618f07d-4cbf-417a-9398-158d1f430783",
      "name": "Submit to Landing.ai",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -3296,
        1424
      ]
    },
    {
      "id": "7b0eac38-d28d-4688-aa43-2d1e15735d9e",
      "name": "Merge Metadata + Job",
      "type": "n8n-nodes-base.merge",
      "position": [
        -3184,
        1072
      ]
    },
    {
      "id": "5292d205-eae3-4bc8-8df2-8d757a35941c",
      "name": "Init Loop State",
      "type": "n8n-nodes-base.code",
      "position": [
        -3008,
        1264
      ]
    },
    {
      "id": "129dcf01-4e0a-497a-98ee-8ac9edb4d747",
      "name": "Poll Job Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2448,
        1056
      ]
    },
    {
      "id": "e8e00ff9-db14-48d1-9f1a-830f918cadf0",
      "name": "If Completed",
      "type": "n8n-nodes-base.if",
      "position": [
        -2144,
        1040
      ]
    },
    {
      "id": "2bbc5bd9-b34a-4c8f-acea-679ea867f901",
      "name": "If Timeout",
      "type": "n8n-nodes-base.if",
      "position": [
        -1920,
        1280
      ]
    },
    {
      "id": "bc3c2ed9-2a88-41d5-a590-517796b347cc",
      "name": "Save Parse Result",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -1312,
        944
      ]
    },
    {
      "id": "dfef6daa-f3d3-497d-a69e-9552ff320e38",
      "name": "Log Timeout",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -1296,
        1264
      ]
    },
    {
      "id": "2d1212f3-a11d-4bfa-9e89-2ffa6291744c",
      "name": "STOP — Success",
      "type": "n8n-nodes-base.code",
      "position": [
        -1104,
        944
      ]
    },
    {
      "id": "37cdc78f-7bc6-451f-a294-778f40d4caf4",
      "name": "STOP — Timeout",
      "type": "n8n-nodes-base.code",
      "position": [
        -1072,
        1264
      ]
    },
    {
      "id": "c3bdb340-189a-4d97-a9f8-d596af91eb34",
      "name": "check-large-file",
      "type": "n8n-nodes-base.if",
      "position": [
        -1920,
        928
      ]
    },
    {
      "id": "7b1b831c-4238-49b7-a189-91b3fa1973e8",
      "name": "HTTP Request1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1664,
        656
      ]
    },
    {
      "id": "aa24e110-5823-45fa-9be8-4fc62b15277a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -5712,
        704
      ],
      "parameters": {
        "width": 896,
        "height": 1632,
        "content": "## Make your unstructured large documents LLM ready markdown using LandingAI Document Parsing.\n\n- Automatically watches a Google Drive folder, submits new documents to Landing.ai for parsing, caches p"
      }
    },
    {
      "id": "e7d787ba-ca6a-41d1-843d-9d29e65dc47d",
      "name": "wait till interval set time",
      "type": "n8n-nodes-base.wait",
      "position": [
        -2816,
        1264
      ]
    },
    {
      "id": "dfba2cb1-988c-4c68-9eff-63e201c5ef9a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4800,
        944
      ],
      "parameters": {
        "width": 752,
        "height": 336,
        "content": "##  Fetch file from Google drive"
      }
    },
    {
      "id": "dd97df20-c80d-4ff1-b660-3489e4d43123",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4112,
        1344
      ],
      "parameters": {
        "width": 576,
        "height": 256,
        "content": "Check Cache"
      }
    },
    {
      "id": "e60c91b1-aa45-4640-94b5-552e49f5e33d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3344,
        608
      ],
      "parameters": {
        "width": 2576,
        "height": 1088,
        "content": "## Get Parse data "
      }
    },
    {
      "id": "c9e65414-6724-4508-9426-15c833fc963e",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3344,
        1712
      ],
      "parameters": {
        "width": 336,
        "height": 128,
        "content": "Check how to get api key for landingAI here https://docs.landing.ai/ade/agentic-api-key"
      }
    },
    {
      "id": "0b157a3e-9599-4841-a87b-cf300d237b7e",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1344,
        1488
      ],
      "parameters": {
        "width": 400,
        "height": 192,
        "content": "## Supabase setup\n\n - Create a **Supabase account** and set up a project.  \n- Create a **bucket** in Supabase (e.g., `test-n8n`).  \n- Get your **Project URL** and **Anon Key** from Supabase.  \n- In n8"
      }
    }
  ],
  "connections": {
    "If Timeout": {
      "main": [
        [
          {
            "node": "Log Timeout",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "wait till interval set time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Cache": {
      "main": [
        [
          {
            "node": "Debug Cache Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Timeout": {
      "main": [
        [
          {
            "node": "STOP — Timeout",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Completed": {
      "main": [
        [
          {
            "node": "check-large-file",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If Timeout",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download File": {
      "main": [
        [
          {
            "node": "Build Metadata",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "Save Parse Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Metadata": {
      "main": [
        [
          {
            "node": "Check Cache",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge Metadata + Job",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Cache Exists": {
      "main": [
        [
          {
            "node": "STOP — Cached",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Submit to Landing.ai",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Init Loop State": {
      "main": [
        [
          {
            "node": "wait till interval set time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Poll Job Status": {
      "main": [
        [
          {
            "node": "If Completed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "check-large-file": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Save Parse Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Parse Result": {
      "main": [
        [
          {
            "node": "STOP — Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Debug Cache Results": {
      "main": [
        [
          {
            "node": "If Cache Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Download File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Metadata + Job": {
      "main": [
        [
          {
            "node": "Init Loop State",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Submit to Landing.ai": {
      "main": [
        [
          {
            "node": "Merge Metadata + Job",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "wait till interval set time": {
      "main": [
        [
          {
            "node": "Poll Job Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}