Skip to content
 
 

Repository files navigation

n8n-nodes-md-to-docs

Banner image

n8n-nodes-md-to-docs

This is an n8n community node. It lets you use Markdown to Google Docs conversion in your n8n workflows.

Google Docs is a popular online document editor that allows you to create, edit, and collaborate on documents in real time. With this node, you can automate the process of turning Markdown into beautifully formatted Google Docs—no more manual copy-paste!

n8n is a fair-code licensed workflow automation platform.


📦 Installation 🛠️ Operations 🔑 Credentials ✅ Compatibility 📖 Usage 🔗 Resources 📅 Version history

Installation

Install in your n8n instance:

npm install n8n-nodes-md-to-docs

Restart n8n to load the new node.

Follow the installation guide in the n8n community nodes documentation.


Operations

  • Create Document: Instantly create a Google Docs document from Markdown content.
  • Convert to API Requests: Transform Markdown into Google Docs API request JSON (for advanced HTTP Request node usage).
  • Test Credentials: Verify your Google API credentials and permissions.

Credentials

This node requires Google API credentials to authenticate with Google Docs and Google Drive services.

🚀 Prerequisites

  • Google Cloud Account - Free tier available
  • Google Cloud Project - Create one in Google Cloud Console
  • n8n Instance - Running version 1.0.0 or higher

🔧 Authentication Methods

  • OAuth2 (Recommended)
    • Best for personal and small team use
    • User-friendly consent flow
    • Automatic token refresh

⚙️ Quick Setup

⚠️ Important: This node requires Google API credentials to function.

📖 Detailed Setup Guide: See Google Cloud Console Documentation for complete OAuth2 setup instructions.

Essential Steps:

  1. 🌐 Enable APIs in Google Cloud Console:

    • Google Docs API
    • Google Drive API
  2. 🔐 Create OAuth2 Credentials with required scopes:

    • https://www.googleapis.com/auth/documents
    • https://www.googleapis.com/auth/drive.file
  3. ⚡ Configure Credential in n8n:

    • Add new Google OAuth2 API credential
    • Enter your Client ID and Client Secret
    • Complete OAuth flow
  4. ✅ Verify Setup:

    • Use Test Credentials operation
    • Check for successful connection

Compatibility

Minimum Requirements:

  • n8n version: 1.0.0 or higher
  • Node.js: 20.15.0 or higher
  • API Version: n8n Nodes API v1

Tested Versions:

  • ✅ n8n v1.82.0+ (latest stable)
  • ✅ n8n v1.70.0+ (recent versions)
  • ✅ Node.js v20.15.0+ (LTS)

Known Compatibility:

  • Google APIs: Docs API v1, Drive API v3
  • Modern Browsers: Chrome 90+, Firefox 88+, Safari 14+
  • AI Agents: Compatible with usableAsTool: true
  • Community Nodes: Full n8n community node standards

Potential Issues:

  • ⚠️ Older n8n versions (< 1.0.0): May not support latest node API features
  • ⚠️ Node.js < 20: Not tested and may have compatibility issues
  • ⚠️ Google API changes: Will be updated as needed

Usage

This node provides powerful Markdown to Google Docs conversion with advanced formatting capabilities. Here's how to use it effectively:

🚀 Quick Start

  1. Add the "Markdown to Google Docs" node to your workflow.
  2. Select the "Create Document" operation (this is the default).
  3. Choose your Google Drive and destination Folder where the document will be created.
  4. Set a Title for your new document.
  5. Input your Markdown content in the text area.
  6. (Optional) Use "Additional Options" to create a document from a template or use placeholders.
  7. Execute the node! Your document will be created in the specified location.

Pro tip: Supports advanced formatting, images (via public URLs), tables, checkboxes, and even deep list nesting.

For more help, see the n8n Try it out documentation.


🎯 Key Features

✨ Core Capabilities:

  • Full Markdown to Google Docs conversion
  • Headers, bold/italic, links, lists, code blocks
  • Multiple output formats (single/multiple requests)
  • AI Agent Tool compatibility (usableAsTool: true)

🚀 Advanced Features:

  • Nested Formatting: Complex combinations like bold and italic together
  • Smart Tables: Header styling (bold + centered) with full cell formatting
  • Deep Nesting: Unlimited list levels with proper indentation
  • Image Embedding: Direct URL-based image insertion with optional sizing
  • Checkbox Lists: Native Google Docs checkboxes for task lists
  • Precise Positioning: Accurate text range calculations for Google Docs API

✨ Template and Text Placeholder System:

  • Use Any Doc as a Template: Select any Google Doc from your Drive to use as a template. The node preserves headers and footers, only replacing the body content.
  • Dynamic Text Placeholder Replacement:
    • Use text placeholders like {{key}} anywhere in your template (headers, footers, body).
    • Provide a JSON object with corresponding key-value pairs (e.g., { "key": "Your Value" }) to replace them dynamically.
    • Supports n8n expressions for generating values on the fly.
  • Smart Markdown Injection:
    • By default, your Markdown input replaces the entire body of the template.
    • Optionally, specify a "Main Content Placeholder" (e.g., {{MainContent}}) in your template body. The node will replace only this specific placeholder with your rendered Markdown.
    • The Markdown input can be disabled entirely if you only need to replace simple placeholders.

