{
  "name": "Generate C API HTML docs from Google Drive headers with GPT-4o and Gmail",
  "nodes": [
    {
      "id": "8655873a-3376-45e4-8311-68a646570e47",
      "name": "Extract from File2",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -208,
        544
      ]
    },
    {
      "id": "a0edb4ab-f3e6-4ff0-be75-a7ef3d6bfb39",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1520,
        448
      ]
    },
    {
      "id": "75a5f62e-1479-4845-84ce-283291ad65a5",
      "name": "Sticky Note — Step 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1520,
        256
      ],
      "parameters": {
        "width": 560,
        "height": 344,
        "content": "### 📁 Step 1 — Load Files\nTrigger manually, then fetch all files from the configured Google Drive folder and filter down to `.h` files only.\n\n⚙️ **To configure:** Open **Get all files from folder** an"
      }
    },
    {
      "id": "046dba14-4d05-491a-a311-2446963de7dd",
      "name": "Sticky Note — Step 8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -848,
        256
      ],
      "parameters": {
        "width": 252,
        "height": 424,
        "content": "### 🔁 Step 2 — Loop\nProcess one `.h` file at a time using **Split in Batches**.\n\nThe loop returns here after each file is saved to Drive, until all files are processed. When done, it branches to the e"
      }
    },
    {
      "id": "77d98362-d5c4-4be3-967d-da5fc59d573b",
      "name": "Sticky Note — Step 9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -464,
        416
      ],
      "parameters": {
        "width": 372,
        "height": 280,
        "content": "### 📥 Step 3 — Download & Read\nDownloads the binary file from Google Drive and extracts its raw text content, ready to be sent to GPT-4o."
      }
    },
    {
      "id": "6493ac89-3f40-45eb-822f-988d82f4a570",
      "name": "Sticky Note — Step 10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        256
      ],
      "parameters": {
        "width": 248,
        "height": 392,
        "content": "### 🤖 Step 4 — AI Extraction\nSends the raw `.h` file content to **GPT-4o** with a structured prompt.\n\nGPT returns a strict JSON object with:\n`overview` · `functions` · `enumerators` · `data_types` · `"
      }
    },
    {
      "id": "11cab0db-26db-4a64-ae73-c7601eefdf75",
      "name": "Sticky Note — Step 11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        320
      ],
      "parameters": {
        "width": 224,
        "height": 360,
        "content": "### 🔧 Step 5 — Parse Response\nStrips any markdown fences from the GPT response and parses it as JSON.\n\n💡 If parsing fails, the raw GPT text is placed in `overview` so you can debug what GPT returned."
      }
    },
    {
      "id": "f248ab44-1130-49c1-90f2-ec65567cc480",
      "name": "Sticky Note — Step 12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        224
      ],
      "parameters": {
        "width": 244,
        "height": 472,
        "content": "### 🎨 Step 6 — Generate HTML\nBuilds a fully styled HTML documentation file with:\n- Sidebar navigation\n- Hero header with metadata\n- Function cards with signature, params table & examples\n- Data types,"
      }
    },
    {
      "id": "ebb3f0fc-5d41-4022-a8d2-58b7b951c215",
      "name": "Sticky Note — Step 13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        224
      ],
      "parameters": {
        "width": 252,
        "height": 472,
        "content": "### 💾 Step 7 — Save to Drive\nUploads the generated `DOC_filename.html` file to the configured output folder in Google Drive.\n\n⚙️ **To configure:** Update the `folderId` in this node with your output f"
      }
    },
    {
      "id": "0410927e-234a-46f5-aca6-a9a60eeb56d0",
      "name": "Sticky Note — Email1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        -32
      ],
      "parameters": {
        "width": 440,
        "height": 340,
        "content": "### ✉️ Completion Email\nOnce all files are processed, the **Split in Batches** node exits the loop and triggers this branch.\n\nBuilds a summary email and sends it via **Gmail** to notify that all docs "
      }
    },
    {
      "id": "240eb434-776f-4195-a456-15a83b8f5d5a",
      "name": "Sticky Note — Overview1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1968,
        80
      ],
      "parameters": {
        "width": 396,
        "height": 678,
        "content": "# 📄 API Documentation Generator\n\nAutomatically generates **beautiful HTML documentation** from C header (`.h`) files stored in Google Drive.\n\n**How it works:**\n1. Reads all files from a specified Goog"
      }
    },
    {
      "id": "f63de4ea-6d88-4f10-a195-feb2f7b5f3ea",
      "name": "Get all files from folder",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1328,
        448
      ]
    },
    {
      "id": "14c89229-0249-4e47-a46c-1480e961b59c",
      "name": "Filter .h files only",
      "type": "n8n-nodes-base.code",
      "position": [
        -1104,
        448
      ]
    },
    {
      "id": "b2362399-2709-42d6-a294-5d834562a4b7",
      "name": "Process one file at a time",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -768,
        528
      ]
    },
    {
      "id": "e74de2b2-e2bf-4e9f-b191-e703a914cb15",
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -432,
        544
      ]
    },
    {
      "id": "477c9a71-e6b8-4125-8dca-9987320fda1a",
      "name": "Build email body",
      "type": "n8n-nodes-base.code",
      "position": [
        -400,
        160
      ]
    },
    {
      "id": "e350754f-4db4-407b-a6d0-ce199df685bd",
      "name": "Send completion email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -192,
        160
      ]
    },
    {
      "id": "8e43b277-9554-43e2-bc04-db84eadb6b51",
      "name": "Extract structured docs (GPT-4o)",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        16,
        544
      ]
    },
    {
      "id": "f463a4fa-5996-4e9d-8f10-bc2f9c54d4ad",
      "name": "Parse JSON response",
      "type": "n8n-nodes-base.code",
      "position": [
        352,
        544
      ]
    },
    {
      "id": "f7a197b7-3470-4ad5-a2bb-fa913c461969",
      "name": "Generate HTML",
      "type": "n8n-nodes-base.code",
      "position": [
        608,
        544
      ]
    },
    {
      "id": "0b63f327-e409-4fe9-8716-bf4d53697441",
      "name": "Save PDF to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        928,
        544
      ]
    }
  ],
  "connections": {
    "Download file": {
      "main": [
        [
          {
            "node": "Extract from File2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate HTML": {
      "main": [
        [
          {
            "node": "Save PDF to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build email body": {
      "main": [
        [
          {
            "node": "Send completion email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File2": {
      "main": [
        [
          {
            "node": "Extract structured docs (GPT-4o)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse JSON response": {
      "main": [
        [
          {
            "node": "Generate HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter .h files only": {
      "main": [
        [
          {
            "node": "Process one file at a time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save PDF to Google Drive": {
      "main": [
        [
          {
            "node": "Process one file at a time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all files from folder": {
      "main": [
        [
          {
            "node": "Filter .h files only",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process one file at a time": {
      "main": [
        [
          {
            "node": "Build email body",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract structured docs (GPT-4o)": {
      "main": [
        [
          {
            "node": "Parse JSON response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get all files from folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}