Google Drive Webhook
Google Drive Webhook starts a flow every time a file changes in your Google Drive: when a new one is created, when an existing one is modified or when one is deleted. You can watch your whole Drive or a single folder.
NappAI checks your Drive about once a minute and, if it finds changes, runs the flow with the details of each file affected. You don’t have to set anything up in Google: the credential and subscribing the flow are enough.
When to use it
- A customer or a colleague drops invoices into a Drive folder and you want to process them as soon as they arrive.
- You want to notify your team by email when an important document is updated.
- You need to keep a record of the files deleted from your Drive.
- You want an AI agent to read and summarise every new contract saved in a folder.
Configuration
You need a Google Drive credential, which connects by signing in with your Google account. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The Google Drive credential of the account you want to watch. |
| Watch Folder | The Drive folder being watched. Only files directly inside it count, not those in its subfolders. If you leave it empty, the whole Drive is watched. |
| Events | The changes that start the flow: File Added (a file is created), File Modified (a file is modified) and File Deleted (a file is deleted or moved to the trash). Default: all three. If you choose none, all three are used. |
| Data | Test field. It lets you try the flow with a sample event without waiting for a real change in Drive. Leave it empty in normal use. |
Turn on the subscription
The flow only receives changes when it is subscribed:
- Save the flow and publish a version. You need a published version of the flow to subscribe. See Versions and publishing.
- In the node’s settings panel, click Subscribe.
- In the panel that opens, click Subscribe. The status changes to Synced.
Only changes that happen after you subscribe come through. If you later change the folder or the events, the status shows Out of sync: subscribe again to apply the changes. From the same panel you can Unsubscribe when you no longer want to receive changes.
Output
The Data output contains one item per file that changed, with the type of change (added, modified or deleted), the file ID (fileId), its name (fileName), its type and the modification date. If several changes arrive at once, they all come out together.
Connect it to Drive File Manager with the Get operation to read the file’s content, to an AI agent, or to an email or messaging component.
Example
An accounting firm receives its clients’ invoices in the Pending invoices folder in Drive.
- Add Google Drive Webhook and choose the firm’s Google Drive credential.
- In Watch Folder select the
Pending invoicesfolder and in Events keep onlyFile Added. - Connect the Data output to Drive File Manager with the
Getoperation, Mode of Input onBy Idand Process File Content on to read the text of each invoice, and then to an agent that extracts the amount and the supplier. - Publish the flow and click Subscribe.
Good practices
- Watch a specific folder instead of the whole Drive: the flow runs fewer times and only with what matters to you.
- If the flow saves files in the same folder it watches, it will run again with its own files. Save the results in another folder.
Related components
- Drive File Manager: read, upload and manage Drive files.
- Drive Folder Manager: manage Drive folders.
- Drive Search: search for files in Drive.