Google Drive + Apps Script for clean file uploads
You finally get the file link, you paste it into something, you wait… and then it fails. Or it uploads with a weird name. Or it lands in the wrong folder and nobody can find it later.
This Drive upload automation hits marketing ops and agency workflows hardest, honestly. But content teams dealing with big video/audio links feel it too. The outcome is simple: clean, consistent Google Drive uploads from a URL, with a predictable filename you can trust.
Below, you’ll see how the workflow works, what it fixes, and what you need to run it without babysitting transfers.
How This Automation Works
See how this solves the problem:
n8n Workflow Template: Google Drive + Apps Script for clean file uploads
flowchart LR
subgraph sg0["When clicking ‘Test workflow’ Flow"]
direction LR
n0@{ icon: "mdi:play-circle", form: "rounded", label: "When clicking ‘Test workflow’", pos: "b", h: 48 }
n1@{ icon: "mdi:cog", form: "rounded", label: "Rename Uploaded Video", pos: "b", h: 48 }
n2["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Send URL to GDrive Script an.."]
n0 --> n2
n2 --> n1
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0 trigger
class n2 api
classDef customIcon fill:none,stroke:none
class n2 customIcon
The Challenge: Clean uploads when files are too big
When you’re collecting large video or audio files via links, the “easy” approach (download the file, re-upload it, rename it, then share it) turns into a daily time sink. The worst part is the uncertainty. You don’t know if the transfer will succeed until you check, and if it fails you’re back to chasing the link, redoing the upload, and trying to remember the right naming format. n8n can automate a lot, but big files can be awkward to handle directly with typical download nodes. That’s where teams get stuck: you can automate everything around the file, but not the actual heavy lift.
It adds up fast. Here’s where it usually breaks down in real work.
- Large video links time out or fail mid-transfer, so you re-run uploads and waste about an hour a week just verifying.
- Files land with generic names like “download” or random IDs, which means your Drive turns into a junk drawer.
- Teammates keep asking “where’s the final file?” because nothing is consistently placed in one folder with one naming rule.
- Manual renaming invites mistakes, and those mistakes show up later when someone tries to reuse the asset for ads or social.
The Fix: Send a URL, let Drive fetch the file
This workflow offloads the “download from URL and upload to Drive” job to a Google Apps Script web app, then uses n8n to orchestrate the rest. You trigger the workflow, provide the file URL, and n8n posts that URL (plus a secret key) to your Apps Script endpoint. The script downloads the file using Google’s own fetch tools, saves it directly into your chosen Google Drive folder, and responds with the uploaded file’s metadata (like the Drive URL or ID). Back in n8n, the workflow immediately renames the uploaded file, so you get consistent, human-readable naming without touching Drive manually.
The flow starts with a manual run in n8n. Then an HTTP request hands the file link to your Apps Script uploader. Finally, a Google Drive step updates the filename so the asset “lands ready” instead of needing cleanup.
What Changes: Before vs. After
| What This Eliminates | Impact You’ll See |
|---|---|
|
|
Real-World Impact
Say you receive 10 large video links per week from clients or creators. Manually, you might spend about 10 minutes per file downloading, uploading, renaming, and double-checking the result, which is roughly 100 minutes weekly. With this workflow, you paste the URL once and run it, then the Apps Script uploads straight into Drive and n8n renames it automatically. You’re down to a couple minutes per file, plus waiting time you don’t have to supervise.
Requirements
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Google Drive to store the uploaded files.
- Google Apps Script to fetch the URL and upload.
- Secret key (generate one and paste into the script)
Skill level: Beginner. You’ll copy a script, deploy it as a web app, and paste a URL into n8n.
Need help implementing this? Talk to an automation expert (free 15-minute consultation).
The Workflow Flow
You launch the workflow manually. This is ideal when you’re handling a batch of incoming links and want control over when each file gets pulled into Drive.
The file URL is sent to your Apps Script endpoint. n8n makes an HTTP POST request that includes the download link and a secret key so random requests cannot use your uploader.
Google fetches and uploads the file. The Apps Script downloads the file from the provided URL and creates it inside your target Google Drive folder, then returns a response you can use downstream.
The file is renamed inside Drive. n8n uses the Google Drive step to set a clean, consistent filename so your folder stays organized even at scale.
You can easily modify the naming rule to match your client/project format based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Manual Trigger
Start the workflow with a manual trigger so you can test the Drive upload and rename flow on demand.
- Add the Manual Launch Trigger node as the workflow trigger.
- Keep all default settings in Manual Launch Trigger since no parameters are required.
- (Optional) Keep the Flowpast Branding sticky note for documentation purposes.
Step 2: Connect the Drive Script Request
Post the video URL and secret to your Google Apps Script web app to create the file in Drive.
- Add the Post URL to Drive Script node after Manual Launch Trigger.
- Set URL to
"your_google_script_web_app_url". - Set Method to POST.
- Enable Send Body and set Specify Body to
json. - Set JSON Body to
{ "videoUrl": "https://example.com/path/to/your.mp4", "secret": "your-strong-secret-here"}.
Tip: Replace the videoUrl and secret values with your actual media URL and the secret configured in your Apps Script.
Step 3: Configure the Google Drive Update
Rename the uploaded file in Google Drive using the file URL returned by the script.
- Add the Update Video Filename node after Post URL to Drive Script.
- Set Operation to
update. - Set File ID to
{{ $json.driveUrl }}(URL mode). - Set New Updated File Name to
Music Video 1. - Credential Required: Connect your googleDriveOAuth2Api credentials.
⚠️ Common Pitfall: The script response must include driveUrl. If the field is missing or named differently, Update Video Filename won’t find the file.
Step 4: Test and Activate Your Workflow
Run a manual test to confirm the file is created in Drive and renamed correctly, then activate the workflow.
- Click Execute Workflow to run from Manual Launch Trigger.
- Verify Post URL to Drive Script returns a JSON response that includes
driveUrl. - Confirm Update Video Filename successfully updates the file name in Google Drive.
- Turn the workflow Active when you’re ready for production use.
Watch Out For
- Google Apps Script deployments can get reset or redeployed. If the HTTP request starts returning “Unauthorized,” check the secret key in your script and the body you’re sending from n8n first.
- If you’re pulling very large media, processing time can vary. Increase your timeout expectations in n8n and avoid triggering multiple runs at once until you see stable performance.
- Google Drive renaming can fail if the workflow can’t correctly identify the file that was just created. Make sure the Apps Script response includes the file ID (or a reliable URL you can parse) and map that into the Drive “update” step.
Common Questions
About 30 minutes if your Google account is ready.
Yes. You’ll copy-paste the Apps Script, deploy it, then plug the URL and secret key into n8n.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Google Workspace costs if your account is on a paid plan (Apps Script itself is typically included).
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
You can customize it in two places: the Apps Script upload step and the Google Drive rename step. Most teams start by changing the target Drive folder ID and the default filename rule so it matches a client name, campaign name, or date. If you prefer not to rename in n8n, you can also set the file name directly in the script before it returns. And if you want to trigger it automatically, swap the manual trigger for a webhook trigger so other tools can send links in.
Usually it’s expired Google credentials in n8n or missing Drive permissions on the connected account. Reconnect Google Drive in n8n, confirm the account can access the target folder, then re-test with a small file URL to rule out size/timeouts. If the HTTP step works but renaming fails, the file ID mapping is the next thing to check.
It depends more on Google Apps Script and your server limits than the n8n workflow itself.
For large-file handling, often yes, because you’re letting Google handle the download-to-Drive transfer directly instead of pushing the full file through an automation platform. n8n also gives you more control over request bodies, branching, and error handling without paying extra per path. Zapier and Make can still work if your files are small and your flow is simple. But once you add “secret key auth,” renaming rules, and reliable retries, n8n tends to feel less cramped. If you want a second opinion based on your exact volume and file sizes, Talk to an automation expert.
Clean uploads aren’t glamorous, but they make everything downstream smoother. Set this up once and your Drive stays usable, even when the files are big.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.