OneDrive

Put a OneDrive in a flow: save what arrives (the PDF of an email, a generated invoice, a CSV), download a file for the next node, read its text, find, file away, copy, move, delete and share — with the action node — and fire a flow when a file is added, changed or removed in a folder with the trigger. The action node can also be handed to an AI Node as an AI toolkit.

Connect OneDrive

Click Connect OneDrive — in the node's credential picker or in Settings → Credentials — and sign in with Microsoft. A personal account (outlook.com, hotmail.com, live.com) and a work or school account both work. One credential is one account and its whole OneDrive; the node acts as that account. Microsoft asks for two permissions:

  • Have full access to your files — everything the node does in the account's own OneDrive: upload, download, find, organize, delete and share.
  • Read all files that you can access — read only, and only because Microsoft requires it to send the trigger's change notifications on a work or school OneDrive. HostWebhook doesn't write to files other people shared with you.
ℹOnly the files. It is its own connection: the Outlook and Outlook Calendar credentials don't work here, and this one doesn't reach the mailbox or the calendar. Each Microsoft 365 service is connected on its own, with its own consent.
  • Work accounts. Neither permission needs an administrator, but some organizations don't let their people approve apps on their own: Microsoft then shows Need admin approval, and an admin approves HostWebhook once, in Microsoft Entra.
  • Revoking. Remove HostWebhook from account.microsoft.com → Privacy → Apps and services (personal) or myapps.microsoft.com (work), and the credential stops working; Reconnect it from Settings → Credentials.

The action node

Fourteen operations, in four groups. A new node starts with none picked; pick one and its fields appear.

GroupOperationWhat it doesOneDrive
FilesUpload fileSave a file from the flow, or text you write, in a folder.writes
FilesDownload fileSave a copy in HostWebhook (_file) for the next node — as it is, or as a PDF.reads
FilesRead file as textThe text of a document, for an AI Node or a Transform. Nothing is kept.reads
FindList folderWhat's inside a folder — the next node runs once per item.reads
FindSearchBy name or by what the files contain.reads
FindGet file or folderEverything about one item: size, where it is, who changed it, its link.reads
OrganizeCreate folderOr get the one already there, so a flow can make sure it exists.writes
OrganizeCopyA file or a whole folder, here or into another folder.writes
OrganizeMove or renameTo another folder, a new name, or both.writes
OrganizeDeleteTo the OneDrive recycle bin, where it can be restored for a while.deletes
SharingCreate sharing linkRead-only, editable or embeddable.shares
SharingShare with peopleGive specific people access; Microsoft emails them the link.shares
SharingList who has accessEvery person and every link that can open an item.reads
SharingStop sharingTurn off a link or remove someone's access.writes

Every text field takes a template: {{payload.id}} for the file that fired the OneDrive trigger, {{payload.email}} from a form.

Picking a file or folder

Wherever a file or folder is asked for, you pick it from the account's own OneDrive: open folders to go down and use the path at the top to go back up; file fields also search by name. My files is the top of the OneDrive. Refresh reloads the list after you add something in OneDrive. A folder field left empty means the top.

To take it from the flow instead, choose Type a path, an ID or a template under the list. Any of these works:

  • An ID — {{payload.id}} from the trigger or from another OneDrive step.
  • A path from the top of OneDrive, starting with / and written as you see it, spaces included: /Invoices/2026/invoice-0042.pdf, or /Invoices/{{payload.year}} for a folder.
  • The path another step returned — {{payload.path}} of an Upload file is the File of a Read file as text right after it.

Changing the node's credential forgets the items picked from the other account — an ID doesn't exist in another OneDrive — and keeps paths and templates. A path or ID that finds nothing fails with Check the ID — or the path, which starts at the top of OneDrive.

Uploading

Upload file saves one file in Folder (empty: the top). What to upload is one of two:

  • A file from the flow — File takes a file reference: {{payload._file}}, or one attachment that Outlook's Download attachments saved, like {{payload.attachments[0]._file}}. One file per run: for several, put a Loop before this node. Up to 250 MB; big files go up in pieces, and the output says so with viaUploadSession: true.
  • Text I write — Content (up to 4 MB) becomes the file. A CSV, a Markdown summary, a JSON export.

