Overview
This node acts as a trigger for Google Drive events using a service account. It listens for changes such as file creation, updates, deletions, and sharing on a specified file or folder in Google Drive. When one of the selected events occurs, the node triggers a workflow with details about the event. This is useful for automating processes based on file changes in Google Drive, such as syncing files, sending notifications, or updating databases.
Use Case Examples
- Trigger a workflow when a new file is added to a specific Google Drive folder.
- Start a process when a file is updated or deleted in Google Drive.
- Monitor sharing events on a file to manage access control automatically.
Properties
| Name | Meaning |
|---|---|
| File or Folder ID | The ID of the file or folder to watch for changes. |
| Events | The types of file events to listen for, such as creation, update, deletion, and sharing. |
| Include Subfolders | Whether to include changes in subfolders of the specified folder. |
Output
JSON
event- The type of event that occurred (e.g., add, update, remove, share).resourceId- The ID of the Google Drive resource that triggered the event.changed- An array of changed properties or fields related to the event.channelId- The ID of the webhook channel receiving the event.timestamp- The ISO timestamp when the event was received.
Dependencies
- Google Drive API via googleapis library
- A Google service account credential with Drive API access
Troubleshooting
- Ensure valid Google Drive service account credentials are provided; missing credentials will cause errors.
- The node requires the file or folder ID to be correct and accessible by the service account.
- Webhook creation may fail if the Google Drive API quota is exceeded or if the service account lacks necessary permissions.
- If no events are received, verify that the webhook URL is reachable and correctly configured in Google Drive.
- The node throws errors with messages like 'Failed to create webhook' if the API call to Google Drive fails; check the error details for troubleshooting.
Links
- Google Drive API Webhooks - Official documentation on setting up and using webhooks with Google Drive API.
- Using OAuth 2.0 for Server to Server Applications - Guide on using service accounts for authentication with Google APIs.