nœuds / builtin / integration
Google Drive
Integrate with Google Drive to manage files and folders.
Ce contenu n’est pas encore disponible dans votre langue.
Upload files to Google Drive, find, copy and delete them, and create and manage folders.
What it does
Section titled “What it does”The Google Drive node works on two kinds of things (Resource):
- File: List or Search files, Get one file’s details, Create (upload) a file, Copy a file, or Delete it.
- Folder: List your folders, Get one folder, Create a folder, or Delete it.
Create uploads the file that the previous node produced (the key in Binary source, data by default). If the incoming item has no file under that key, the text in Content becomes the file. Delete removes the file or folder for good, without going through the Drive trash.
The node works with file details (name, type, dates, link), not file contents: Get does not download the file.
When to use it
Section titled “When to use it”- Save a screenshot, a CSV export or a generated report to a Drive folder.
- Make a dated copy of a template document each week.
- Find files by name or type and send their links in a message.
- Create a folder per client or per project from a form entry.
Inputs and settings
Section titled “Inputs and settings”| Réglage | Type | Ce que cela fait |
|---|---|---|
| Credential (obligatoire) | Credential | The Credential to use to make request. |
10 choix · choisissez Resource and Operation pour voir ses réglages
Réglages de File · List
| Réglage | Type | Ce que cela fait |
|---|---|---|
| Search Query | Text | Search query for files/folders. |
| Page Size | Number | Number of results per page (1-1000). Par défaut : 100 |
Réglages de File · Get
| Réglage | Type | Ce que cela fait |
|---|---|---|
| File ID (obligatoire) | Choice (loaded from your account) | The Google Drive file ID. |
Réglages de File · Create
| Réglage | Type | Ce que cela fait |
|---|---|---|
| Name (obligatoire) | Text | The name for the file or folder. |
| Binary source | Text | The logical $binary key on the incoming item to upload (defaults to 'data'). When the item carries this binary it becomes the file content; otherwise the Content field is used. Par défaut : data |
| Content | One of several shapes | File content (text or binary). |
| MIME Type | Text | MIME type of the file. |
| Parent ID | Choice (loaded from your account) | Parent folder ID (optional). |
Réglages de File · Delete
| Réglage | Type | Ce que cela fait |
|---|---|---|
| File ID (obligatoire) | Choice (loaded from your account) | The Google Drive file ID. |
Réglages de File · Copy
| Réglage | Type | Ce que cela fait |
|---|---|---|
| File ID (obligatoire) | Choice (loaded from your account) | The Google Drive file ID. |
| Name | Text | The name for the file or folder. |
| Parent ID | Choice (loaded from your account) | Parent folder ID (optional). |
Réglages de File · Search
| Réglage | Type | Ce que cela fait |
|---|---|---|
| Search Query (obligatoire) | Text | Search query for files/folders. |
| Page Size | Number | Number of results per page (1-1000). Par défaut : 100 |
Réglages de Folder · List
| Réglage | Type | Ce que cela fait |
|---|---|---|
| Search Query | Text | Search query for files/folders. |
| Page Size | Number | Number of results per page (1-1000). Par défaut : 100 |
Réglages de Folder · Get
| Réglage | Type | Ce que cela fait |
|---|---|---|
| Folder ID (obligatoire) | Choice (loaded from your account) | The Google Drive folder ID. |
Réglages de Folder · Create
| Réglage | Type | Ce que cela fait |
|---|---|---|
| Name (obligatoire) | Text | The name for the file or folder. |
| Parent ID | Choice (loaded from your account) | Parent folder ID (optional). |
Réglages de Folder · Delete
| Réglage | Type | Ce que cela fait |
|---|---|---|
| Folder ID (obligatoire) | Choice (loaded from your account) | The Google Drive folder ID. |
Affichage des réglages de File · List
- Search Query uses Google Drive’s search syntax, for example
name contains 'invoice',mimeType = 'application/pdf', or both joined withand. On File → List it is optional; leave it empty to list all files. - Folder → List returns all your folders that are not in the trash.
- Parent ID picks the folder to create or copy into. Leave it empty to use the top of your Drive. File ID, Folder ID and Parent ID are lists loaded from your Drive once the credential is set; you can also map an id from a previous step, such as
{{ $input.id }}. - MIME Type is optional: without it, the type of the incoming file is used, for example
image/pngfor a screenshot.
Outputs
Section titled “Outputs”-
Output
- Each file or folder has
id,name,mimeType,createdTime,modifiedTimeandwebViewLink, the link that opens it in Drive. - List and Search return a list of these, up to Page Size (100 by default). Use Split Out to handle them one per item.
- Create and Copy return the new file, so you can share
{{ $input.webViewLink }}in the next step. - Delete returns
success,deletedand the id of the file or folder.
Dependencies and credentials
Section titled “Dependencies and credentials”- Credential (connection, OAuth2): required. See Create a connection.
Google Drive connects by signing in to your Google account (OAuth). You first create your own Google OAuth client once, with the Google Drive API enabled: follow Create your OAuth client. Then create a Google Drive credential, paste the Client ID and Client Secret, click Check connection and approve the Google window. AWFlow asks for full access to your Drive, which it needs to list, copy and delete files it did not create itself. The sign-in is kept and refreshed for you. See also Create a credential.
Example workflow
Section titled “Example workflow”- A Context Menu trigger runs when you right-click a page.
- Screenshot Page captures the page as a file under the key
data. - Google Drive, File → Create, Name
{{ $('Context Menu').tabTitle }}.png, Parent ID yourScreenshotsfolder. - Clipboard Write copies
{{ $input.webViewLink }}so you can paste the link anywhere.
Common issues
Section titled “Common issues”- The uploaded file contains text instead of your file. No file arrived under the key in Binary source, so Content was used. Check the key name the previous node uses.
- “Google Drive Error: … File not found”. The id is wrong, or the file is in a shared drive or folder your account cannot open.
- “Google Drive Error: … Invalid Value” on List or Search. Search Query is not valid Drive syntax. Put text values in single quotes, for example
name contains 'report'. - “… insufficient authentication scopes” or a 403 error. The Google Drive API is not enabled for your OAuth client, or the sign-in is older than the current permissions. Enable the API, then click Check connection again on the credential.
Related nodes
Section titled “Related nodes”- Google Sheets: read and write spreadsheet values.
- Convert to File: turn data into a file to upload.
- Gmail: send the file or its link by email.
- Microsoft 365: OneDrive instead.