File name goes with its extension — report-{{payload.id}}.csv. With a file from the flow it can be left empty to keep the file's own name; it can't contain / (pick the folder in Folder). If the name is taken: keep both, renaming the new one (the default), replace the old one, or fail.

Downloading and reading

Download file saves a copy of a OneDrive file in HostWebhook as _file — the same file reference Gmail, Outlook and Google Drive use, so the next node attaches it to an email in Outlook or Gmail, uploads it somewhere else or reads it as it is. Download as PDF converts Word, Excel, PowerPoint and other documents on the way.

ℹUp to 16 MB per file — or your plan's per-file limit, if it is lower. That is the most HostWebhook keeps per file, so a bigger one is refused before anything is downloaded, with its size in the error. A converted PDF that comes out bigger is refused the same way. To work with a larger document's text, Read file as text takes files up to 10 MB without keeping them.

Read file as text returns the text of a document — to hand to an AI Node as {{payload.text}}, or to a Transform — and keeps nothing. It reads text, CSV, JSON, Markdown, HTML, XML and PDF, and Word, Excel and PowerPoint through a PDF. Up to (characters) is 50,000 by default and 200,000 at most; a longer text comes back cut, with truncated: true. Other files — a zip, an image — are refused: Download file saves them for another node.

Neither works on a folder: List folder lists what's inside.

Listing and searching

List folder returns a folder's files and subfolders, and the next node runs once per item. Show files, folders or both; Order by name (the default), newest first or largest first; How many is 50 by default and up to 200 — more: true says there were more.

