Upload Library File
sharepoint.upload_file
ActionFiles & storageconnection required
Calls the SharePoint API with the connection's credentials.
Upload a file into the site's default document library. Files at or below 4 MiB use Graph's simple upload; larger ones use a resumable upload session automatically.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- OAuth 2.0
- Providers
- SharePoint
- Secret shape
- {"client_id": "…", "client_secret": "…", "refresh_token": "…"} with the Sites.ReadWrite.All delegated scope
- Config it needs
- tenant, site_id
- Resolved by
- config.connection_id, else node.connection_id
Configuration
9 fields, 2 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
site_id The site id that holds the list, as 'hostname,siteCollectionId,siteId'. Use sharepoint.get_site or sharepoint.search_sites to find it. | string | Yes | — | — | — |
filename Name for the new file, e.g. 'Q3 report.pdf'. Required unless item_id names an existing file to overwrite. | string | No | — | — | Q3 report.pdf |
parent_id Id of the library folder to create the file in. Leave blank to use parent_path, or neither for the library root. | string | No | — | — | — |
parent_path Library-relative folder path to create the file in, e.g. 'Shared Documents/2026'. | string | No | — | — | — |
item_id Id of an existing file whose contents this upload replaces. When set, filename, parent_id and parent_path are ignored. | string | No | — | — | — |
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'. | string | Yes | — | — | Quarterly summary |
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. | string | No | — | 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 }}. | string | No | — | — | — |
conflict_behavior What Graph does when a file of that name already exists. | string | No | replace | one 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 summary\n",
"conflict_behavior": "replace",
"filename": "Q3 report.pdf"
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
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 Library File run in a workflow.
In a technical demo we add the SharePoint connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.