Automate File Uploads to Microsoft SharePoint & OneDrive via Graph API
detail.loadingPreview
Effortlessly automate the secure upload of files to Microsoft SharePoint or OneDrive using the powerful Microsoft Graph API. This workflow streamlines authentication and enables dynamic specification of target folders and filenames.
About This Workflow
This n8n workflow provides a robust solution for automating file uploads to your Microsoft SharePoint or OneDrive environments. It handles the complete process, from securely authenticating with the Microsoft Graph API using client credentials to dynamically determining the file's destination. While designed with a placeholder image for testing, it's easily adaptable to integrate with any source providing binary file data. Streamline your document management, archiving, and data syncing tasks by leveraging the power of n8n and Microsoft's robust cloud services.
Key Features
- Seamless Microsoft Graph API Integration: Securely authenticate using Client Credentials flow to interact with SharePoint and OneDrive.
- Dynamic File Path Configuration: Easily define target folders and filenames within your SharePoint or OneDrive drive.
- Flexible File Source: Designed to accept binary data from any upstream n8n node, allowing diverse file upload scenarios.
- Robust Upload Mechanism: Utilizes the n8n
httpRequestnode for reliable binary data uploads to Microsoft services. - Clear Setup Instructions: Includes inline sticky notes for easy prerequisite and configuration guidance.
How To Use
- Prerequisites:
- Create an Application User: Follow Microsoft's guide to create an application user in your Azure AD/Power Platform environment.
- Grant API Permissions: Ensure the application user has
Sites.ReadWrite.All(for SharePoint site access) andFiles.ReadWrite.All(for file upload operations) permissions.
- Configure Sensitive Data:
- Open the
Set config (sensitive data)node. - Replace the placeholder values for
TENANT_ID,CLIENT_ID, andCLIENT_SECRETwith your actual Azure AD application details. - Important: For production environments, do not store sensitive credentials directly in a
Setnode. Instead, utilize n8n's secure Credentials feature or an external secure vault.
- Open the
- Set File Source:
- The
Get photo (for testing purposes)node is included as a placeholder. Replace or connect this node to your actual file source. Ensure your chosen node outputs binary data in thedatafield for theUpload photonode. Examples include reading from a file system, fetching from an email attachment, or downloading from another HTTP endpoint.
- The
- Define Destination:
- In the
Set destinationnode, configure theTARGET_FOLDER(e.g.,/CompanyDocuments/SalesReports) andFILE_NAME(e.g.,Q3_Report_{{ $today }}.pdf). - You can use n8n expressions (like
{{ $json.filename_from_previous_node }}or{{ new Date().toISOString() }}.jpg) for dynamic naming.
- In the
- Run Workflow: Execute the workflow to test the file upload. Verify the file appears in your specified SharePoint or OneDrive location.
Apps Used
Workflow JSON
{
"id": "ec51507c-df8f-4067-93bc-1d0189cb786d",
"name": "Automate File Uploads to Microsoft SharePoint & OneDrive via Graph API",
"nodes": 12,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: ec51507c-df8f...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Google Sheets to Icypeas: Automated Bulk Domain Scanning
This workflow streamlines the process of performing bulk domain scans by integrating your Google Sheets data directly with the Icypeas platform. Automate the submission of company names from your spreadsheet to Icypeas for comprehensive domain information, saving valuable time and effort.
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.
On-Demand Microsoft SQL Query Execution
This workflow allows you to manually trigger and execute any SQL query against your Microsoft SQL Server database. Perfect for ad-hoc data lookups, administrative tasks, or quick tests, giving you direct control over your database operations.