Upload files from notion.so to OneDrive

Hi,

this is a total noob question but here it goes.

what I’ve done.

  1. select projects from notion database
  2. get all tasks incl. their files associated to said projects
  3. check if project folder already exists on OneDrive
  4. if true, try to upload task files to OneDrive

I’m basically stuck selecting the correct variables to successfully upload the files. But didn’t succeed with my trail and error approach🤦‍♂️.

Any ideas ?

Edit: I had to reupload the image, since i forgot to censor some stuff

Hi @atwork1 :wave: Welcome to the community :tada:

With just a screenshot it’s a bit difficult to tell what’s going on - can you give me an example in JSON format of what you’re receiving from the Notion node, and maybe an explanation of what is what, since these aren’t in English? :sweat_smile: For example, which fields specify the project folder in OneDrive, and which contain the files you want to upload?

Could you also let us know the following in case we need it for testing:

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:
1 Like

Hi

  • I’ve been running the Docker version 1.8.2, I’ll update later today.
  • using the default database
  • EXECUTIONS_MODE is default (main)
  • OS is Ubuntu Server LTS

I cleaned up the workflow somewhat and renamed them to make it easier to understand

the Node “get Project Tasks” downloads the files associated with the Project/Task

To upload the Files I have

  • the parent ID

but I’m struggling with

  • file name (I can chose whatever name I want? can I keep the original file name?)
    sample:

“property_protokolle”: [
https://prod-files-secure.s3.us-west-2.amazonaws.com/.../20230829_Abnahmeprotokoll_abcdef.pdf?X-Amz-Algorithm=...id=GetObject”,
https://prod-files-secure.s3.us-west-2.amazonaws.com/.../20230829_Abnahmeprotokoll_ghij.pdf?X-Amz-Algorithm=...id=GetObject
],

  • Binary Data

Hi @mellesc - can you share your workflow here? In the workflow editor you can hit ctrl/cmd + a and then ctrl/cmd + c to copy all the nodes, and you can share that JSON code between two sets of three backticks (```). That would help us see what’s going on in more detail :+1:

Hi @mellesc :wave: I’m not entirely sure where your binary data files are getting their naming from (is this directly how they’re called in Notion?) but you can split out your binary data from an array into separate files doing something like the following:

But that workflow doesn’t account for filenames, so you’d need to be able to fix that portion up :bowing_man: Splitting up the files should be the way to go here, instead of one item having multiple binary properties.

1 Like

Yes, It looks like the binary objects are named according to the Notion Property.
If the Property is named “Files” the binary objects will be named “Files_0”, “Files_1”,…

I’ll try the solution you pointed out. Thank you :pray:

I’ll report back if I managed. :slight_smile:

2 Likes

This is my solution for now.
I think it works quite good, and I don’t have the issues with the binary data the notion node produces.

2 Likes

some bug fixes^^

1 Like

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