Automated OneDrive CSV Processor and Excel Data Sync - n8n Workflow

Use this robust n8n workflow to automatically monitor a OneDrive folder for new CSV files, extract the data, clean it, and sync it directly into a Microsoft Excel table. Essential n8n templates for finance data.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Finance and Accounting Teams: Who regularly upload transaction or ledger data as CSV files to a cloud storage system and need real-time aggregation.
Data Engineers/Analysts: Looking for reliable n8n templates to handle continuous data ingestion from Microsoft cloud services.
n8n Automation Specialists: Seeking an advanced example of using file operations, conditional logic, and data transformation within a single n8n workflow.
Users of n8n: Needing an efficient way to automate cloud storage file processing and database updates.

Overview

Data synchronization between cloud storage and reporting tools often requires manual effort, especially when dealing with proprietary formats like CSV uploaded to OneDrive. This expert n8n workflow eliminates that manual overhead. It starts with a Microsoft OneDrive n8n trigger that instantly detects new file uploads. The system validates the file format, extracts the data using the powerful Extract From File n8n node, cleans it via a custom code n8n node, and seamlessly appends the structured data directly into a designated Microsoft Excel table. This robust n8n automation ensures your finance reports are always up-to-date with minimal latency, providing a perfect example of effective n8n templates for cloud data management.

How it Works

This automated n8n workflow executes the following sequential steps:


  1. File Upload Detection (n8n Trigger): The n8n workflow is initiated by the 'Triggers if new file in watched folder' Microsoft OneDrive n8n trigger whenever a new file is uploaded to the monitored folder.

  2. Event Logging: The initial event details are logged into a specified Microsoft Excel sheet using the 'Logs the update on sheet' n8n node, providing an audit trail.

  3. File Metadata Retrieval: The flow uses a Microsoft OneDrive n8n node ('Gets the new file infos') to retrieve detailed metadata about the newly uploaded file.

  4. File Download: The 'Downloads the new file' Microsoft OneDrive n8n node pulls the actual file content into the n8n execution context.

  5. Format Validation (Conditional Logic): An If n8n node ('Checks if it's CSV format') verifies if the file extension is CSV. If it is not CSV, the flow is terminated with the 'Not CSV' Stop and Error n8n node.

  6. Data Extraction: If the format is confirmed, the 'Extracts data from csv' n8n node parses the raw file buffer into structured JSON data.

  7. Data Cleaning/Transformation: A custom Code n8n node ('Cleans the output') performs necessary data sanitization or structure modifications on the extracted financial records.

  8. Payload Preparation: The Set n8n node ('Prepares the fields to put in the excel table') maps the cleaned fields to match the required columns in the target Excel table.

  9. Excel Update: The final 'Updates the excel table' Microsoft Excel n8n node appends the prepared financial data records to the specified table, completing the primary objective of this n8n workflow.

  10. Confirmation: The workflow concludes after the update confirmation, utilizing a final OneDrive n8n node followed by a No Operation n8n node.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the provided JSON code and paste it into your n8n instance via the 'New' menu > 'Import from JSON'.

  2. OneDrive Setup:

Configure the 'Triggers if new file in watched folder' n8n trigger. You will need to select your Microsoft OneDrive credential and specify the exact folder path to monitor for incoming CSV files.
Ensure all subsequent Microsoft OneDrive n8n nodes ('Gets the new file infos', 'Downloads the new file') use the same, authorized credential.

  1. Microsoft Excel Setup:

Set up credentials for Microsoft Excel. You will need a spreadsheet and a named table ready to receive the data.
Configure the 'Logs the update on sheet' n8n node and the crucial 'Updates the excel table' n8n node with the correct Workbook ID and Table Name.

  1. Custom Code Review: Review the 'Cleans the output' Code n8n node to ensure its custom logic matches your specific data transformation needs.

  2. Activate: Once all connections and parameters are configured, activate the n8n workflow.

Node Details

Microsoft OneDrive Trigger (Triggers if new file in watched folder): The starting n8n trigger. This node continuously watches a specific OneDrive folder and fires the n8n workflow immediately upon detecting a new file upload. Key Configuration includes defining the watched folder path.
Microsoft Excel (Logs the update on sheet): Records the metadata of the triggering event into an audit log sheet. Function: Appends a row detailing the new file creation.
Microsoft OneDrive (Downloads the new file): Uses the file ID provided by the n8n trigger to download the physical file content necessary for later extraction.
If n8n node (Checks if it's CSV format): Implements flow control by inspecting the file name or MIME type to ensure the file is in CSV format. If not, the automation stops to prevent processing errors.
Extract From File (Extracts data from csv): A critical n8n node that converts the raw CSV file buffer into usable JSON item arrays.
Code n8n node (Cleans the output): Executes custom JavaScript logic to restructure, rename, or calculate new fields required for the target Excel schema.
Set n8n node (Prepares the fields to put in the excel table): A standard n8n node used to finalize the data structure, ensuring only the necessary fields are passed to the update step, preparing the payload for the final sink.
Microsoft Excel (Updates the excel table): The final action n8n node. It connects to Microsoft 365 and appends all cleaned and prepared records to a specified table within an Excel workbook.

Related n8n Workflows

Paid

Nodes: 10 Nodes
Updated: December 26 2025
View all
Created by

Featured*