With Download the files too on, each file also comes with its _file: up to 10 files, 16 MB each (less if your plan's file limit is lower), 32 MB in all. The rest come without it and with _fileSkipped saying why.

Search finds files by words in their name or inside them, across the whole OneDrive or Only in a folder and its subfolders, optionally only some File types (pdf, docx). Up to 50 results. Microsoft indexes new files on its own schedule: one uploaded seconds ago can take a few minutes to show up. Files other people shared with you aren't included.

Organizing

  • Create folder — Name can carry slashes, Clients/{{payload.company}}, and the folders in between are created too. By default, if the folder is already there, the existing one is returned with existed: true — so one step makes sure it exists before an upload. It can also rename the new one or fail instead.
  • Copy — a file or a whole folder, into the same folder or To another, optionally with a New name. Microsoft copies in the background; Wait for it (on by default) waits up to a minute and returns the copy. A big folder still copying after that comes back with status: "inProgress" and keeps going — List folder shows it when it's done.
  • Move or rename — to another folder, a new name, or both. The output carries previousName and previousPath.
  • Delete — sends a file or folder to the OneDrive recycle bin, where it can be restored for a while. There is no permanent delete, and the top of OneDrive can't be deleted.

Sharing

⚠Sharing operations open files to other people for real on every run — Run test included — and Share with people emails them. Point the first tests at a test file and an address of yours.

Create sharing link makes a View only, Can edit or Embed link (embed: personal accounts). Who can open it is the account's default unless you pick Anyone with the link or People in your organization (work accounts). Expires works on work accounts and premium personal ones. Asking twice for the same kind of link returns the same link, with existing: true. The URL is in link.url; an embed link also brings its <iframe> in link.embedHtml.

A link only for specific people isn't something OneDrive makes on its own: for that, Share with people — up to 20 addresses, Can view or edit, and Microsoft emails them the invitation with your Message (turn Email them off to give access silently). Require sign-in is on by default.

jsonShare with people — output
{
  "itemId": "D4648F06C91D9D3D!5678",
  "name": "contract-acme.pdf",
  "granted": [
    { "email": "sam@example.com", "permissionId": "aTowIy5m…", "roles": ["read"], "emailSent": true, "emailError": null },
    { "email": "lee@example.com", "permissionId": "aTowIy5n…", "roles": ["read"], "emailSent": false,
      "emailError": { "code": "accountVerificationRequired", "message": "…" } }
  ],
  "failed": []
}

Someone in granted has access, even with emailSent: false: Microsoft gave the access but didn't send the email, and emailError says why — on personal accounts it is often accountVerificationRequired. Send them the link another way rather than sharing again. Only the addresses in failed got nothing.

List who has access returns every link and every person that can open an item — the next node runs once per entry — with inherited: true on the ones that come from a parent folder and kind: "owner" on the owner's. Stop sharing picks the link or the person to remove from that same list, once the file or folder is chosen. Inherited access is removed on the parent folder, and the owner's can't be.

To stop sharing from the flow, put a Filter between the two that leaves out the owner and the inherited entries — removing those fails. Each run of Stop sharing then gets one entry, so the access to remove is {{payload.id}}. The entry doesn't say which item it belongs to: in File or folder, pick the same one, or give it the same ID or path you gave List who has access — read from the node it came from, since {{payload.…}} is now the entry (see referencing another node).

Stop sharing a file from a flow
OneDrive — Get file or folder  "Contract"   File: /Contracts/acme.pdf
  → OneDrive — List who has access           File: {{payload.id}}
  → Filter       inherited is false, kind is not "owner"   ← one entry per run
  → OneDrive — Stop sharing                  File: {{$("Contract").id}}
                                             Access to remove: {{payload.id}}

What a file or folder looks like

Every operation that returns an item returns it in this shape — and so does the trigger:

jsonGet file or folder — output
{
  "id": "D4648F06C91D9D3D!5678",
  "name": "invoice-0042.pdf",
  "kind": "file",
  "size": 48213,
  "mimeType": "application/pdf",
  "extension": "pdf",
  "path": "/Invoices/2026/invoice-0042.pdf",
  "parentId": "D4648F06C91D9D3D!1234",
  "parentPath": "/Invoices/2026",
  "driveId": "d4648f06c91d9d3d",
  "webUrl": "https://1drv.ms/b/s!…",
  "childCount": null,
  "createdAt": "2026-10-01T15:04:05Z",
  "lastModifiedAt": "2026-10-01T15:04:05Z",
  "createdBy": { "name": "Ana García", "email": null, "app": null },
  "lastModifiedBy": { "name": "Ana García", "email": null, "app": null },
  "contentHash": "…",
  "eTag": "…",
  "cTag": "…"
}
  • kind is file, folder, package (a OneNote notebook) or remote (a shared folder added to your files, which is only listed).
  • path runs from the top of OneDrive and is readable — spaces as spaces — so it can be used as the File or Folder of another step. It can be null when Microsoft doesn't say where an item is.
  • A folder's size is the total of what's inside, and childCount how many items it holds. Dates are UTC.

AI toolkit mode

Once OneDrive is connected, the node asks for a Mode. AI toolkit turns it into thirteen tools that an AI Node — or an MCP client, through one of your MCP servers — calls by name: “find the Acme contract and summarize it”, “file this week's reports in a folder per client”.

ToolArgumentsStarts
list_onedrive_folderfolder_id? · filter? · order_by? · max_results?available
search_onedrivequery · folder_id? · filter? · file_types? · max_results?available
get_onedrive_itemitem_idavailable
read_onedrive_filefile_id · max_characters?available
create_onedrive_text_filefolder_id? · file_name · content · if_exists?available
create_onedrive_folderparent_folder_id? · name · if_exists?available
copy_onedrive_itemitem_id · destination_folder_id? · new_name? · if_exists?available
move_onedrive_itemitem_id · destination_folder_id? · new_name?blocked
delete_onedrive_itemitem_idblocked
share_onedrive_itemitem_id · link_type · scope? · expires_at?blocked
invite_to_onedrive_itemitem_id · emails · role · message? · send_invitation? · require_sign_in? · expires_at?blocked
list_onedrive_permissionsitem_idavailable
remove_onedrive_permissionitem_id · permission_idblocked

A folder_id, item_id or file_id is an ID the model got from another tool, or a path starting with /. The model's arguments are used as written: a {{payload…}} in them is not filled in.

What you control

  • Moving, deleting and sharing start blocked. move_onedrive_item, delete_onedrive_item, share_onedrive_item, invite_to_onedrive_item and remove_onedrive_permission — sharing counts here because a file once opened to others can't be un-seen. Unblock the ones the agent should have in the node's tool list. Any other tool can be blocked the same way — creating files, for an agent that should only read.
  • Folder the AI can use. Empty, the agent works on the whole OneDrive. Pick a folder and it only reaches what's inside it and its subfolders: an item outside is refused before anything changes, searches only return what's inside, an empty folder_id means that folder, and the folder itself can't be moved or deleted by the agent.
  • Text files only. The model writes files from text it composes (create_onedrive_text_file); it has no files of the flow to pass. Download file isn't a tool — read_onedrive_file gives the model the text instead. Replacing an existing file when creating or copying, embed links and links for specific people aren't available to the model either.
  • Characters per call sent to the model. 20,000 by default, and read_onedrive_file can't ask for more. Lists that don't fit are cut whole items at a time, with a notes field saying how many were left out.

Testing a tool

⚠Only a tool call picks the tool. In AI toolkit mode, only an AI Node, an MCP client or a voice agent chooses which tool the node runs. Run Test, a flow or a webhook run the operation saved on the node: an operation in their payload that names another tool is refused.
✦To try a tool, call it from an AI Node or from an MCP client. Its arguments look like this:
jsonA tool call
{ "operation": "list_onedrive_folder", "folder_id": "/Invoices", "order_by": "newest", "max_results": 10 }
⚠A node in toolkit mode is not part of the pipeline. Events arriving through connections made before you switched are refused — the node only runs the tool it is asked for.

The trigger

Pick a OneDrive credential, then what fires it and the folder to watch — from the account's own OneDrive, with Watch this folder; My files is the top:

  • File added — uploaded, created or moved into the folder.
  • File changed — its content, its name, or where it is inside the folder.
  • File removed — sent to the recycle bin, or moved out of the folder.
  • Any change — all three.

Optionally:

  • Include subfolders — off by default: only the folder's own files.
  • Also fire for folders — off by default: only files.
  • Only these types — extensions, pdf, xlsx.
  • Only names containing something (upper or lower case).
  • Attach the file — an added or changed file arrives with its _file, up to 16 MB (less if your plan's file limit is lower). A bigger one arrives without it, and _fileSkipped says why.
  • Skip changes made by HostWebhook's OneDrive nodes — on by default; see No loops.

How it fires

Activating subscribes to the account with Microsoft. Microsoft's notification only says that something changed, so HostWebhook then asks OneDrive what changed since the last time and keeps what happened in the watched folder. Each notification carries a secret that belongs to this trigger, and HostWebhook checks it before reading anything. Each change is delivered once, even when Microsoft sends several notifications for it; two changes to the same file are two runs. A change you can't see — same name, same place, same content — doesn't fire it. Deactivating deletes the subscription.

ℹUsually seconds — not always. Microsoft normally notifies within a minute but doesn't promise less than six hours, and it sends no notice when one is lost. So HostWebhook also checks the folder on its own every 30 minutes: a change is never more than half an hour late. Microsoft's subscriptions expire; HostWebhook asks for three days and renews them on its own every night.

The trigger's page says how it is getting the changes:

  • Microsoft notifies HostWebhook — the normal case.
  • Shares Microsoft's notifications with another trigger on this account — Microsoft won't take the same subscription twice for one account, so a second OneDrive trigger on that account listens to the first one's. Each still watches its own folder with its own filters. Deactivating the first hands the subscription over.
  • Checks every 5 minutes — when Microsoft won't take a subscription, as on a work account whose organization blocks it. The trigger keeps working on its own schedule and tries to subscribe again once a day.

No loops

A trigger on /Inbox and an Upload file into /Inbox in the same flow would fire itself forever. Skip changes made by HostWebhook's OneDrive nodes stops that: every OneDrive node notes what it uploads, creates, copies, moves or deletes — including the folders in between that Create folder makes, and what's inside a folder it copies — and for the next six hours the trigger skips those exact changes. Anything a person does to the file afterwards — a new version, a rename, a move — fires as usual. So does a file coming back: restored from the recycle bin, put back into the folder, or changed back to what the node had left. It looks exactly like the node's change, but the trigger saw it change or leave since then, so it counts as new.

  • Not covered: a folder copy the trigger sees before it ends — one still running when the node finished (it came back inProgress), or a big one whose first files show up while it is still copying —, anything past the first 2,000 items inside a copied folder, and changes made by other apps or automations.
  • With Also fire for folders, a subfolder a node writes into changes too — its size and date — so it can fire as File changed. Leave folders off on a trigger whose own flow writes inside the folder it watches.
  • Chaining two flows through a folder on purpose? Turn it off on the second flow's trigger.

Removed files and big folders

A removed file arrives with deleted: true and what HostWebhook remembered of it — its name and where it was. HostWebhook remembers the watched folder from the moment you activate and every file it sees change, up to 2,000 items per trigger. In a folder with more, a change to an older file may arrive as File changed (reason: "unknown") instead of File added; the trigger's page says when a folder has gone over. On a work account Microsoft reports a removal without the file's name, so a removed file HostWebhook never saw may not be delivered at all.

  • Activating again starts fresh. Changes made while the trigger was off are not delivered when you turn it back on. When HostWebhook re-subscribes on its own (an expired subscription, a renewal that failed), it picks up where it left off instead.
  • Files shared with you don't fire it: Microsoft doesn't notify about them.
  • The watched folder deleted? The trigger stays active but matches nothing until you pick another folder.

What the trigger sends downstream

The same item the action node returns, with what changed and the watched folder in front — a flow reads {{payload.path}} the same way from either:

{
  "event": "created",
  "service": "onedrive",
  "reason": "new",
  "changes": null,
  "previousName": null,
  "previousPath": null,
  "deleted": false,
  "watchedFolderId": "D4648F06C91D9D3D!1234",
  "watchedFolder": "Invoices",
  "watchedFolderPath": "/Invoices",
  "id": "D4648F06C91D9D3D!5678",
  "name": "invoice-0042.pdf",
  "kind": "file",
  "size": 48213,
  "mimeType": "application/pdf",
  "extension": "pdf",
  "path": "/Invoices/invoice-0042.pdf",
  "parentId": "D4648F06C91D9D3D!1234",
  "parentPath": "/Invoices",
  "driveId": "d4648f06c91d9d3d",
  "webUrl": "https://1drv.ms/b/s!…",
  "childCount": null,
  "createdAt": "2026-10-01T15:04:05Z",
  "lastModifiedAt": "2026-10-01T15:04:05Z",
  "createdBy": { "name": "Ana García", "email": null, "app": null },
  "lastModifiedBy": { "name": "Ana García", "email": null, "app": null },
  "contentHash": "…",
  "eTag": "…",
  "cTag": "…",
  "_file":{ "id": "…", "originalName": "invoice-0042.pdf", "mimeType": "application/pdf", "size": 48213, "downloadUrl": "https://…" }
}
  • event is created, updated or deleted.
  • reason says which kind: new or movedIn for an added file; content, renamed, moved or unknown for a changed one — with changes as { content, renamed, moved } and the previousName / previousPath; deleted or movedOut for a removed one.
  • _file only with Attach the file on.

Read it, copy it or archive it with the action node using {{payload.id}} — “when the accountant drops an invoice in /Invoices, read it with an AI Node and move it to /Invoices/Done”.

Trying it out

The trigger's Test push reads the latest files of the folder, applies your filters, and shows them exactly as a delivery will arrive — without running the flow and without downloading anything. To see a real one, activate the trigger and drop a file in that folder.


Good to know

Personal and work accounts

 PersonalWork or school
Every operation, the trigger and the toolkitYesYes
Embed linksYesNo
“People in your organization” linksNoYes
Expiry on links and on accessWith a Microsoft 365 subscriptionYes
Copy when the name is takenHostWebhook picks a free name; Replace isn't availableRename, Replace or Fail
TriggerMicrosoft notifiesMicrosoft notifies — or checks every 5 minutes if the organization blocks it

On a personal account, Microsoft doesn't take “if the name is taken” for copies, so HostWebhook finds a free name itself — report (2).pdf — and Replace fails with a message: delete the old one first, or rename. What a work account can't do (embed links) or a personal one can't (organization links) fails before anything is shared.

Sizes and counts

WhatUp to
Upload file — a file from the flow250 MB
Upload file — text you write4 MB
Download file, and the trigger's Attach the file16 MB — or your plan's per-file limit, if lower
List folder — Download the files too10 files, 16 MB each (or your plan's limit), 32 MB in all
Read file as textFiles up to 10 MB; 50,000 characters by default, 200,000 at most
List folder50 items by default, 200 at most
Search25 results by default, 50 at most
Share with people20 addresses; a message of up to 2,000 characters
Copy — Wait for itUp to a minute

When it fails

  • A name that's taken with fail says which one is already in the folder; a full OneDrive says so.
  • Reconnect — the account revoked HostWebhook or the sign-in expired: reconnect the credential in Settings → Credentials.
  • Busy or throttled. Microsoft limits how fast one account can be called. When it answers that it is busy, the node waits the time it asks for (up to ten seconds) and tries once more before giving up with Microsoft's message.