AI-Powered Document Generation, Google Drive Archive, and Slack Sharing - n8n Workflow

Use this comprehensive n8n workflow to generate professional, formatted PDFs from AI-driven Markdown content using Google Docs, archive the result in Google Drive, and instantly share it on Slack. This n8n workflow eliminates external libraries.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Teams requiring automated document generation (reports, proposals, guides) in PDF format.

  • Users looking for free, zero-dependency PDF creation within n8n.

  • Technical users and developers integrating large language models (LLMs) into document production pipelines.

  • Operations specialists needing automated archiving and distribution via Slack and Google Drive.

Overview

This powerful n8n workflow provides a 100% free solution for creating professionally formatted PDF documents without relying on external libraries or paid conversion services. It leverages the robust formatting capabilities of Google Docs and the content generation power of OpenAI.

The process begins with an n8n trigger, where an AI model generates highly structured Markdown content. The core innovation of this n8n workflow is the seamless conversion: the Markdown is uploaded to Google Drive using a specific HTTP Request n8n node, which automatically converts it into a Google Document. This Google Document is then exported as a high-quality PDF, archived in Google Drive, and finally distributed instantly via a dedicated Slack channel. This full-circle n8n automation is perfect for generating reports, technical guides, or proposals directly within your business processes.

How it Works

The entire process is managed sequentially through several critical n8n node steps:


  1. Start: The n8n workflow is initiated via the Manual Trigger n8n node, though this can easily be replaced by a Cron or Webhook n8n trigger for production use.

  2. AI Generation: The LLM (powered by an OpenAI n8n node) executes a detailed prompt to create a comprehensive sample Markdown document, demonstrating various text and data structures.

  3. Configuration: A Set n8n node configures necessary variables, including the target Google Drive Folder ID and a unique timestamp for the file name.

  4. Google Doc Creation: A crucial HTTP Request n8n node utilizes the Google Drive API to upload the raw Markdown content. By specifying the correct mimeType, this n8n node forces Google Drive to interpret the Markdown and convert it into a new, formatted Google Document.

  5. PDF Conversion: The Google Drive n8n node downloads the newly created document but specifies a conversion format (application/pdf), effectively generating the PDF file on the fly.

  6. Archiving: The generated PDF is uploaded and archived into the designated Google Drive folder using another Google Drive n8n node.

  7. Retrieval: The archived PDF is downloaded again to ensure the n8n workflow has the necessary file binary data and metadata for the final sharing step.

  8. Sharing: The final Slack n8n node uploads the PDF file to a predefined Slack channel, completing the document generation and distribution n8n template.

Installation Guide

To deploy this comprehensive n8n workflow template, follow these steps:


  1. Import: Copy the provided JSON data and paste it directly into your n8n instance using the 'New' -> 'Import from JSON' function.

  2. OpenAI Credentials: Locate the 'OpenAI Chat Model' n8n node. Configure or select your existing OpenAI API key credentials.

  3. Google Drive Credentials: Configure or select your Google Drive OAuth2 credentials. Ensure the credentials have full read/write access to the targeted drive/folder, as this n8n workflow uses advanced API calls (HTTP Request n8n node).

  4. Slack Credentials: Configure or select your Slack OAuth2 credentials. The associated bot token must have the files:write permission and be invited to the target channel.

  5. Configuration Node: In the 'Configure Google Drive Folder' Set n8n node, update the Drive Folder ID with the ID of the Google Drive folder where you want to archive the generated PDFs.

  6. Slack Channel ID: In the 'Send message' Slack n8n node, ensure the Channel ID matches the channel where the PDF should be posted. This completes the setup for this powerful n8n template.

Node Details

When clicking ‘Execute workflow’ (Manual Trigger n8n trigger): The starting point of the n8n workflow, allowing manual testing. For automation, replace this n8n trigger with a Webhook or Cron n8n node.
Generate sample markdown document (LangChain Agent n8n node): Uses a complex prompt instructing the connected OpenAI Chat Model to generate a full Markdown document showcasing various formatting elements.
Configure Google Drive Folder (Set n8n node): Defines two key variables: Drive Folder ID (the destination for archiving) and Today (a timestamp used for unique file naming).
Create document file (HTTP Request n8n node): This node is critical. It performs a POST request to the Google Drive upload endpoint, bundling the Markdown content in a multipart/related body. Key configuration includes using application/vnd.google-apps.document as the MIME type to initiate the Markdown-to-Google Docs conversion.
Convert document to PDF (Google Drive n8n node): Operates on the generated Google Doc ID. The operation is 'download', but the 'Google File Conversion' option is set to convert the document to application/pdf before downloading.
Archiving PDF File (Google Drive n8n node): Uploads the newly created PDF file into the designated Drive Folder ID for permanent storage.
Download attachment file (Google Drive n8n node): Downloads the archived file's binary data for subsequent steps, ensuring the Slack n8n node has the necessary payload.
Send message (Slack n8n node): The final action, uploading the PDF file to a specified Slack channel (C097VAKKPUP) with a static initial comment.

Related n8n Workflows

Free

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

Empowering small and medium businesses with smart automation and practical AI, no big tech team required.

Featured*