Describe the problem/error/question
Hey everyone! I am having weird issues with data flow using Google Drive, If, and Merge nodes. I am using a webhook trigger from Click Up to create a file structure on a google drive for storing customer information. The file structure is intended to be as shown:
Customer Files
-Year
–Q1
—Customer Name
----Invoice #1
-----Art
-----Quote
-----Mockup
I’ve had varying degrees of success getting the information to pass as needed, but ultimately, this is not working as intended to cover the situations where a folder exists but needs to be in a different sub folder, etc. (From the example photo a customer could have multiple Invoice folders that would each have their own art / quote / mockup.)
I think I have tracked the problem to the IF nodes and destroying data depending on the output result. As the workflow is right now, I am using a “Google Drive Search Files and Folders” node to first check to see if the wanted folder exists, first for the formatted year, then quarter for that year, etc. Using the payload from the Click up webhook, I check to see if the customer name exists. Next an IF node checks to see if the Googe Drive node returned an empty value (IF-True Path), or returns a google drive folder ID and the name. If not (If-False) path it moves to a Google Drive node that creates the folder using the payload name from the webhook.
This is the point where it stops working. If I tell the IF to always pass data, it will continue to create a path back to the webhook (which I need for the file structure) making it always send data on the true path. If the false path is used the folder is created, as intended. When I send both streams into the MERGE node, all I return after that is the id and name of the created folder. All other previous data is empty (the nodes are listed on the left, but they are empty.
There is no error message. The workflow just doesnt create the folders, or it will create an untitled folder in the root drive because it didnt get the proper folder ID from previous nodes due to this issue. How do I get around, or fix the issue of my datastream becoming essentially filtered by the IF node? If the node returns TRUE, it will pass the previous data as expected.
In my mind, it should look more like:
With a path back to all previous nodes.
- n8n version: 1.59.4
- Database (default: SQLite): Sqlite
- n8n EXECUTIONS_PROCESS setting (default: own, main): regular
- Running n8n via (Docker, npm, n8n cloud, desktop app): docker, self-hosted
- Operating stem: unknown