Upload File

onedrive.upload
ActionFiles & storageconnection required

Calls the OneDrive API with the connection's credentials.

Upload a file to the drive. Files at or below 4 MiB use Graph's simple upload; larger ones use a resumable upload session automatically. Set item_id to replace an existing file's contents instead of creating one.

Connection

Required
Yes — the node will not save without one
Auth type
OAuth 2.0
Providers
OneDrive
Secret shape
{"client_id": "…", "client_secret": "…", "refresh_token": "…"} with the Files.ReadWrite delegated scope
Config it needs
tenant, drive_id
Resolved by
config.connection_id, else node.connection_id

Configuration

9 fields, 1 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.

FieldTypeRequiredDefaultConstraintsExample
drive_id
The drive to act on. Leave blank for the connected user's own OneDrive (/me/drive). A SharePoint document library's drive id also works here.
stringNo———
filename
Name for the new file, e.g. 'Q3 report.pdf'. Required unless item_id names an existing file to overwrite.
stringNo——Q3 report.pdf
parent_id
Id of the folder to create the file in. Leave blank to use parent_path, or neither to write to the drive root.
stringNo———
parent_path
Drive-relative folder path to create the file in, e.g. 'Reports/2026'. Used when parent_id is blank.
stringNo———
item_id
Id of an existing file whose contents this upload replaces. When set, filename, parent_id and parent_path are ignored.
stringNo———
body
The file contents. Plain text, or a base64 blob when content_encoding is 'base64'. To upload a file produced by an earlier step, set this to {{ input.file_content }} and content_encoding to 'base64'.
stringYes——Quarterly report
content_encoding
Set to 'base64' when body is a base64 blob (e.g. from a download_archive node). Defaults to the upstream file's encoding, else text.
stringNo—one of "text", "base64"—
content_type
MIME type to store the file as, e.g. 'application/pdf'. Defaults to text/plain; set it from an upstream file with {{ input.content_type }}.
stringNo———
conflict_behavior
What Graph does when a file of that name already exists.
stringNoreplaceone of "fail", "replace", "rename"—
  • At least one of filename, item_id must be set.

Example configuration

Every value below is the contract’s own example or default — nothing invented.

{
  "body": "Quarterly report\n",
  "conflict_behavior": "replace",
  "filename": "Q3 report.pdf"
}

Output

One shape.

result

FieldTypeExample
id
The driveItem id.
string—
name
The file or folder name.
string—
size
Size in bytes.
number—
web_url
Browser URL for the item.
string—
is_folder
True when the item is a folder.
boolean—
mime_type
The file's MIME type; empty for a folder.
string—
last_modified
ISO-8601 timestamp of the last change.
string—
created
ISO-8601 timestamp of creation.
string—
parent_id
The id of the containing folder.
string—
parent_path
The containing folder's drive-relative path.
string—
drive_id
The id of the drive the item lives in.
string—
{
  "created": "",
  "drive_id": "",
  "id": "",
  "is_folder": false,
  "last_modified": "",
  "mime_type": "",
  "name": "",
  "parent_id": "",
  "parent_path": "",
  "size": 0,
  "web_url": ""
}

See Upload File run in a workflow.

In a technical demo we add the OneDrive connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.