n8n Dropbox Google Drive Microsoft Office: File Automation

I automate file operations across cloud storage platforms with n8n because moving documents between Dropbox, Google Drive, and Microsoft Office shouldn’t require logging into three different dashboards. My workflows handle uploads, downloads, conversions, and document transformations — all triggered by events or schedules.

Each platform offers an API with distinct capabilities. Dropbox excels at file syncing and version management. Google Drive integrates tightly with Google Workspace for document editing. Microsoft Office 365 provides powerful Word, Excel, and PowerPoint manipulation. n8n connects to all three through dedicated nodes and HTTP Request calls.

File Operations with Dropbox and Google Drive

Dropbox operations are straightforward. The n8n Dropbox node handles listing folders, uploading files, downloading content, and managing versions. I use it primarily for file ingestion and archival.

`javascript
// Dropbox node: upload file
Operation: File Write
Path: /automated/reports/monthly.pdf
Content: {{report_pdf_binary}}

// Dropbox node: list folder contents
Operation: List Folder
Path: /incoming
Recursive: false
`

Google Drive requires OAuth 2.0 setup in Google Cloud Console. Once configured, the n8n Google Drive node manages files, folders, and permissions:

`javascript
// Google Drive node: create file from binary data
Operation: Create
Name: quarterly-report.xlsx
Mime Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Content: {{spreadsheet_binary}}
Parents: [‘folder_id_here’]

// Google Drive node: share file
Operation: Create Share
File Id: {{file_id}}
Type: anyone
Role: reader
`

I chain Dropbox and Google Drive together for cross-platform sync. A file lands in Dropbox, a webhook or cron triggers the n8n workflow, and the file copies to a Google Drive folder with updated metadata. The Switch node routes files based on extension or folder path.

For large files, I use the HTTP Request node with chunked uploads. Google Drive’s resumable upload protocol handles files larger than 5MB reliably:

`javascript
// Step 1: Get upload URL
Method: POST
URL: https://www.googleapis.com/upload/drive/v3/files?uploadType=resumable
Headers: { Authorization: Bearer {{token}}, Content-Type: application/json }
Body: { “name”: “large-file.zip”, “mimeType”: “application/zip” }

// Step 2: Upload data to the returned URL
Method: PUT
URL: {{upload_url_from_step1}}
Headers: { Authorization: Bearer {{token}}, Content-Length: {{file_size}} }
Body: {{file_binary}}
`

Microsoft Office Document Processing

Microsoft Graph API powers Office 365 operations in n8n. I use it to read and write Excel spreadsheets, generate Word documents, and create PowerPoint presentations programmatically.

Excel operations are the most common. I read data from shared spreadsheets, transform it, and write results back:

`javascript
// Microsoft Graph node: read Excel range
Operation: Read Worksheet
Drive Id: {{drive_id}}
Item Id: {{file_id}}
Sheet Name: Data
Range: A1:D100

// Microsoft Graph node: write Excel range
Operation: Write Worksheet
Drive Id: {{drive_id}}
Item Id: {{file_id}}
Sheet Name: Results
Range: A1:E20
Values: {{transformed_data_array}}
`

For Word documents, I generate content from templates. A JSON payload fills placeholders in a DOCX file stored in SharePoint:

`javascript
// HTTP Request to Word REST API
Method: POST
URL: https://graph.microsoft.com/v1.0/me/drive/items/{{doc_id}}/open
Body: { “powerView”: false }

// Then use the Word node to insert content
// Microsoft Word node: insert paragraph
Operation: Insert Paragraph
Position: after
Text: {{generated_summary}}
Style: Heading1
`

PowerPoint automation handles slide deck generation for weekly reports. I clone a master template and populate slides with data from n8n’s workflow execution:

`javascript
// Microsoft PowerPoint node: add slide
Operation: Add Slide
Template Id: {{master_template_id}}
Layout: TitleAndContent
Title: {{week_title}}
Content: {{bullet_points_array}}
`

Document Conversion and Transformation

Files often need conversion between formats. PDF to Excel, Word to HTML, or images to text — n8n handles these through external APIs or built-in nodes.

For PDF conversion, I use the HTTP Request node to call a conversion service:

`javascript
// Convert PDF to text
Method: POST
URL: https://api.pdfconverter.com/v1/convert
Headers: { Authorization: Bearer {{api_key}}, Content-Type: multipart/form-data }
Body: { file: {{pdf_binary}}, to_format: ‘txt’ }
`

Spreadsheet transformation happens in n8n’s Code node. I read data from Google Sheets, apply business logic, and write formatted results back:

`javascript
// Code node: transform spreadsheet data
const rows = item.json.values || [];
const header = rows[0];
const data = rows.slice(1);

const transformed = data.map(row => {
const record = {};
header.forEach((col, i) => {
record[col] = row[i] || ”;
});
record.status = record.revenue > 1000 ? ‘active’ : ‘inactive’;
return record;
});

return transformed.map(r => ({ json: r }));
`

Connecting to Your Existing Setup

The n8n Docker Deployment guide covers setting up your instance. API keys for Dropbox, Google Drive, and Microsoft Office store in n8n’s credential manager for secure reuse.

For environment configuration, the n8n Docker Environment Variables reference details the variables needed for file storage limits, timeout settings, and binary data handling in large file transfers.

Action Card: Cross-Platform File Sync

Simple workflow to copy a file from Dropbox to Google Drive:

`javascript
// 1. Dropbox node: Download File
// Operation: Download File
// Path: /reports/annual-summary.pdf

// 2. Google Drive node: Create File
// Operation: Create
// Name: annual-summary-{{new Date().toISOString().slice(0,10)}}.pdf
// Mime Type: application/pdf
// Content: {{$binary.data.data}}
// Parents: [‘your_drive_folder_id’]

// 3. Dropbox node: Delete File (optional cleanup)
// Operation: Delete File
// Path: /reports/annual-summary.pdf
`

This three-step sync runs automatically when a new report lands in Dropbox. No manual file management needed.

References

  • Dropbox API Documentation
  • Google Drive API
  • Microsoft Graph API
  • n8n Dropbox Node
  • n8n Google Drive Node
  • Leave a Reply

    Your email address will not be published. Required fields are marked *