1. Opening Problem Statement
Meet Sarah, a project manager at a multinational company who handles dozens of PDF documents that need translation every week. Sarah’s team relies on accurate translations for contracts, presentations, and marketing materials, all stored in Google Drive. Previously, Sarah spent countless hours manually downloading PDFs, uploading them to DeepL’s web interface, waiting for translation, and then re-uploading them to the right folder. This process was not only time-consuming—often taking 3-5 hours weekly—but introduced errors like overwriting files or uploading mixes of source and target languages. With tens of documents per week, the workflow became a bottleneck, delaying important projects and causing frustration.
2. What This Automation Does
This custom n8n workflow automates the entire PDF translation cycle using the DeepL API and Google Drive integration. When triggered manually, it:
- Fetches all PDF files from a specified Google Drive folder.
- Filters out any PDFs that have already been translated to avoid duplication.
- Downloads each PDF file automatically.
- Submits the PDFs to DeepL’s document translation API asynchronously.
- Periodically checks the translation status until the file is fully translated.
- Downloads the translated PDF file and re-uploads it to the original Google Drive folder with a clear naming convention indicating the target language.
This saves Sarah approximately 4+ hours a week, eliminates human upload errors, and ensures consistent file management.
3. Prerequisites ⚙️
- n8n account with access to the workflow editor.
- Google Drive account with a folder containing PDF files to translate.📁
- DeepL API subscription with access credentials for document translation.🔑
- n8n Google Drive OAuth2 Credentials configured.
- HTTP Request node configured with DeepL API authentication.
- Optional: Self-hosting n8n (see Hostinger for self-hosted n8n).
4. Step-by-Step Guide
Step 1: Trigger the Workflow Manually
Open your n8n editor and locate the Run manually node. Click the “Execute Workflow” button to start the process manually. This gives you full control over when translations happen.
Step 2: Configure Your Workflow Parameters
Navigate to the ⚙️ config node (a Set node) where you’ll enter the essential parameters:
- folder_url: Paste the URL of your target Google Drive folder containing PDFs.
- target_lang: Enter the language code for translation, e.g., “DE” for German or “EN-US” for American English.
- source_lang (optional): Specify the source language code or leave blank for auto-detection.
These parameters dynamically control what files are processed and how they’re translated.
Step 3: Fetch Files from the Google Drive Folder
The Get files from specified folder node uses the folder URL from the config node to list all files inside your folder. Ensure the Google Drive OAuth2 credentials are active and correct. You will see a list of all files when this node executes.
Step 4: Filter For Only PDF Documents
The Use only PDF documents Filter node filters out files that don’t end with “.pdf” and those that already include the target language suffix (to prevent re-processing translated files). This step ensures only new, untranslated PDFs proceed.
Step 5: Download Each PDF File
The Download files node downloads each filtered PDF from Google Drive. This node takes the file ID and pulls the file content as binary data, preparing it to be sent to DeepL.
Step 6: Send Translation Request to DeepL
The Send translate request HTTP Request node submits the PDF file to DeepL’s document translation API. It includes multipart form-data parameters:
target_lang: the target language code from config.source_lang: the source language code from config (optional).file: the binary data of the downloaded PDF.
Authentication is done using HTTP Header Auth set up with the DeepL API key.
Step 7: Poll DeepL to Check Translation Status
The workflow loops between the Check translation status HTTP Request node, Wait a bit node (a 5-second pause), and file translated? If node to check if the translation is complete. It sends a POST request to DeepL with the document ID and key until the status is “done”.
Step 8: Wait Between Processing Documents
Once one document translation completes, the Wait between documents node pauses the process for 2 seconds before continuing with the next file. This avoids rate limits and manages API call pacing.
Step 9: Download the Translated Document From DeepL
The Get translated document from deepL node downloads the translated PDF file after completion. It uses the document ID and document key received from the initial translation request.
Step 10: Upload Translated PDF Back to Google Drive
The Uplad to original folder Google Drive node uploads the translated PDF file back to the original folder. It renames the file by appending the target language code, for example, “originalfilename–DE.pdf”.
5. Customizations ✏️
- Change Target Language: In the ⚙️ config node, update the
target_langfield to any supported DeepL language code to translate into different languages. - Auto Source Language Detection: Simply leave the
source_langparameter empty in ⚙️ config to allow DeepL to auto-detect the source language. - Extend To More File Types: Modify the Use only PDF documents Filter node conditions to allow Word documents or others by changing the file extension filter.
- Adjust Waiting Times: Modify the Wait a bit and Wait between documents nodes to optimize the pacing based on your API limits and volume.
- Rename Upload Format: Change the naming template in the Uplad to original folder node’s name parameter to fit your team’s naming conventions.
6. Troubleshooting 🔧
Problem: “DeepL API returns error status or fails to translate.”
Cause: Invalid API key or exceeded API usage limits.
Solution: Verify API key in HTTP Header Auth credentials, check your DeepL subscription for usage limits, and regenerate the key if needed.
Problem: “Files not found or folder URL incorrect in Google Drive node.”
Cause: Incorrect folder URL or missing Google Drive OAuth2 permissions.
Solution: Ensure the folder URL is copied correctly, and the OAuth2 credentials have access to that folder.
Problem: “Workflow gets stuck waiting for translation to complete.”
Cause: Translation job stuck or DeepL API delayed.
Solution: Increase the wait time in the Wait a bit node and monitor API status. Optionally add a timeout condition to skip or retry after a prolonged wait.
7. Pre-Production Checklist ✅
- Confirm your Google Drive credentials have full access to the folder and files.
- Ensure your DeepL API key is valid and enabled for document translation.
- Test with a single PDF file to verify translation and upload processes.
- Check that the naming conventions don’t overwrite existing files.
- Backup original PDFs outside of Google Drive in case of accidental overwrites.
8. Deployment Guide
Activate the workflow in n8n by setting it to active. Trigger it manually using the manual node or integrate it with a schedule trigger to automate at intervals. Monitor your executions in n8n’s dashboard to watch for errors or pauses.
9. FAQs
Q: Can I translate files other than PDFs?
A: Yes, by modifying the filter node to include other file extensions and ensuring DeepL supports that format.
Q: Does this consume a lot of DeepL API credits?
A: Document translation via DeepL consumes API credits based on file size and pages. Monitor usage to avoid surprises.
Q: Is my data secure during this process?
A: Yes, data transfers use secure HTTPS connections, and credentials are encrypted within n8n.
10. Conclusion
By following this guide, you’ve automated a tedious and error-prone translation workflow for PDFs stored in Google Drive using n8n and DeepL. You saved hours weekly, reduced manual mistakes, and standardized document naming. Next, consider expanding to other document formats, integrating Slack to notify your team when translations complete, or scheduling automatic periodic translations.
Automation tailored this specifically helps busy professionals like Sarah accelerate their global communications without the hassle.