How to Connect OneDrive to n8n: Step-by-Step Guide

3 min read 5 days ago
Published on Aug 31, 2025 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

This tutorial will guide you through the process of connecting OneDrive to n8n, a powerful automation tool. By following these steps, you'll be able to streamline file management, automate uploads and downloads, and enhance your workflows using OneDrive's capabilities. This guide is ideal for developers, businesses, and automation enthusiasts looking to improve productivity through effective integrations.

Step 1: Set Up Your n8n Environment

Before you can connect OneDrive, ensure that you have n8n set up correctly.

  1. Access n8n:

    • Go to the n8n website and log in or create an account if you haven't done so.
    • You can use the self-hosted version or the cloud version based on your preference.
  2. Create a New Workflow:

    • Once logged in, click on the "New" button to create a new workflow.

Step 2: Authenticate OneDrive in n8n

Connecting OneDrive requires authentication to allow n8n to access your files.

  1. Add OneDrive Node:

    • In your new workflow, search for the OneDrive node in the node selection area.
    • Drag and drop the OneDrive node into the workflow canvas.
  2. Configure Authentication:

    • Click on the OneDrive node to open its settings.
    • Select "OAuth2" as the authentication type.
    • Click on "Create New" to initiate the authentication process.
  3. Obtain OAuth Credentials:

    • You will need to create an app in the Azure portal:
      • Go to the Azure Portal.
      • Navigate to "Azure Active Directory" > "App registrations" > "New registration".
      • Fill in the app details and set the redirect URI to http://localhost:5678/rest/oauth2/callback.
    • After registration, note the Application (client) ID and Directory (tenant) ID.
    • Create a new client secret under "Certificates & secrets" and save it.
  4. Enter Credentials in n8n:

    • Back in n8n, input the client ID, client secret, and tenant ID into the OneDrive node’s authentication settings.
    • Click on "Connect" to authorize n8n to access your OneDrive account.

Step 3: Create Workflows Using OneDrive

Now that OneDrive is connected, you can start creating workflows.

  1. Add Actions:

    • Use the OneDrive node to add actions like uploading a file, downloading a file, or listing files in a folder.
    • Configure each action by specifying parameters such as file paths or names.
  2. Combine with Other Nodes:

    • To enhance your workflow, combine the OneDrive node with other nodes in n8n. For example, you can use a trigger node to start the workflow when a file is added to a specific OneDrive folder.
  3. Test Your Workflow:

    • Click on the "Execute Workflow" button to test your setup.
    • Monitor the output to ensure files are processed as expected.

Step 4: Troubleshoot Common Issues

If you encounter any issues during the integration, consider these common troubleshooting tips:

  • Authorization Errors:

    • Check that your client ID and secret are entered correctly.
    • Ensure that the redirect URI in Azure matches the one set in n8n.
  • File Access Problems:

    • Verify that the OneDrive account has the necessary permissions to access and manage files.
    • Ensure that the folder paths specified in your workflow are correct.

Conclusion

You have now successfully connected OneDrive to n8n and created your first automated workflows. By leveraging this integration, you can efficiently manage files, automate processes, and improve your productivity. Explore additional workflows by combining OneDrive with other applications in n8n to maximize its potential. For further learning, consider exploring more resources on workflow automation and cloud integrations.