📋 Image Support Notes:

  • URL-based images: Direct embedding from public URLs (![alt](https://example.com/image.png))
  • Optional sizing: Width/height attributes supported
  • ⚠️ URL requirements: Must be publicly accessible, under 2KB URL length
  • Local files: File uploads not supported (URL-only)

🤖 AI Agent Integration

Perfect for AI-powered workflows:

// Import the processor
import { MarkdownProcessor } from 'n8n-nodes-md-to-docs';

// AI Agent can automatically use this node
const markdownContent = await aiAgent.generateMarkdown(userInput);
const googleDocsRequests = MarkdownProcessor.convertMarkdownToApiRequests(
  markdownContent,
  'AI Generated Document Title',
  'single'
);

Available in n8n workflows:

  • Node name: markdownToGoogleDocs
  • AI Tool compatibility: usableAsTool: true
  • Automatic parameter detection for AI agents

✅ Supported Elements

Element Google Docs Output Status
# Headers Styled headings (H1-H6)
**bold** / *italic* Text formatting + nested combinations
[links](url) Hyperlinks in any context
- lists / 1. lists Bulleted/numbered with unlimited nesting and multi-line items
- [x] / - [ ] Native Google Docs checkboxes
`code` Monospace formatting + syntax highlighting
| tables | Structured tables with header styling
> quotes Indented blockquote with internal formatting
--- Horizontal rules
![images](url) Embedded images (URL only)

Resources


Version History

📅 Full changelog


🚀 Advanced Examples

Example Markdown Input

# My Document Title

This is a **bold statement** with *italic emphasis*.

## Features List

1. First feature
2. Second feature
   - Sub-feature A
   - Sub-feature B

### Code Example

\`\`\`javascript
const greeting = "Hello World!";
console.log(greeting);
\`\`\`

> Important note: This will be formatted as a blockquote.

![Example Image](https://via.placeholder.com/300x200.png?text=Sample+Image)

| Feature  | Status |
| -------- | ------ |
| **Bold** ||
| *Italic* ||

JSON Output Structure

{
  "documentTitle": "My Document Title",
  "createDocumentRequest": {
    "title": "My Document Title"
  },
  "batchUpdateRequest": {
    "requests": [
      {
        "insertText": {
          "location": { "index": 1 },
          "text": "My Document Title\\n\\n"
        }
      },
      {
        "updateTextStyle": {
          "range": { "startIndex": 1, "endIndex": 18 },
          "textStyle": { "bold": true, "fontSize": { "magnitude": 24, "unit": "PT" } },
          "fields": "bold,fontSize"
        }
      }
    ]
  }
}

⚙️ Configuration Options

Main Parameters

Parameter Type Description
operation options "convertToApiRequests" or "createDocument"
driveId resourceLocator The Google Drive to create the document in.
folderId resourceLocator The folder within the selected drive.
documentTitle string Title for the Google Docs document
markdownInput string The Markdown content to convert
outputFormat options "single" or "multiple" request format

Advanced Options (additionalOptions)

The additionalOptions parameter provides access to advanced features like templates and placeholders. When you add options, you can configure the following nested structure:

  • templateSettings (fixedCollection): Enables creation from a template.
    • templateFolderId (resourceLocator): The folder containing the Google Docs templates.
    • templateDocumentId (resourceLocator): The specific template document to use.
    • placeholders (collection): Enables placeholder replacement within the selected template.
      • placeholderSettings (fixedCollection): Contains settings for placeholder data and Markdown injection.
        • placeholderData (json): A JSON object of key-value pairs for placeholders (e.g., { "key": "value" }).
        • useMarkdownInput (boolean): Whether to use the Markdown content. If disabled, the node only replaces placeholders.
        • mainContentPlaceholder (string): The specific placeholder (e.g., {{MainContent}}) to be replaced by the Markdown content. If not specified, the entire document body is replaced.

🛠️ Development

Setup

git clone <your-repo>
cd n8n-nodes-md-to-docs
npm install

Build

npm run build

Lint

npm run lint
npm run lintfix

Test Locally

# Link for local development
npm link
cd ~/.n8n/nodes
npm link n8n-nodes-md-to-docs

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

🗺️ Roadmap

Completed Features

  • Advanced Table Support: Complete table conversion with header formatting (bold + centered) and cell-level formatting
  • Nested Formatting: Complex combinations like bold and italic together with perfect range calculations
  • Deep List Nesting: Unlimited levels of nested lists with proper Google Docs bullet handling
  • Smart Range Calculations: Precise text positioning accounting for Google Docs API behavior
  • Mixed Content Formatting: Bold, italic, code, and links working in all contexts (lists, tables, quotes)
  • Comprehensive Markdown Support: Headers, paragraphs, blockquotes, code blocks, horizontal rules
  • Direct Integration: One-click document creation with createDocument operation - no HTTP Request node needed
  • Checkbox Lists: Native Google Docs checkboxes for - [x] and - [ ] syntax with proper checked/unchecked states
  • Image Support: Convert Markdown images to Google Docs embedded images (URL-based only)
  • Template and Text Placeholder System: Create documents from a template, preserving headers/footers and replacing dynamic text {{placeholders}}.
  • Enhanced List Support: Flawless rendering of multi-line and deeply nested list items with accurate inline formatting.

🚀 Future Enhancements

  • Local Image Upload: Support for local image file uploads and conversion
  • Advanced Table Features: Column alignment, table styling options, merged cells
  • Custom Styling: User-defined fonts, colors, and spacing
  • Batch Processing: Handle multiple Markdown files in a single operation
  • Export Options: Support for additional output formats (PDF, DOCX)
  • Collaborative Features: Document sharing and permission management

📄 License

MIT © Georgi Kyosev


Made with ❤️ for the n8n community


Tags: n8n, markdown, google-docs, automation, community-node, n8n-workflow, document-generation

About

Markdown to Google Docs node for n8n – workflow automation, community node, Google Docs integration

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages