Graphrt

OneDrive

Browse, get by path, search, download to a directory, upload up to 250 MB, folders, rename/move/copy (agents, folder allowlist), sharing links, invites and deletes node only, download URLs never shown to agents

Beta v0.1.0 Node.js 17 actions
Use in Graphrt Desktop

About

A Graphrt plugin for the signed-in user's OneDrive (personal or OneDrive for Business) through Microsoft Graph v1.0: browse folders, get items by id or path, search, download into a directory, upload up to 250 MB, create folders, rename, move and copy, read sharing, and (workflow nodes only) create sharing links, invite people and delete.

What it can do

  • Browse: get_drive (quota), list_drives, list_root_children, list_children, get_item, get_item_by_path (e.g. Documents/q3.pdf), search (names, metadata and content)
  • Content: download_item (into $ONEDRIVE_DOWNLOAD_DIR, up to 250 MB), upload_file (https URL or a local file inside $ONEDRIVE_UPLOAD_DIR, up to 250 MB, replace, rename or fail on a name conflict)
  • Write: create_folder, update_item (rename, description, move), copy_item (asynchronous: Graph answers 202)
  • Sharing: list_permissions, create_sharing_link and invite (node only)
  • Remove: delete_item (node only, to the recycle bin)
  • api_request: any other Graph endpoint (GET only for agents)

Actions

Each action is a step you can add to a workflow. Agents can also use most of them as tools.

  • Get drive onedrive.get_drive
  • List drives onedrive.list_drives
  • List root onedrive.list_root_children
  • List folder onedrive.list_children
  • Get item onedrive.get_item
  • Get item by path onedrive.get_item_by_path
  • Search onedrive.search
  • List sharing onedrive.list_permissions
  • Upload file onedrive.upload_file
  • Create folder onedrive.create_folder
Show all 17 actions
  • Rename or move onedrive.update_item
  • Copy item onedrive.copy_item
  • Create sharing link onedrive.create_sharing_link
  • Share with people onedrive.invite
  • Delete item onedrive.delete_item
  • Download file onedrive.download_item
  • Microsoft Graph request onedrive.api_request

Settings

Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.

  • MICROSOFT_CLIENT_ID
    Delegated refresh-token grant
  • MICROSOFT_TENANT_ID
    Tenant id or domain for single-tenant apps, default common (consumers for personal-only apps)
  • ONEDRIVE_DOWNLOAD_DIR
    Absolute directory for download_item
  • ONEDRIVE_UPLOAD_DIR
    Directory upload_file may read local files from (https URLs work without it)
  • ONEDRIVE_TOOL_FOLDER_ALLOWLIST
    Comma-separated folder item ids agent tools may put items into besides root (* = any folder)
  • MICROSOFT_CLIENT_SECRET
  • MICROSOFT_REFRESH_TOKEN
  • ONEDRIVE_TOOL_TOKEN_SOURCE

How to use it

In Graphrt Desktop

  1. Open Plugins and search for OneDrive.
  2. Click Install and approve it.
  3. Follow the setup steps on the plugin's page, then paste the settings it needs.
  4. Describe a job that needs it, and the builder adds the steps.
Plugins in Graphrt Desktop

With the CLI

terminal
$ graphrt plugin install onedrive
workflow.yaml
- id: report
  type: onedrive.get_item_by_path
  item_path: Documents/Reports/q3.pdf
- id: file
  type: onedrive.download_item
  item_id: "{{#report.data.id#}}"
Plugins in the docs