Home » n8n» How to connect Excel to n8n with Docker and Office 365

Connect Excel to n8n?

You can connect Excel to n8n using the Microsoft Excel node with an Office 365 account and an Azure app registration. This guide shows a direct path to get a working workflow with Docker or Node.js and clear command examples.

What You Need

  • An Office 365 account with Excel files in OneDrive or SharePoint.
  • An Azure app registration to grant Microsoft Graph access.
  • Docker installed, or Node.js and npx if you run n8n locally.
  • Access to n8n web UI on port 5678.

How to connect Excel to n8n using Office 365

Step 1: Register an app in Azure AD. Give it Microsoft Graph permissions to read files and offline_access. Set the redirect URI to your n8n callback:

https://localhost:5678/rest/oauth2-credential/callback

Step 2: Note the Application (client) ID and Client Secret. You will use these in n8n credentials.

Step 1: Run n8n with Docker or Node.js

Use Docker (recommended for beginners). Save this docker-compose.yml and run it.

version: '3'
services:
  n8n:
    image: n8nio/n8n:latest
    ports:
      - "5678:5678"
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=changeme
      - N8N_HOST=localhost
    volumes:
      - ./n8n_data:/home/node/.n8n

Start with:

docker-compose up -d

Or run with Node.js for quick testing:

npx n8n start --tunnel

Step 2: Add Microsoft Excel credentials in n8n

  1. Open n8n UI at http://localhost:5678 and log in.
  2. Go to Credentials > New Credential > Microsoft Excel.
  3. Enter the Client ID, Client Secret, and the tenant ID from Azure.
  4. Press Connect and complete the OAuth flow to grant access to your Excel files.

Step 3: Build a simple workflow

Add a trigger node (Cron or Webhook). Then add the Microsoft Excel node. Choose the workbook path in OneDrive or SharePoint. Use a Function node to parse rows.

// Example Function node to map rows
return items.map(item => {
  return {
    json: {
      name: item.json['Name'],
      email: item.json['Email']
    }
  };
});

Step-by-step logic

  1. Create Azure app and set redirect URI.
  2. Run n8n with Docker or npx.
  3. Create Microsoft Excel credentials in n8n and authenticate.
  4. Build a workflow: trigger > Microsoft Excel node > Function or HTTP node.
  5. Test the workflow and inspect output in the execution view.

Update

To update the Docker image, pull and recreate the container:

docker pull n8nio/n8n:latest
docker-compose down
docker-compose up -d

To update a local npx run, reinstall or run npx again:

npx n8n@latest start

Security

  • Use HTTPS in production. Terminate TLS at a reverse proxy like Nginx or Traefik.
  • Keep Client Secret values in n8n credentials only. Do not hard-code them in workflows.
  • Use least privilege for Azure app permissions. Grant only the Graph scopes you need.
  • Enable basic auth or other auth for n8n and store data volumes securely.

Done

You now have a working method to connect Excel to n8n using Office 365. You can read rows, write updates, and automate tasks. Use the workflow editor to expand automation with HTTP, Slack, or email nodes.


If you need a sample workflow file or help registering the Azure app, you can follow the Azure portal prompts or ask for the next steps.

Neil
Written by Neil

Neil is a true n8n geek who lives and breathes workflow automation. He dives deep into nodes, triggers, webhooks, custom logic, and self-hosting setups, sharing everything he learns about n8n on AutomationCompare.com. As part of a broader team of automation specialists, Neil focuses purely on mastering n8n and helping others unlock its full potential.

Keep Reading

Scroll to Top