OneDrive Webhook
OneDrive Webhook starts a flow every time a file changes in your OneDrive: when a new one is uploaded, when an existing one is modified or when one is deleted. You can watch your whole OneDrive or a single folder.
NappAI checks your OneDrive every short while and, if it finds changes, runs the flow with the details of each affected file. You don’t need to set anything up in Microsoft: the credential and a subscription for the flow are enough.
When to use it
- A client or a colleague drops invoices into a OneDrive folder and you want to process them as soon as they arrive.
- You want to notify your team by email or Teams when an important document is updated.
- You need to keep a log of the files deleted from a shared folder.
- You want an AI agent to read and summarise every new contract saved to a folder.
Configuration
You need a Microsoft One Drive credential, which connects by signing in with your Microsoft account. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The Microsoft One Drive credential of the account you want to watch. |
| Watch Folder | The OneDrive folder being watched. If you leave it empty, the whole OneDrive is watched. |
| Events | The changes that start the flow: File Added (a file is created), File Modified (a file is updated) and File Deleted (a file is deleted or moved to the recycle bin). By 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 OneDrive. Leave it empty in normal use. |
Turning on the subscription
The flow only receives changes while it is subscribed:
- Save the flow and publish a version. A published version of the flow is required 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.
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 for each file that changed, with the type of change (added, modified or deleted), the file’s identifier and name, its type and the modification date. If several changes arrive at once, they all come out together.
Connect it to a component that reads the file, such as Files, 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 OneDrive.
- Add OneDrive Webhook and choose the firm’s Microsoft One Drive credential.
- In Watch Folder, select the
Pending invoicesfolder, and in Events keep onlyFile Added. - Connect the Data output to Files with the
Get Fileoperation to read 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 rather than the whole OneDrive: the flow runs less often 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 to a different folder.