AI Document Generation and Google Drive Storage using Claude Skills - n8n Workflow

Automate document creation (PDF, PPTX, DOCX, XLSX) using an n8n workflow and Anthropic Claude AI skills. Automatically download files and upload them to Google Drive.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Content creators needing quick, professionally formatted documents.

  • Businesses automating report generation and document processing.

  • Developers exploring advanced AI agent skills within an n8n workflow structure.

  • Teams looking for robust n8n templates for document automation.

Overview

This powerful n8n workflow demonstrates how to leverage advanced Large Language Model (LLM) capabilities—specifically Anthropic’s Agent Skills—to perform complex, multi-format document generation. The system initiates when a user submits a prompt via the initial n8n trigger form, specifying the desired output format (PDF, DOCX, PPTX, or XLSX). The workflow routes the request to the relevant Claude skill with detailed system prompts ensuring professional formatting, clear structure, and readability.

Once the document is generated by the AI, the n8n workflow automatically handles the technical steps: parsing the response to extract the unique file ID, downloading the binary data, and finally uploading the resulting file to Google Drive. This n8n node combination creates a seamless, automated pipeline, saving substantial manual effort involved in AI interaction, file handling, and cloud storage management. This complete n8n template provides a robust solution for advanced document generation.

How it Works

This n8n workflow operates in three main stages:


  1. Initiation and Routing: The process begins with the On form submission n8n trigger node, where the user inputs their Prompt and selects the File Type. The data is then passed to the Switch n8n node, which dynamically routes the request to the specific generation branch (PPTX, PDF, DOCX, XLSX) based on the user's selection.

  2. AI Generation and File ID Retrieval: In each branch, a specialized HTTP Request n8n node (Create PPTX, Create PDF, etc.) sends the user's prompt to the Anthropic Messages API, utilizing a powerful system prompt and the respective proprietary skill (pdf, docx, pptx, xlsx). Once the file is created by Claude, the resulting JSON response is processed by a custom Code n8n node (e.g., Extract PDF file_id). This crucial step uses custom logic to recursively search for and extract the file ID required for downloading.

  3. Download and Storage: The extracted file ID is used in a subsequent HTTP Request n8n node (e.g., Download PDF) to fetch the binary file content from the Anthropic API. Finally, the binary file data is passed to the Google Drive n8n node, which performs the final action: uploading the generated file to a predefined folder in Google Drive, completing the entire n8n automation.

Installation Guide

To deploy this powerful n8n template, follow these steps:


  1. Import: Copy the provided JSON code and import it directly into your n8n instance.

  2. Anthropic API Credentials: This n8n workflow requires an API key for Anthropic. You must create a new 'HTTP Header Auth' credential, using x-api-key as the header name and your Anthropic API key as the value. Apply this credential to all HTTP Request nodes (Create..., Download..., and Get All Skills). Ensure the Anthropic API is configured to allow Agent Skills and file API access.

  3. Google Drive Authentication: Set up an OAuth2 credential for Google Drive. Apply this credential to all Google Drive n8n nodes (Upload...).

  4. Google Drive Configuration: For each Upload... n8n node, verify and set the desired target Folder ID where the generated documents should be stored.

  5. Activation: Activate the n8n workflow. Access the URL provided by the On form submission n8n trigger to start testing the document generation.

Node Details

On form submission (n8n trigger):
Function: Starts the n8n workflow upon receiving a submission from a public web form.
Key Configuration: Captures two inputs: Prompt (the content request) and File Type (a dropdown allowing selection of PPTX, PDF, DOCX, or XLSX).
Switch (n8n node):
Function: Routes the execution path based on the user's selected File Type input.
Key Configuration: Four distinct output branches corresponding to the four possible file types.
Create PPTX / PDF / DOCX / XLSX (HTTP Request n8n node):
Function: Communicates with the Anthropic /v1/messages API to generate the document using specialized Agent Skills.
Key Configuration: Uses a detailed system prompt describing professional formatting requirements and dynamically injects the user's prompt using the expression {{ $('On form submission').item.json.Prompt }}.
Extract ... fileid (Code n8n node):
Function: Parses the complex JSON output from the Anthropic API response using custom JavaScript logic to reliably locate and output the critical fileid needed for download.
Download ... (HTTP Request n8n node):
Function: Downloads the generated file content from the Anthropic files API endpoint.
Key Configuration: Uses the file ID extracted in the previous n8n node (=https://api.anthropic.com/v1/files/{{ $json.file_id }}/content) and is configured to return the response in file (binary) format.
Upload ... (Google Drive n8n node):
Function: Takes the binary data from the Download step and uploads it to Google Drive.
* Key Configuration: Sets the filename dynamically using data from the binary object (={{ $binary.data.fileName}}) and specifies a target Folder ID.

Related n8n Workflows

Free

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

Full-stack Web Developer based in Italy specialising in Marketing & AI-powered automations. For business enquiries, send me an email at [email protected] or add me on Linkedin.com/in/davideboizza

Featured*