Generate C API HTML docs from Google Drive headers with GPT-4o and Gmail
๐ Overview
This n8n workflow automatically generates professional API documentation from C header (.h) files using AI.
It scans a Google Drive folder for header files, extracts the source code, sends it to GPT-4o for structured analysis, and generates a beautiful HTML documentation page. The final documentation is uploaded back to Google Drive and a completion email is sent.
This workflow is ideal for embedded systems teams, firmware engineers, and SDK developers who want an automated documentation pipeline.
โจ Key Features
โก Fully automated documentation generation
๐ Reads .h files directly from Google Drive
๐ค Uses AI to analyze C APIs and extract documentation
๐ Generates clean HTML documentation
๐ Documents functions, types, enums, and constants
๐ Processes files one-by-one for reliability
โ๏ธ Saves generated documentation back to Google Drive
๐ง Sends a completion email notification
๐ง What the AI Extracts
The workflow automatically identifies and documents:
๐ Overview of the header file ๐ง Functions Signatures Parameters Return values Usage examples ๐งฉ Enumerations ๐งฑ Data Types & Structures ๐ข Constants / Macros ๐ Developer Notes
๐ฅ Generated Documentation
The output is a clean developer-friendly HTML documentation page including:
๐งญ Sidebar navigation ๐ Function cards ๐ Parameter tables ๐ป Code examples ๐จ Professional developer layout
Perfect for:
Developer portals SDK documentation Internal engineering documentation Embedded system libraries
โ๏ธ Workflow Architecture
| Step | Node | Purpose | |-----|-----|--------| | 1 | โถ๏ธ Manual Trigger | Starts the workflow | | 2 | ๐ Get all files | Reads files from Google Drive | | 3 | ๐ Filter .h files | Keeps only header files | | 4 | ๐ Split in Batches | Processes files sequentially | | 5 | โฌ๏ธ Download file | Downloads the header file | | 6 | ๐ Extract text | Extracts code content | | 7 | ๐ค AI Extraction | AI extracts API structure | | 8 | ๐งน Parse JSON | Cleans AI output | | 9 | ๐จ Generate HTML | Builds documentation page | |10 | โ๏ธ Upload to Drive | Saves documentation | |11 | ๐ง Email notification | Sends completion email |
๐ง Requirements
To run this workflow you need:
๐น Google Drive OAuth2 credentials
๐น OpenAI API credentials
๐น Gmail credentials
๐ Setup Guide
1๏ธโฃ Configure Google Drive
Create two folders.
Source folder
Output folder
Update the folder IDs in the nodes:
Get all files from folder Save documentation to Google Drive
2๏ธโฃ Configure OpenAI
Add an OpenAI credential in n8n.
Model used:
The model analyzes C header files and returns structured API documentation.
3๏ธโฃ Configure Gmail
Add a Gmail OAuth credential.
Update the recipient address inside:
โถ๏ธ Run the Workflow
Click Execute Workflow.
The workflow will:
1๏ธโฃ Scan the Google Drive folder
2๏ธโฃ Process each .h file
3๏ธโฃ Generate HTML documentation
4๏ธโฃ Upload documentation to Drive
5๏ธโฃ Send a completion email
๐ผ Documentation Preview
๐ก Use Cases
๐ง Embedded firmware documentation
๐ฆ SDK documentation generation
๐งโ๐ป Developer portal automation
๐ C library documentation
โ๏ธ Continuous documentation pipelines
๐ฎ Future Improvements
This workflow can be extended with several enhancements:
๐ PDF Documentation Export Add a step to convert the generated HTML documentation into PDF files using tools such as:
Puppeteer HTML-to-PDF services n8n community PDF nodes
This allows teams to distribute documentation as downloadable reports.
๐ Local AI for Security (Ollama / Open-Source Models)
Instead of using the OpenAI node, the workflow can be modified to run fully locally using AI models such as:
Ollama** Open-source LLMs (Llama, Mistral, CodeLlama)**
These models can run on your own server, which provides:
๐ Better data privacy
๐ข No external API calls
โก Faster responses on local infrastructure
๐ก Increased security for proprietary source code
This can be implemented in n8n using:
HTTP Request node โ Ollama API** Local AI inference servers Private LLM deployments
๐ Multi-Language Documentation
The workflow could also support additional languages such as: .c .cpp .hpp .rs .go
Related Templates
Automatic News Summarization & Email Digest with GPT-4, NewsAPI and Gmail
๐ฐ AI News Digest Agent: Auto News Summarizer & Email Newsletter Create an intelligent news curation system that automat...
Auto-classify Gmail emails with AI and apply labels for inbox organization
Who is this for? Professionals and individuals who receive high volumes of emails, those who want to automatically organ...
Generate Product Ad Copy & CTAs with GPT-4 for Slack and Airtable
โก AI Copywriter Pro: Instant Ad Copy & CTA Generator Transform product details into compelling marketing copy in second...
๐ Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments