Difficulty creating workflow backup workflows to Google Drive via n8n

Hello!

I’m trying to back up my workflows from n8n to Google Drive and Dropbox. However, I’m having a lot of trouble requesting workflows via the n8n API. I looked for some ready-made templates and found this one that I am uploading below. However, the node request “Get json from Workflows” just starts, but is not giving me any response.

I researched the n8n API documentation (API reference - n8n Documentation) and found this other workflow request through the https:// endpoint docs.n8n.io/api/v1/workflows. However, I don’t know how to do this type of authorization of the ApiKeyAuth type.

Could someone help me with this please?!!

n8n version: 0.217.1 running via Docker

Hey @rfdepauli,

Have you tried using the n8n node? It will make the process a lot easier, In theory the workflow would look something like this…

Thanks a lot for the support, X!

Didn’t know the n8n node. I tried here and I couldn’t run the node. I believe it is because of the n8n credential.

Is the Base URL correct?

Hi @rfdepauli,
usually, a URL like http://localhost:5678/api/v1 should work.

If you are using basic auth, maybe this threat helps: N8n api node cannot connect

1 Like

Thanks so much for your support once again, @Jon and @FelixL

With these tips it worked perfectly here!

However, when building the flow there was an error in the Function node.

Could someone give me a light on how I could solve this error, please?!


Glad it worked @rfdepauli !

I cannot really help with the function node, but there is a new JavaScript node called “Code” maybe try that one instead of the old Function node.

Thanks so much for your help, @FelixL and @Jon ! I managed to evolve a lot in the flow. However, a new difficulty arose to finalize the flow!

In the Google Drive node that sends the streams to the folder it is saving only the first stream in the folder I chose through the folder id. The rest of the streams are being placed in the root folder of Google Drive. I would like all streams to go into the same folder, not just the first one.

Is there any condition to fix the folder ID so that all flows are sent to the same folder created earlier?

My first guess is, that the folder ID (generated at the first Google Drive node) is only put into the first item of the n8n API http request node. As all other items do not have a folder ID, the Google Drive node just uses the root folder.

@rfdepauli you “just” need to make sure that every item you want to save in Google Drive also has the folder ID where it should get saved.

I’ve adapted your workflow so each item gets the folder ID:

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