A Firebase function that converts Markdown content to Google Docs format, specifically designed for n8n workflows. It seamlessly integrates with n8n's Google OAuth credentials and is perfect for converting LLM outputs into properly formatted Google Docs.
This project solves a common challenge in n8n workflows where you need to convert markdown output (especially from LLM nodes) into properly formatted Google Docs. While n8n's default Google Docs node doesn't support markdown formatting, this service provides a simple solution by accepting markdown content and creating a beautifully formatted Google Doc. The service is designed to work with n8n's Google OAuth credentials, making it a perfect drop-in solution for your n8n workflows.
- Works with your existing n8n Google OAuth credentials
- No additional authentication setup required
- Perfect for processing LLM node outputs
- Seamless integration with n8n HTTP Request node
- Maintains formatting that n8n's native Google Docs node doesn't support
The service handles various Markdown elements including:
- Headings (H1-H6)
- Paragraphs with proper spacing
- Lists with proper indentation
- Bold text formatting
- Multiple line breaks
- Consistent font styling and sizing
The service is freely available at: https://md2doc.n8n.aemalsayer.com
Send a POST request with:
{
"output": "# Your Markdown Content\n\nThis is a **bold** statement",
"fileName": "My Generated Doc"
}
Required headers:
Content-Type: application/json
Authorization: Bearer YOUR_N8N_GOOGLE_OAUTH_TOKEN
// Uses your n8n Google OAuth credentials
You can also fork this repository and host it on your own infrastructure.
Watch how the converter works in this demonstration:
- Serverless architecture using Firebase Functions
- OAuth2 authentication for Google Docs API
- Clean and consistent document formatting
- Maintains document hierarchy and styling
- Handles complex Markdown structures
- Perfect for n8n workflows with LLM outputs
- Clone the repository
- Install dependencies:
bun install
- Set up Firebase:
firebase login
firebase init functions
Add an HTTP Request node and configure it as follows:
- Method:
POST
- URL:
https://md2doc.n8n.aemalsayer.com
- Authentication:
- Predefined Credential Type
- Credential Type:
Google Docs OAuth2 API
- Select your Google Docs account
Set up the body parameters:
{
"output": "{{$json.output}}",
"fileName": "Notes {{$now}}"
}
Key Configuration Points:
- Body Content Type:
JSON
- Send Body:
Enabled
- Specify Body:
Using Fields Below
- Parameters:
output
: Your markdown content (usually from an LLM node)fileName
: Name for the generated Google Doc (supports expressions)
The service will return a response with the Google Doc URL and ID.
This project is maintained by Aemal Sayer, a freelance AI engineer based in Berlin, Germany. With over 23 years of software development experience, including 8 years in ML/AI and 2 years specializing in AI Agents development, Aemal works with industry leaders like Klarna, Siemens, and Allianz to deliver transformative AI solutions.
- Website: aemalsayer.com
- Location: Berlin, Germany
- WhatsApp: +49 176 610 94 196
This project is licensed under the MIT License - see the LICENSE file for details.