How to list google drive files from google drive link in Notion DB?

Describe the issue/error/question

First time n8n user here. Overal automation is as follows:

  1. Notion status changes to “schedule” AND google drive URL property is not empty
  2. List all files in google drive URL
  3. Create new folder in Amazon S3 with Name from Notion DB row
  4. Upload files to said folder in Amazon S3
  5. Create a new Google Sheet (with headers = filename, URL, time) where URL = Amazon S3 URL of the files

Step 1 is ok.
Step 2 & 3 is where I don’t know how to do it.
Step 4 I used a template
Step 5 not sure.

What is the error message (if any)?

A) Google Drive trigger doesn’t get show Output Data from Notion (e.g. google drive URL)
B) Google Drive regular doesn’t allow input data to get data from Notion

Please share the workflow

Share the output returned by the last node

Information on your n8n setup

  • **n8n version:**0.182.0
  • Database you’re using (default: SQLite):
  • Running n8n with the execution process [own(default), main]:
  • **Running n8n via [Docker, npm, n8n.cloud, desktop app]:**Desktop App

Hey @pooria,

Welcome to the community :cookie:

Looking at what you want to do the Google Drive Trigger probably isn’t going to be the node for you. Trigger nodes are used to start workflows but it looks like what you actually want is a Notion trigger.

As a starting point maybe something like the quick example below could be close to a flow you are after. I have not tested it and have only dropped the nodes in place but I think it should serve as a good starting point for you.

Thanks for the tip Jon :wave:

Revised the flow you sent (bottom) and old mine is at top

-Instead of IF, I filtered data using Notion node

Workflow is:
-Notion DB page has status schedule AND googledriveURL is not empty :white_check_mark:
-Folder created in AWS S3 based on DB name :white_check_mark:
-How to use AWS S3 upload file to THAT specific folder created above❓
-Video files are already uploaded in googledriveURL, how to navigate to THAT specific google drive foldeR❓tried using query string but don’t know how to specify expression to use googledriveURL from notion db
-For Google Sheets Node, there is a sheets templates in X folder (different from that google drive URL), how to duplicate that sheets template THEN append the name and url of the uploaded (aws s3) file❓

Terribly sorry for the question bombardment :slight_smile:

Hey @pooria,

The problem there is the workflow is going to be a manual approach rather than a triggered flow unless you plan to use a cron node to start it all.

When you upload a file to S3 you should be able to select the output data from the S3 node to get the created folder, To find the video files in Google Drive the contains option for the filename might work but without knowing the structure you are dealing with it is hard to say. If it was me I would probably add the ID of the Drive file to Notion once it has been uploaded to make that process a bit easier.

To copy the file it would need to be done with the Google Drive node I can’t see another way to do it.

Heyy Jon,

Thx for the quick reply :slightly_smiling_face:

Overall goal is

-On Notion Episodes DB, if status is scheduled AND google drive url is not empty

-Visit google drive url, upload files from that google drive to AmazonS3

-In Google Sheets, add name and url (amazons3) of all videos

This is for collecting the name and url of short videos of our podcast (to later pass to a scheduling software)

Did that help clarify it a bit?

1 Like

Hey @pooria,

That looks like the same as before so you would be better off starting with a Notion trigger so you can do that first step as the change happens but you can do that with a cron node so the current flow would do that side.

The tricky bit will be playing the Google Drive node to find the files unless you keep them in the same folder or a folder with a name that matches the notion title.

Truee.

I do keep them in the same folder.
Trying to get Google Drive Node to list all files in that folder but it doesn’t work.

Get an error that says “Problem executing workflow”. Google Drive: bad request check your parameters"

Hey @Jon

Updated the workflow

Question is:how to get uploaded S3 file URLs? AND loop through them with their names and URLs

To use that in Set node to add under VideoURL.

For Message, I’m getting the filename from Google Drive but need the URL from S3

NOTE: if I remove split in batches before google drive 1, then uploaded files are scattered in S3 (meaning they don’t get uploaded to the foldername specified - only one file makes it there) BUT the google sheet works

Example filename: Her parents let her come to Canada :maple_leaf::roll_eyes:.mp4
Example AWS S3 URL: https://notion.s3.us-west-2.amazonaws.com/You+can’t+realize+your+dreams+alone+😓.mp4

GOAL: Add filename and S3 URL to Google Sheets

UPDATE: solved a little bit.

Realized I had to encode URI

Only problem now is when uploading files to Amazon it doesn’t get uploaded to the folder, it gets uploaded to root. Added workflow here.

Please let me know your thoughts :slight_smile:

Also how do I create a template I’m freaking excited :grinning::grinning::grinning:

UPDATE: Amazon folder upload is fixed but URL is still finnicky:

Using the workflow below I managed to get URL through expressions (encodeURI):

Problemas highlighted in the image earlier is that THE FIRST URL WORKs but the rest don’t.

**Expression in set (for URL)**https://notion.s3.us-west-2.amazonaws.com/{{encodeURI($node[“Notion”].json[“property_name”] + " shorts")}}/{{encodeURI($node[“Google Drive”].json[“name”])}}

Identified problem is that the “$node[“Notion”]…” disappears in the second rows and following as highlighted in the image “//”.

Also tried a different configuration but “Set” node only uses the first binary data and they get repeated: