Description
n8n-nodes-ms-onedrive-business
This is an n8n community node. It lets you use Microsoft OneDrive for Business, SharePoint, and Excel in your n8n workflows.
Microsoft OneDrive for Business is a cloud storage service for business users that integrates with Microsoft 365 and SharePoint.
n8n is a fair-code licensed workflow automation platform.
Installation | Operations | File Selection | Credentials | Compatibility | Resources
Installation
Follow the installation guide in the n8n community nodes documentation.
npm install n8n-nodes-ms-onedrive-business
Operations
File Operations
- Upload — Upload files to OneDrive or SharePoint
- Download — Download files. Supports four output modes:
- Get — Retrieve file metadata
- Delete — Remove files
- Rename — Rename files
- Search — Search for files by name
- Share — Create sharing links (view/edit, anonymous/organization)
- Create — Create new folders
- Delete — Remove folders
- Get Items — List folder contents
- Rename — Rename folders
- Search — Search for folders by name
- Share — Create sharing links for folders
- Read Rows — Read rows from a worksheet, returned as structured JSON items.
- Append or Update Row — Write data to a worksheet.
- Delete Rows — Delete one or more rows from a worksheet. Returns the deleted row data as output items.
- File Updated is the correct event for detecting file renames — renaming a file is a file metadata change, not a folder change.
- Folder Updated only fires when a subfolder item itself is renamed or moved. It does NOT fire when files inside the folder are added, renamed, or updated.
- Selecting a specific file for “File Updated” narrows the trigger to only that file. Selecting a folder watches all files inside it.
- The trigger uses Microsoft Graph subscriptions (webhook-based), so a publicly accessible HTTPS URL is required —
http://localhostwill not work. - After updating the package, deactivate and re-activate the workflow to reinitialise the subscription and delta state.
- ▶ FolderName — a folder; selecting it navigates deeper
- FileName (no prefix) — a specific file; only available when event is “File Updated”
- — Use Level N Folder — — stop here and use the folder selected at Level N as the target
- Browse (default) — Navigate up to 5 levels deep. Each level dynamically loads its contents from OneDrive/SharePoint as you select. Files and folders are displayed with icons.
- By Path — Type the full path directly (e.g.
/Documents/Reports/Q1.xlsx). - By ID — Provide the OneDrive item ID directly for maximum precision.
- By Sharing Link — Paste any OneDrive or SharePoint sharing link to access a shared file or folder directly, without needing to know its path or ID.
- User Drive — The authenticated user’s own OneDrive, or any other user’s drive by UPN or ID. Leave User ID empty to use the authenticated user.
- SharePoint Site Drive — A SharePoint site’s document library.
- Shared Folder (Link) — Paste an OneDrive or SharePoint sharing link to browse and operate on a folder that has been shared with you. Once the link is entered, the full 5-level hierarchical folder/file browser works inside the shared folder, exactly like a regular drive.
- Application (client) ID: Copy from Overview page
- Directory (tenant) ID: Copy from Overview page
- Minimum n8n version: 1.0.0
- Tested with: n8n 1.x
- n8n community nodes documentation
- Microsoft Graph API Documentation
- OneDrive API Reference
- New output mode: Markdown From Docx — converts
.docxfiles to Markdown usingmammoth; non-.docxfiles fall back to base64 - New parameter: Docx-to-Markdown: Image Handling — Placeholder (default), Drop, or Include (Base64); prevents base64 images from flooding AI Agent context windows
- Fix: Folder Get Items no longer returns an extra empty item at the end — output items are now correctly wrapped
- Fix: File Search and Folder Search had the same output wrapping bug — now return proper items
- Download: Text Only (No Metadata) mode — outputs only the file content field with no OneDrive metadata; saves tokens when used as an AI Agent tool
- Download: JSON auto-parse —
.jsonfiles are now automatically parsed into JSON objects instead of raw strings _textEncodingfield now returns"json","utf-8", or"base64"- Download: Text Output mode — Binary Only (default), Text Only, or Both. Auto-detects MIME type: text files decoded as UTF-8, binary files as base64. A
_textEncodingfield indicates encoding. - Browse dropdowns now reload immediately when Drive Type changes —
sharedLinkUrladded to allloadOptionsDependsOnarrays - Fix: Excel browse Level 1 hint added; Excel levels 2–5 now correctly declare
driveTypeas a dependency - README updated with Shared Folder (Link) drive type and By Sharing Link selection mode documentation
- Fixed “Shared Folder (Link)” in trigger: now shows a clear error immediately explaining the Graph API limitation, instead of a confusing “Forbidden” message
- By Sharing Link file/folder selection — paste any OneDrive/SharePoint sharing link to access a shared file or folder directly
- Shared Folder (Link) drive type — full 5-level browse, download, upload, get, delete, rename, share, and Excel operations inside a shared folder
- Upload destination now supports “By Sharing Link” selection mode
- Added Excel resource with Read Rows, Append/Update Row, and Delete Rows operations
- Browser-like hierarchical folder/file picker for Excel workbook selection
- Worksheet dropdown auto-populates after selecting an Excel file
rownumberfield added to Read Rows output for use in Delete/Update flows- Delete Rows supports Row Number mode (via
rownumber) and Row Range mode - Append/Update preserves existing column values — only specified columns are overwritten
- Match Record by Column is a selectable dropdown with hint text
- Extended Microsoft OAuth2 credential with credential test
- Simplified credential to essential fields only
- Hierarchical folder browse UI for all folder/file selection fields
- Initial release
- File operations (Upload, Download, Get, Delete, Rename, Search, Share)
- Folder operations (Create, Delete, Get Items, Rename, Search, Share)
- Support for User Drives and SharePoint Site Drives
– Binary Only (default) — file attached as binary data
– Text Only — content placed in a configurable JSON field (e.g. data); no binary attachment:
– .json files → parsed into a JSON object
– Text files (.txt, .md, .csv, .xml, .yaml, etc.) → UTF-8 string
– Binary files (images, PDFs, Office docs) → base64 string
– Text Only (No Metadata) — same as Text Only but without OneDrive file metadata fields; ideal when used as a tool with AI Agents to minimise token usage
– Markdown From Docx — converts .docx files to Markdown using mammoth. Image handling is configurable: Placeholder (default — [Image: filename.ext]), Drop, or Include (Base64). Non-.docx files fall back to base64.
– Both — text in JSON field plus binary attachment
A _textEncoding field ("json", "utf-8", "base64", or "markdown") is always included so downstream nodes know how to handle the content.
Folder Operations
Excel Operations
Read and write data in Excel workbooks stored on OneDrive or SharePoint.
Each item includes a rownumber field (the actual Excel row number, e.g. 2, 3…) that can be used to target rows in subsequent Delete or Update operations.
– Match Record by Column — Select a column to look up an existing row. If a match is found it is updated; if not, a new row is appended. Leave empty to always append.
– Matching Value — The value to search for in the match column.
– Data Mode:
– Auto-Map Input Data to Columns — Automatically maps incoming $json fields to column headers by name.
– Map Each Column Manually — Explicitly set a value (or expression) for each column.
– Unspecified columns are preserved — only the columns you define are overwritten.
– By Row Number — Provide a single row number (use {{ $json.rownumber }} from a Read Rows step).
– By Row Range — Provide a range address such as 2:5 to delete multiple rows.
OneDrive Business Trigger
Listens for changes in OneDrive/SharePoint using Microsoft Graph change notifications and the delta API.
#### Events
| Event | Fires when… | What to select |
|—|—|—|
| File Created | A new file is uploaded to the watched folder | Select the parent folder to watch |
| File Updated | A file is renamed, moved, or its content changes | Select the parent folder (any file inside) or a specific file |
| Folder Created | A new subfolder is created inside the watched folder | Select the parent folder to watch |
| Folder Updated | A subfolder is renamed or moved | Select the parent folder that contains the subfolders |
#### Important notes
#### Folder/File Selection for Browse mode
File Selection
All file and folder fields support multiple selection modes:
The same picker is used for selecting Excel workbooks, so worksheets load automatically once you select a file.
Drive Types
Every operation supports:
> Note: The “Shared Folder (Link)” drive type is supported for all operational node actions (download, upload, get, delete, rename, share, folder operations, Excel). It is not supported for the trigger node — Microsoft Graph subscriptions require direct drive ownership and do not work with sharing-link access.
Credentials
Prerequisites
1. Azure Active Directory (Entra ID) account
2. Permissions to create App Registrations in Azure Portal
Setup Steps
#### 1. Create App Registration
1. Go to Azure Portal
2. Navigate to Azure Active Directory → App registrations
3. Click New registration
4. Enter name: n8n OneDrive Business
5. Select Accounts in this organizational directory only (or multi-tenant if needed)
6. Set Redirect URI: https://your-n8n-instance.com/rest/oauth2-credential/callback
7. Click Register
#### 2. Configure API Permissions
1. Go to API permissions
2. Click Add a permission → Microsoft Graph → Delegated permissions
3. Add these permissions:
– Files.ReadWrite.All
– Sites.ReadWrite.All
– offline_access
4. Click Add permissions
5. Click Grant admin consent (requires admin)
#### 3. Create Client Secret
1. Go to Certificates & secrets
2. Click New client secret
3. Enter description: n8n integration
4. Select expiration (recommend 24 months)
5. Click Add
6. Copy the secret value immediately (you won’t see it again)
#### 4. Get Required IDs
#### 5. Configure in n8n
1. In n8n, create a new credential: Microsoft OneDrive Business OAuth2 API
2. Enter:
– Client ID: Application (client) ID from Azure
– Client Secret: Secret value from step 3
3. Click Connect my account and authorize