node-red-contrib-drive-collection
v1.0.0
Published
Node-RED nodes for Google Drive and OneDrive file operations
Downloads
135
Maintainers
Readme
node-red-contrib-drive-collection
Node-RED nodes for Google Drive and OneDrive file operations.
Supports upload and download. Each provider has its own config node and operation nodes.
Nodes
| Node | Type | Purpose |
|---|---|---|
| google-drive-config | config | Google Drive OAuth2 credentials |
| google-drive-upload | operation | Upload a file to Google Drive |
| google-drive-download | operation | Download a file from Google Drive |
| onedrive-config | config | OneDrive OAuth2 credentials |
| onedrive-upload | operation | Upload a file to OneDrive |
| onedrive-download | operation | Download a file from OneDrive |
Google Drive
google-drive-config
Shared credentials for all Google Drive nodes.
| Field | Description | |---|---| | Client ID | OAuth2 client ID from Google Cloud Console | | Client Secret | Stored as a credential | | Refresh Token | Paste manually from OAuth2 Playground or your own auth flow |
The access token is refreshed automatically in memory and is never persisted.
google-drive-upload
Upload a file to Google Drive.
Input:
| Property | Description |
|---|---|
| msg.payload | Buffer or readable stream (required) |
| msg.filename | Overrides node filename. Default: timestamp |
| msg.folderId | Google Drive folder ID. Overrides node config |
| msg.mimeType | Overrides node MIME type. Default: application/octet-stream |
Output:
| Property | Description |
|---|---|
| msg.payload | Google Drive file metadata ({ id, name }) |
| msg.fileId | ID of the uploaded file |
google-drive-download
Download a file from Google Drive as a readable stream.
Input:
| Property | Description |
|---|---|
| msg.fileId | Google Drive file ID. Overrides node config |
Output:
| Property | Description |
|---|---|
| msg.payload | Readable stream of file content |
Output is a stream, not a Buffer. Pipe it to a file writer or another node that consumes streams.
OneDrive
onedrive-config
Shared credentials for all OneDrive nodes.
| Field | Description | |---|---| | Tenant ID | Azure AD tenant ID | | Client ID | App registration client ID | | Client Secret | Stored as a credential | | Refresh Token | Paste manually from your OAuth2 flow |
The access token is refreshed automatically in memory and is never persisted.
onedrive-upload
Upload a file to OneDrive (simple upload, suitable for files up to ~4 MB).
Input:
| Property | Description |
|---|---|
| msg.payload | Buffer or readable stream (required) |
| msg.path | OneDrive path, e.g. Documents/file.txt. Overrides node config |
Output:
| Property | Description |
|---|---|
| msg.payload | OneDrive file metadata from Graph API |
| msg.fileId | ID of the uploaded file |
onedrive-download
Download a file from OneDrive as a readable stream.
Input:
| Property | Description |
|---|---|
| msg.fileId | OneDrive item ID. Overrides node config |
Output:
| Property | Description |
|---|---|
| msg.payload | Readable stream of file content |
Output is a stream, not a Buffer.
Node status
| Color | Meaning | |---|---| | Yellow | In progress | | Green | Success | | Red | Error |
OAuth2 Bootstrap
These nodes use OAuth2 with a refresh token. You must obtain the refresh token externally:
- Google Drive: Use OAuth2 Playground with the Drive API scope (
https://www.googleapis.com/auth/drive) - OneDrive: Register an app in Azure Portal, then run an auth code flow with the
Files.ReadWritescope
Paste the refresh token directly into the config node. The nodes do not implement a UI for the initial OAuth flow.
Design
- One node per operation
- Config node as single source of truth for credentials
msgoverrides always win over node config- Streams over buffering — download nodes return streams, not Buffers
- Manual OAuth bootstrap — no hidden auth flows
- No generalized abstraction layer — Google Drive and OneDrive nodes are independent
License
Apache-2.0
