n8n - ✅(Solved) Fix Google Drive node copies file as "Copy of undefined" when filename is not provided (Copy via ID) [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

  • error: all

Fix Action

Fixed

PR fix notes

PR #28736: fix(google-drive): default filename when copying file without name

Description (problem / solution / changelog)

Summary

<!-- Describe what the PR does and how to test. Photos and videos are recommended. -->

Fixes an issue in the Google Drive node where copying a file by ID without providing a filename results in the new file being named "Copy of undefined".

This PR ensures that when the File Name field is left empty, the node falls back to using the original file’s name and correctly prefixes it as:

Copy of {original file name}

This aligns the behavior with the expected default naming convention and prevents invalid filenames.

How to test:

  1. Add a Google Drive node
  2. Set:
  3. Resource → File
  4. Operation → Copy
  5. Select File by ID and provide a valid file ID
  6. Leave the File Name field empty
  7. Execute the node

Related Linear tickets, Github issues, and Community forum posts

<!-- Include links to **Linear ticket** or Github issue or Community forum post. Important in order to close *automatically* and provide context to reviewers. https://linear.app/n8n/issue/[TICKET-ID] --> <!-- Use "closes #<issue-number>", "fixes #<issue-number>", or "resolves #<issue-number>" to automatically close issues when the PR is merged. -->

closes #28735

Review / Merge checklist

  • I have seen this code, I have run this code, and I take responsibility for this code.
  • PR title and summary are descriptive. (conventions) <!-- **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** -->
  • Docs updated or follow-up ticket created.
  • Tests included. <!-- A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests. -->
  • PR Labeled with Backport to Beta, Backport to Stable, or Backport to v1 (if the PR is an urgent fix that needs to be backported)

Changed files

  • packages/nodes-base/nodes/Google/Drive/test/v2/node/file/copy.test.ts (modified, +60/-0)
  • packages/nodes-base/nodes/Google/Drive/v2/actions/file/copy.operation.ts (modified, +21/-5)
RAW_BUFFERClick to expand / collapse

Bug Description

When using the Google Drive node to copy a file by ID and leaving the File Name field empty, the resulting file is created with the name "Copy of undefined".

According to the expected behavior (and UI hint), if no filename is provided, the copied file should default to: Copy of ${original file name}

However, the original file name is not being resolved, resulting in "undefined" instead.

<img width="1467" height="740" alt="Image" src="https://github.com/user-attachments/assets/23d1c773-a7df-4b82-853c-0e3c56402a9a" />

To Reproduce

  1. Add a Google Drive node
  2. Set Resource to File
  3. Set Operation to Copy
  4. Choose File by ID and provide a valid file ID
  5. Leave the File Name field empty
  6. Execute the node

Expected behavior

The copied file should be named: Copy of ${original file name}

Debug Info

Debug info

core

  • n8nVersion: 2.17.0
  • platform: npm
  • nodeJsVersion: 22.19.0
  • nodeEnv: undefined
  • database: sqlite
  • executionMode: regular
  • concurrency: -1
  • license: community
  • consumerId: unknown

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: filesystem

pruning

  • enabled: true
  • maxAge: 336 hours
  • maxCount: 10000 executions

client

  • userAgent: mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36 (khtml, like gecko) chrome/146.0.0.0 safari/537.36
  • isTouchDevice: false

Generated at: 2026-04-19T17:49:13.983Z

Operating System

macOS

n8n Version

2.17.0

Node.js Version

24.15.0

Database

SQLite (default)

Execution mode

main (default)

Hosting

self hosted

extent analysis

TL;DR

The issue can be fixed by modifying the Google Drive node to correctly resolve the original file name when the File Name field is left empty.

Guidance

  • Verify that the Google Drive node is correctly configured to retrieve the original file name when copying a file by ID.
  • Check the node's implementation to ensure it handles the case where the File Name field is empty and defaults to "Copy of ${original file name}".
  • Review the node's input parameters to confirm that the original file name is being passed correctly.
  • Test the node with a valid file ID and an empty File Name field to reproduce the issue and verify the fix.

Example

No code snippet is provided as the issue does not include specific implementation details.

Notes

The issue seems to be related to the Google Drive node's implementation, and the fix may require modifying the node's code to correctly handle the case where the File Name field is empty.

Recommendation

Apply a workaround by modifying the Google Drive node to correctly resolve the original file name when the File Name field is left empty, as the root cause of the issue is likely related to the node's implementation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The copied file should be named: Copy of ${original file name}

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING