Markdown to Google Docs Document Converter with Automatic Formatting - n8n Workflow

Use this efficient n8n workflow to automate converting structured Markdown content into a fully formatted Google Docs document. This n8n template handles HTML conversion and file creation seamlessly.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Technical Content Writers who draft documentation in Markdown.

  • Bloggers and publishers looking for an automated draft-to-review pipeline.

  • Users needing reliable n8n templates to handle document conversion and cloud storage operations.

  • Anyone seeking to automate the creation of richly formatted documents in Google Drive.

Overview

Manually converting detailed Markdown documents into Google Docs often results in lost formatting, requiring extensive manual cleanup. This custom n8n workflow solves this issue by systematically converting the Markdown content into HTML, ensuring all headers, lists, and formatting are preserved when imported into Google Docs. The core automation flow first creates an empty Google Doc file with a timestamped title and then updates that file with the rich HTML content. This powerful n8n solution eliminates manual steps, providing an efficient path for technical documentation and content preparation. Using the Google Drive n8n node, the process is fully integrated and robust.

How it Works

This automation begins with a manual n8n trigger, which initiates the process. The first n8n node, 'Set Input Data', defines the target Google Drive URL, the desired document title, and the source Markdown content. The workflow then splits into two crucial parallel paths.


  1. Document Creation Path: An empty Google Doc file is immediately created in the specified folder using the Google Drive n8n node. This captures the necessary Document ID.

  2. Content Preparation Path: The Markdown content is converted into HTML using the Markdown n8n node. Metadata containing the Google Drive link is prepended to the HTML. The content is then converted into a binary file (content.html). A critical step follows: a Code n8n node manually overrides the binary file’s MIME type to text/html. This ensures the subsequent Google Drive operation correctly interprets the content as rich HTML for formatting.

Once both branches complete, the workflow uses an n8n Merge node to combine the newly generated File ID (from the creation path) with the correctly formatted binary HTML content (from the preparation path). After a brief wait period via the Wait n8n node (to ensure Google Drive is ready), the final Google Drive n8n node updates the document using the binary HTML data, resulting in a fully formatted Google Doc.

Installation Guide

To utilize this n8n workflow, follow these steps:


  1. Import: Copy the provided n8n workflow JSON and paste it into your n8n instance under the Workflows section using the 'New' -> 'Import from JSON' option.

  2. Credentials: This n8n workflow requires OAuth2 credentials for the Google Drive n8n node. Ensure you have set up and connected your Google Drive service account or OAuth application.

  3. Configuration: Edit the 'Set Input Data' n8n node. Update the values for Google Drive URL (the folder where the document should be saved), Content Title, and replace the placeholder Polish text under Conten in Markdown with your desired Markdown content.

  4. Execute: Click the 'Test workflow' button on the manual n8n trigger node to run the entire flow and verify the creation of the formatted Google Doc in your specified Drive location. This n8n template is now ready for use.

Node Details

When clicking ‘Test workflow’ (Manual Trigger): The starting point for this specific n8n workflow. It acts as the manual n8n trigger to run the process on demand.
Set Input Data (Set n8n node): Defines essential variables for the rest of the flow, including the Google Drive destination URL, the final document title, and the source Markdown content.
Change Markdown To HTML (Markdown n8n node): Converts the input Markdown string into a rich HTML string, preserving formatting like headings and lists, which is vital for correct Google Docs conversion.
Convert Content to Text File (Convert To File n8n node): Takes the final HTML string and encapsulates it as a binary data object named 'file', preparing it for upload.
Change Mime Type of The File (Code n8n node): This is a custom n8n node script that forces the MIME type of the binary file from a default text type to text/html. This is a critical step for ensuring Google Drive renders the content as rich HTML during the update operation.
Create Empty File (Google Drive n8n node): Creates the initial placeholder document in Google Drive, utilizing the 'createFromText' operation with the convertToGoogleDocument option set to true. It captures the unique document ID required for the update.
Merge File With About Document ID (Merge n8n node): Synchronizes the two parallel branches, ensuring the binary HTML content is associated with the correct, newly created Google Document ID.
Update Document with Correct HTML Formatting (Google Drive n8n node): The final action. This n8n node uses the 'update' operation with the correctly MIME-typed HTML file to insert the rich content into the previously created Google Doc.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by

Featured*