IDs look resolved (green) but downstream nodes still fail with “not found”, especially when the ID comes from a Search branch

Hi! I’m having an issue in an n8n workflow and I’m trying to understand if I’m missing something conceptually.

I have a workflow that reads a photo of an invoice and organizes it in Google Drive:

  • First, it checks if a year folder exists (e.g. 2025). If not, it creates it.

  • Then it checks if a month folder exists inside that year (e.g. January_2025). If not, it creates it.

  • To check existence, I use Drive Search.

  • If Search returns an id and name, I go through the “already exists” branch and continue.

The problem is that when I continue from the Search branch, the next nodes fail even though the ID looks correct and is shown in green in the UI.

This happens in two cases:

1) Google Sheets
I try to write data to a sheet, but I get:
Sheet with ID 99113716 not found
even though the ID shown is the one I expect and the field is resolved (green).

2) Google Drive (upload image)
I try to upload or move the invoice image into the folder whose ID comes from the Search node, but the node fails as if the folder does not exist, even though the ID comes directly from Search.

My main question is conceptual:

  • Shouldn’t downstream nodes reliably receive the data from previous nodes if the execution path is correct?

  • If a value is shown in green (resolved), what are the reasons it can still fail with “not found”?

  • Is this expected behavior when using IDs coming from a Search node, or am I misunderstanding how data is passed between branches?

Screenshots provided below:

  • Screenshot 1: The node where the error occurs (Google Sheets / Drive upload).

  • Screenshot 2: The previous node (Drive Search) showing the returned id and name.

  • Screenshot 3: A general view of the workflow to show how the branches are connected.

Thanks!