<!-- BusyBot node reference — https://busybot.net/tools/microsoft-onedrive/ -->

> Node: Microsoft OneDrive (`microsoft_onedrive`) · Action (binary) · v1
> Category: Data & Storage · Credentials: Microsoft OAuth2 (`microsoftOAuth2`)
> Updated: 2026-08-16

# Microsoft OneDrive

> Manage files and folders in Microsoft OneDrive

## Overview

Full file and folder management through the Microsoft Graph API, across two resources. File operations cover upload (binary or text content, up to 4 MB), download, copy, delete, get metadata, rename, search, and share-link creation. Folder operations cover create (including nested paths), delete, list contents, rename, search, and share. Downloads produce binary data on the output item; uploads consume binary data from an upstream node. Authentication is OAuth2, with tokens refreshed automatically.

**Category:** Data & Storage  
**Tool Name:** `microsoft_onedrive`  
**Version:** 1

**Appearance:** Icon: `lucide-HardDrive` | Color: `#0078D4`

## Node Type

**Action (Binary)** — handles file/binary data operations

## Input / Output

| Direction | Port(s) |
|-----------|--------|
| Input | `Input` |
| Output | `Output`, `Error` |

## Credentials

This tool requires **Microsoft OAuth2** credentials.
See the [Credentials Guide](https://busybot.net/credentials/microsoft-oauth2/) for setup instructions.

### Resources

| Resource | Value |
|----------|-------|
| File | `file` |
| Folder | `folder` |

### Operations

File operations come first, then folder operations. Four names are shared between the two resources; the Resource selector decides which applies.

| Operation | Value | Description |
|-----------|-------|-------------|
| Copy | `copy` | Copy a file |
| Delete | `delete` | Delete a file |
| Download | `download` | Download a file |
| Get | `get` | Get file metadata |
| Rename | `rename` | Rename a file |
| Search | `search` | Search for files |
| Share | `share` | Create a sharing link for a file |
| Upload | `upload` | Upload a file (up to 4MB) |
| Create | `create` | Create a folder |
| Delete | `delete` | Delete a folder |
| Get Children | `getChildren` | Get items inside a folder |
| Rename | `rename` | Rename a folder |
| Search | `search` | Search for folders |
| Share | `share` | Create a sharing link for a folder |

### Parameters

#### File: Copy

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| File ID | `string` | Yes | — | ID of the file to copy. Supports expressions like {{ $json.fileId }}. |
| Additional Fields | `collection` | No | `{}` | Extra properties to apply to the copy. |
| — Name | `string` | No | — | The new name for the copy. If not provided, the same name will be used as the original. |
| Parent Reference | `collection` | No | `{}` | Reference to the parent item the copy will be created in. |
| — Drive ID | `string` | No | — | Identifier of the drive instance that contains the item. |
| — Drive Type | `string` | No | — | Identifies the type of drive. |
| — ID | `string` | No | — | Identifier of the target folder in the drive. |
| — List ID | `string` | No | — | Identifier of the list. |
| — Name | `string` | No | — | The name of the item being referenced. |
| — Path | `string` | No | — | Path that can be used to navigate to the item. |
| — Share ID | `string` | No | — | Identifier for a shared resource accessible via the Shares API. |
| — Site ID | `string` | No | — | Identifier of the site. |

#### File: Delete

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| File ID | `string` | Yes | — | ID of the file to delete. Supports expressions. |

#### File: Download

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| File ID | `string` | Yes | — | ID of the file to download. Supports expressions. |
| Binary Property | `string` | Yes | `data` | Name of the binary property to write the downloaded file to. Names are case-sensitive — see the upstream node's Binary Data panel for the exact names to use. |

#### File: Get

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| File ID | `string` | Yes | — | ID of the file to retrieve metadata for. Supports expressions. |

#### File: Rename

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Item ID | `string` | Yes | — | ID of the file to rename. Supports expressions. |
| New Name | `string` | Yes | — | New name for the file. Supports expressions. |

#### File: Search

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Query | `string` | Yes | — | The query text used to search for files. Values may be matched across filenames, metadata, and file content. |

#### File: Share

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| File ID | `string` | Yes | — | ID of the file to share. Supports expressions. |
| Type | `options` | Yes | `view` | The type of sharing link to create. |
| | | | | Options: `view`, `edit`, `embed` |
| Scope | `options` | Yes | `anonymous` | Who can use the sharing link. |
| | | | | Options: `anonymous`, `organization` |

#### File: Upload

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Parent ID | `string` | Yes | — | ID of the destination folder to upload the file into. Supports expressions. |
| File Name | `string` | No | — | The name the file should be saved as. For binary upload, falls back to the binary data filename if not set. For text upload, this is required. |
| Binary File | `boolean` | Yes | `true` | Whether to upload binary data from a binary property (true) or text content (false). |
| Binary Property | `string` | Yes | `data` | Name of the binary property containing the file to upload. Names are case-sensitive — see the upstream node's Binary Data panel for the exact names to use. _(shown when Binary File is `true`)_ |
| File Content | `string` | Yes | — | The text content to upload as a file. Supports expressions. _(shown when Binary File is `false`)_ |

#### Folder: Create

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Name | `string` | Yes | — | The name or slash-separated path of the folder to create (e.g., /Reports/2024 creates nested folders). |
| Options | `collection` | No | `{}` | Where to create the folder. |
| — Parent Folder ID | `string` | No | — | ID of the parent folder to create the new folder in. If empty, creates under drive root. |

#### Folder: Delete

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Folder ID | `string` | Yes | — | ID of the folder to delete. Supports expressions. |

#### Folder: Get Children

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Folder ID | `string` | Yes | — | ID of the folder to list contents of. Supports expressions. |

#### Folder: Rename

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Item ID | `string` | Yes | — | ID of the folder to rename. Supports expressions. |
| New Name | `string` | Yes | — | New name for the folder. Supports expressions. |

#### Folder: Search

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Query | `string` | Yes | — | The query text used to search for folders. Values may be matched across folder names and metadata. |

#### Folder: Share

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Folder ID | `string` | Yes | — | ID of the folder to share. Supports expressions. |
| Type | `options` | Yes | `view` | The type of sharing link to create. |
| | | | | Options: `view`, `edit`, `embed` |
| Scope | `options` | Yes | `anonymous` | Who can use the sharing link. |
| | | | | Options: `anonymous`, `organization` |

#### All Operations

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Microsoft Account | `credential` | No | — | Connect your Microsoft account via OAuth2. |
| Max Concurrency | `number` | No | `10` | Maximum number of items to process concurrently. |

## Output Data

Results are merged into the input item's JSON, so the incoming fields stay available downstream, and binary data on the input item is forwarded.

| Operation | Output |
|-----------|--------|
| `file` / `get`, `rename`, `upload` | One item carrying the OneDrive item's metadata (`id`, `name`, `size`, `webUrl`, `file`, `parentReference`, timestamps …). |
| `file` / `download` | One item whose JSON is unchanged; the downloaded file is written to the binary property you named, alongside any binary already on the item. |
| `file` / `copy` | One item carrying `location` — the monitor URL for the copy, which OneDrive runs asynchronously. |
| `file` / `delete` | One item carrying `success: true`. |
| `file` / `search` | **One item per matching file.** Folders are filtered out. When nothing matches, one item carrying an empty `results` array. |
| `file` / `share`, `folder` / `share` | One item carrying the created permission, including a `link` object with the shareable `webUrl`. |
| `folder` / `create` | One item carrying the metadata of the folder that was created — for a nested path, the deepest one. |
| `folder` / `delete` | One item carrying `success: true`. |
| `folder` / `getChildren` | **One item per child** of the folder, files and folders alike. An empty folder produces one item carrying an empty `results` array. |
| `folder` / `rename` | One item carrying the folder's updated metadata. |
| `folder` / `search` | **One item per matching folder.** Files are filtered out. When nothing matches, one item carrying an empty `results` array. |

A metadata result looks like this:

```json
{
  "id": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K",
  "name": "Q4-2024-Report.xlsx",
  "size": 24576,
  "webUrl": "https://contoso-my.sharepoint.com/personal/…",
  "lastModifiedDateTime": "2024-11-04T10:12:31Z",
  "file": { "mimeType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }
}
```

Chain operations by expression — for example feed `{{ $json.id }}` from a search into a download.

## Usage Examples

- Download a file from OneDrive by ID
- Upload a binary file to a specific OneDrive folder
- Upload text content as a new file in OneDrive
- Search OneDrive for files matching a query
- Create a nested folder structure in OneDrive
- Get the contents of a OneDrive folder
- Create a sharing link for a file
- Copy a file to a different folder
- Rename a file or folder in OneDrive
- Delete a file or folder from OneDrive

## Example Configuration

Upload a file coming from an upstream node as binary:

```json
{
  "type": "microsoft_onedrive",
  "parameters": {
    "resource": "file",
    "operation": "upload",
    "binaryData": true,
    "binaryPropertyName": "data",
    "fileName": "{{ $json.filename }}",
    "parentId": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K"
  }
}
```

Upload text content as a new file:

```json
{
  "type": "microsoft_onedrive",
  "parameters": {
    "resource": "file",
    "operation": "upload",
    "binaryData": false,
    "fileName": "report.txt",
    "fileContent": "{{ $json.body }}",
    "parentId": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K"
  }
}
```

Download a file into a named binary property:

```json
{
  "type": "microsoft_onedrive",
  "parameters": {
    "resource": "file",
    "operation": "download",
    "fileId": "{{ $json.id }}",
    "binaryPropertyName": "downloadedFile"
  }
}
```

Copy a file into a backup folder under a new name:

```json
{
  "type": "microsoft_onedrive",
  "parameters": {
    "resource": "file",
    "operation": "copy",
    "fileId": "{{ $json.originalFileId }}",
    "additionalFields": {
      "name": "backup-{{ $json.originalName }}"
    },
    "parentReference": {
      "id": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD999",
      "path": "/drive/root:/Backups"
    }
  }
}
```

Create an organization-only edit link:

```json
{
  "type": "microsoft_onedrive",
  "parameters": {
    "resource": "file",
    "operation": "share",
    "fileId": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K",
    "type": "edit",
    "scope": "organization"
  }
}
```

Search for files:

```json
{
  "type": "microsoft_onedrive",
  "parameters": {
    "resource": "file",
    "operation": "search",
    "query": "quarterly report 2024"
  }
}
```

Rename a file:

```json
{
  "type": "microsoft_onedrive",
  "parameters": {
    "resource": "file",
    "operation": "rename",
    "itemId": "{{ $json.id }}",
    "newName": "Q4-2024-Report.xlsx"
  }
}
```

Create a nested folder path in one step:

```json
{
  "type": "microsoft_onedrive",
  "parameters": {
    "resource": "folder",
    "operation": "create",
    "name": "/Projects/{{ $json.projectName }}/{{ $json.phase }}",
    "options": {
      "parentFolderId": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD999"
    }
  }
}
```

List the contents of a folder:

```json
{
  "type": "microsoft_onedrive",
  "parameters": {
    "resource": "folder",
    "operation": "getChildren",
    "folderId": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K"
  }
}
```

Create a public read-only link to a folder:

```json
{
  "type": "microsoft_onedrive",
  "parameters": {
    "resource": "folder",
    "operation": "share",
    "folderId": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K",
    "type": "view",
    "scope": "anonymous"
  }
}
```

Delete a file:

```json
{
  "type": "microsoft_onedrive",
  "parameters": {
    "resource": "file",
    "operation": "delete",
    "fileId": "{{ $json.id }}"
  }
}
```

### Error Handling

| Mode | Behavior |
|------|----------|
| **stop** | Halts workflow on first error |
| **continue** | Skips failed items, passes successful ones through |
| **errorPort** | Routes failed items to Error output port |

## Tips

Upload, download, copy, delete, rename, search, and share files and folders in Microsoft OneDrive via the Graph API.

- **Uploads are limited to 4 MB.** Larger files need to be broken up before they reach this node.
- **Binary File decides where the content comes from.** With it on, the node reads the binary property you name; with it off, it uploads the text in File Content and File Name becomes mandatory.
- **Binary property names are case-sensitive.** Check the upstream node's Binary Data panel for the exact name before typing it here.
- **Copy is asynchronous.** OneDrive accepts the request and returns a `location` monitor URL; the copy may not exist yet when the next node runs.
- **Folder create accepts a path.** `/Reports/2024/Q4` creates each missing level in turn, so you do not need one node per level.
- **Search covers the whole drive** and is filtered by resource — file search returns files only, folder search returns folders only.
- **Search and Get Children fan out** — each result becomes its own item, so downstream nodes process them individually.
- **Rename uses Item ID, other file operations use File ID.** They are the same OneDrive item ID; only the parameter name differs.