Creating a Folder in Google Drive if it does not exists already

I have the following workflow below where I try load multiple folders from a root google drive foldler then if the root folders are not present they will be created if they already exist the workflow will continue.

I do not know . Help would be appreciated.

Workflow :
image

Function Configs :

return [
  {
    json: {
      root: 'N8N'
    }
  },
  {
    json: {
      folderName: 'Summaries'
    }
  },
  {
    json: {
      folderName: 'Input(s)/Output(s)'
    }
  },
  {
    json: {
      folderName: 'Mathematical-Steps'
    }
  }
];

Google Drive Search Directories Configs:
root is the root directory and all the folderName s are the directories that needs to be inside root

  • n8n version: 1.27.3
  • Database (default: SQLite): No db was installed with it
  • n8n EXECUTIONS_PROCESS setting (default: own, main): clicking to execute
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: Windows 10 Version 22H2

are you using google service account?

I have a normal gmail account where I have enabled Google Drive API on the google.console. It works where I can fetch folders and contents of files etc… I dont really understand what you mean by google service account.