How to create a file in google drive?

Hello,

I’m new here and to n8n and to the APIs as well.
A few days ago, i successfully did this with my cloud account :

  • read a google sheets
  • call one of our workers to modify the sheet
  • update the google sheets

Now i would like to create a new file in a google drive account. I read the documentation https://docs.n8n.io/nodes/n8n-nodes-base.googleDrive/#basic-operations.
I authorized the google drive API in the google cloud console but what then? How can i tell the drive node where to record the file? How could it create anything? Should i use the write binary file node? What kind of workflow can i use? I’m lost. :frowning:

Welcome to the community @StanMeister!

You can create a file by selecting “File -> Upload”. By default, it gets created on the top level. If you want to save it in a specific folder you can set its ID under “Parents”.

Here an example workflow:

{
  "nodes": [
    {
      "parameters": {
        "binaryData": true,
        "name": "test.png"
      },
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 1,
      "position": [
        650,
        300
      ],
      "credentials": {
        "googleApi": ""
      }
    },
    {
      "parameters": {
        "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Test-Logo.svg/783px-Test-Logo.svg.png",
        "responseFormat": "file",
        "options": {}
      },
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        450,
        300
      ]
    }
  ],
  "connections": {
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Oh great! Thank you!

You are welcome. Have fun!