Check PDF (Contents) > Upload to Google Drive > Rename at Google Drive

Describe the problem/error/question

Hi everyone, I want to create a relatively simple workflow in which I receive a file (PDF). This file needs to be read, then uploaded to Google Drive, and then certain parameters from the read content need to be incorporated into the file name, e.g. who created the document and when it was created.

Now, as a final step, I want to rename the file in Google Drive. The identification should be done via the file ID in Google Drive. However, I always get an error and the file is not renamed.

Does anyone have any idea what the problem might be? This is the first workflow I have ever built myself.

Many thanks

What is the error message (if any)?

Problem in node ‘Update file‘
The resource you are requesting could not be found

Please share your workflow

Share the output returned by the last node

Error details
From Google Drive
Error code
404
Full message
Request failed with status code 404
Other info
Node type
n8n-nodes-base.googleDrive
Node version
3 (Latest)
n8n version
1.120.4 (Self Hosted)
Time
21.12.2025, 00:06:18
Stack trace
NodeApiError: The resource you are requesting could not be found at ExecuteContext.httpRequestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts:1391:9) at processTicksAndRejections (node:internal/process/task_queues:105:5) at ExecuteContext.httpRequestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts:1763:11) at ExecuteContext.googleApiRequest (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_afd197edb2c1f848eae21a96a97fab23/node_modules/n8n-nodes-base/nodes/Google/Drive/v2/transport/index.ts:54:11) at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_afd197edb2c1f848eae21a96a97fab23/node_modules/n8n-nodes-base/nodes/Google/Drive/v2/actions/file/update.operation.ts:266:23) at ExecuteContext.router (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_afd197edb2c1f848eae21a96a97fab23/node_modules/n8n-nodes-base/nodes/Google/Drive/v2/actions/router.ts:29:26) at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_afd197edb2c1f848eae21a96a97fab23/node_modules/n8n-nodes-base/nodes/Google/Drive/v2/GoogleDriveV2.node.ts:25:10) at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1093:8) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1274:11) at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1708:27

Hey @mlUser !

Can you try write into By ID expression field the following:

{{ $json.id }} or how @Soban_Kasmani suggested .

Cheers!
P.S prefer to referer directly to value, instead relying on node Names (i chnage them often and lead to errors).

EDIT:
Try to type the expression and copy/paste, it will render live in editor.

Hi @mlUser ,

Currently you are using - {{ $json.id }}

Change it with - {{ $(‘Merge’).last().json.id }} or {{ $(‘Merge’).first().json.id }}

You are using merge node. Sometime, we have to define first or last in key.

thank you,
Soban

Thank you for your Answer, unfortunately, the method does not work. I get the following error:

Bildschirmfoto 2025-12-21 um 15.16.36

How can I implement this solution, to referer directly?

Hi Soban, thank you very much for the suggested solution. Unfortunately, I am getting the following error. Is there another, more efficient method of executing this workflow?

Bildschirmfoto 2025-12-21 um 15.18.24

Hey, edited my post.
Isbquite strange that isbnot working.
Please try to delete and type the expression while you have that data pinned.
Itbshoukd render …

{{ $(‘Merge’).first().json.id }}

I tested it once with the absolute ID and then once with the dynamic ID. As soon as I enter the dynamic command ({{ $json.id }} etc.), the error message appears.

Hey @mlUser !
That is pretty weird … :

yhxm4e2o

Please pinn data in Merge node, and share please here the merge and the Update file in a code section so i can test myself… see how to put json correctly.

glxgzrh0

Bildschirmfoto 2025-12-22 um 22.23.46

Do you know why the “Folder” option is selected and not “PDF”?

Hey @mlUser !

Merry Christmas and here what Santa brought you lol …

I can t pinn the pdf since there are too many cg=haracter and won t let me put that here in code.
But now it works, you can reffrenece to the id of file in the Uppload node, the Merge node need Combine and not Append.
Here localy i tested:

now the id can be refferenced:


and pdf has the name you define in Upload node:

Cheers!

2 Likes

Ho ho ho Santa :santa_claus: aka @Parintele_Damaskin you nailed it! :hammer:

Thank you very much for the Christmas present. Now I can finally continue.

Best regards and happy holidays! :christmas_tree:

Marco

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.