Google Docs Duplicate Document
Duplicates an entire Google Document with all content and formatting
Node Type
Action
Category
Google Integration
Icon
Google Docs
Overview
The Google Docs Duplicate Document node is an action node that creates a complete copy of a Google Document, preserving all content, formatting, and structure. This powerful integration allows you to duplicate documents directly in your workflows, enabling document templating, backup creation, and automated document management.
Key Features
- • Complete Document Duplication: Creates an exact copy with all content and formatting
- • OAuth Authentication: Secure access using user's Google account
- • Dynamic Document Selection: Browse and select from available documents
- • Custom Naming: Specify a new title for the duplicated document
- • Success Tracking: Returns operation status and new document information
- • Error Handling: Graceful handling of authentication and access issues
Prerequisites
Google Integration
Must have Google integration properly configured
Required OAuth Scopes
OAuth scopes needed for document duplication
Technical Requirements
Services needed for operation
Node Configuration
Required Fields
Document ID
The ID of the Google Doc to duplicate. This field provides dynamic selection options, allowing users to browse and select from their available Google Docs. The ID uniquely identifies the specific document in Google's system.
New Document Title
The title for the newly created duplicated document. This will be the name of the copy as it appears in Google Drive and Google Docs.
Technical Details
Document Duplication Process
How the node creates a complete copy of a Google Document
Input Validation
The node first validates the document ID and new title inputs. Ensures both are provided, returns error if missing, and prevents API calls with invalid inputs.
User Authentication
Retrieves the user ID from the workflow service and obtains their Google OAuth access token for secure API access to Google Drive and Docs.
Google Drive API Integration
How the node interfaces with Google's file services
Document Duplication
Uses the Google Drive API to create a complete copy of the specified document, preserving all content, formatting, and metadata.
File Naming
Sets the new document title as specified in the input, ensuring the duplicated document has a clear, user-defined name.
Response Processing
Extracts the new document ID and constructs the document URL for easy access to the duplicated document.
Dynamic Document Selection
How the node provides dynamic options for document selection
Document Listing
Implements the getDynamicSelectOptions method to fetch available Google Docs and provide them as selectable options in the UI.
User-Specific Access
Only shows documents that the authenticated user has access to, ensuring proper security and access control.
Error Handling
Gracefully handles authentication failures and API errors, returning an empty options list when document fetching fails.
Examples & Use Cases
Basic Document Duplication
Duplicate a Google Doc with a new title
{
"documentId": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
"newTitle": "Copy of Project Proposal - 2024"
}This will create a complete copy of the specified Google Doc with the new title and return the new document ID and URL.
Document Template Workflow
Create document templates from existing documents
Workflow Structure
Duplicate a template document, customize it with specific content, share with team members, and log the activity for tracking.
Document Backup Workflow
Create automated backups of important documents
Workflow Structure
Automatically create backups of important documents on a schedule, organize them in a backup folder, and notify stakeholders of the backup completion.
Best Practices
Do's
- • Use the dynamic select for easy document browsing
- • Handle the success status for proper error management
- • Use descriptive titles for duplicated documents
- • Implement proper error handling for authentication failures
- • Consider document size and complexity when duplicating
- • Monitor OAuth token expiration and refresh
- • Use the new document URL for sharing and collaboration
Don'ts
- • Don't hardcode document IDs when dynamic selection is available
- • Avoid duplicating very large documents without considering performance
- • Don't ignore authentication and scope requirements
- • Avoid duplicating sensitive documents without proper security
- • Don't forget to handle empty or malformed document content
- • Avoid making too many API calls in rapid succession
- • Don't use generic titles that make documents hard to identify
Troubleshooting
Common Issues
Authentication Errors
Symptoms: Node fails with OAuth or access token errors
Solution: Ensure the user has connected their Google account and granted the required OAuth scopes (Google Drive file access and Google Docs access).
Document Not Found
Symptoms: Node returns success: false or empty result
Solution: Verify the document ID is correct and the user has access to the specified document. Check that the document exists and is not deleted.
Dynamic Select Not Working
Symptoms: Document selection dropdown is empty or shows errors
Solution: Check that the user has Google Docs and that the OAuth integration is working properly. Verify the required scopes are granted.
Duplication Fails
Symptoms: Document duplication returns error or fails silently
Solution: Check that the user has sufficient Google Drive storage space and that the document is not corrupted. Verify that the new title doesn't conflict with existing documents.
Permission Issues
Symptoms: Node fails with permission or access denied errors
Solution: Ensure the user has the necessary permissions to create files in Google Drive and that the source document is accessible. Check Google Drive storage limits.
Related Resources
Google Docs Read Node
Read content from Google Docs before duplication
Google Sheets Create Spreadsheet Node
Create new spreadsheets alongside document duplication
LLM Prompt Node
Generate dynamic titles for duplicated documents
For Each Node
Duplicate multiple documents in batch
Node Library
Explore all available nodes