- Get, copy, move, rename, download, upload and delete files and folders
- Create folders and share links, and manage who can access a file or folder
- Get your drives, the drives of a group or a SharePoint site, and search SharePoint sites
- Start a workflow when a file or folder is created or updated
Getting Started with OneDrive
Prerequisites
- A Microsoft account. The Get Sites action also needs a work or school Microsoft account.
Add a connection to OneDrive in Engini
- Enter to your Engini account at https://app.engini.io.
-
Navigate to the Connections page by clicking on Connections in the left sidebar or by clicking here.

-
Click on the “New Integration” option located at the top bar.

-
Choose the OneDrive option from the available applications.

- Fill in the “New Integration” form and press Save: Note: There are two authentication methods available, and the form fields differ depending on the one you choose. Pick OAuth2 (the default) to sign in with your Microsoft account, with nothing else to set up. Pick Custom OAuth 2.0 if your organization requires you to connect through an app that you registered yourself in Microsoft Azure.
OAuth2
This is the default method. You sign in with your Microsoft account, so you don’t need to provide a Client Id or Client Secret.
- Connection Name - Enter a name that helps identify the OneDrive connection.
- Authentication Method - Select OAuth2.
- Sign in with Microsoft - Click Sign in with Microsoft and sign in to your Microsoft account.
- Save - Click Save to create the connection.
Custom OAuth 2.0
Choose this method if you want Engini to connect through an app that you registered yourself in Microsoft Azure, instead of the default Microsoft sign-in. Create the app registration first, in the Azure portal, with these settings:- Supported account types: multitenant and personal Microsoft accounts.
- Redirect URI: add a Web platform redirect URI, exactly
https://workflowapi.engini.io/api/auth/OAuthRedirectUrl(the same address the Callback URL field below shows). - API permissions: add these delegated Microsoft Graph permissions:
Files.ReadWrite.All,Sites.ReadWrite.All,Group.ReadWrite.All,User.Readandoffline_access. - Client secret: create a client secret and copy its Value (not the Secret ID).

- Connection Name - Enter a name that helps identify the OneDrive connection.
- Authentication Method - Select Custom OAuth 2.0.
- Callback URL - A read-only field that shows the address Microsoft sends you back to after you sign in (
https://workflowapi.engini.io/api/auth/OAuthRedirectUrl). Click the copy button next to it, then add this address as a Web redirect URI in the Azure app registration. Do this before you enter the Client Id and Client Secret, so that the sign-in works. - Client Id - The Application (client) ID of your Azure app registration.
- Client Secret - The client secret Value created for your Azure app registration.
- Signin - Click Signin and sign in to your Microsoft account.
- Save - Click Save to create the connection.
Triggers
The triggers check OneDrive on a schedule and start the workflow when files or folders are created or updated.Check for File/Folder Created
Starts the workflow for files or folders created in the OneDrive location you choose.
- Files or Folders - Select what the trigger checks: Files, Folders, or Files and Folders.
- OneDrive Location - Select where to check: My Drive, Site’s Drive, Groups’ Drive or Shared With Me. Your choice adds the fields listed below the steps.
- Starting (UTC) - Select the start date and time for the scheduled trigger.
- Recur every - Choose the time interval for checking. The minimum time interval is 15 minutes.
- Add time frame - You can specify a time frame during which the trigger will operate.
- My Drive: Drive Id, Folder Id and Query.
- Site’s Drive: Query, Site Id, Drive Id and Folder Id.
- Groups’ Drive: Query, Group Id, Drive Id and Folder Id.
- Shared With Me: Query.
Check for File/Folder Updated
Starts the workflow for files or folders updated in the OneDrive location you choose.
- Files or Folders - Select what the trigger checks: Files, Folders, or Files and Folders.
- OneDrive Location - Select where to check: My Drive, Site’s Drive, Groups’ Drive or Shared With Me. The fields it adds are the same as in Check for File/Folder Created.
- Starting (UTC) - Select the start date and time for the scheduled trigger.
- Recur every - Choose the time interval for checking. The minimum time interval is 15 minutes.
- Add time frame - You can specify a time frame during which the trigger will operate.
- Add Conditions - Click Add Conditions to define conditions that narrow down the data list and return only the relevant items. To learn more about using filters, click here.
Actions
Several actions start with a Location. It sets which drive the file or folder is in, and the fields below it change to match:- My drive: Drive Id and File/Folder Id.
- Site’s drive: Site Id, Drive Id and File/Folder Id.
- Group’s drive: Group Id, Drive Id and File/Folder Id.
Add Permission to File/Folder (Send Invitation)
Gives recipients read or write access to a file or folder by invitation.
- Location - Select the location of the file or folder: My drive, Site’s drive or Group’s drive. The Id fields appear as described at the start of this section.
- Recipients - The recipients who get access. Map the array you built with Initialize Recipients Array and Append to Recipients Array.
- Roles - The roles to give the recipients, Read or Write. Map the array you built with Initialize Roles Array and Append to Roles Array.
- Require Sign In - Whether the recipient must sign in to view the shared item.
- Send Invitation - If true, a sharing link is sent to the recipient.
Copy File/Folder
Copies a file or folder into another folder.
- Drive Id - Enter the Id of the drive that holds the file or folder.
- File/Folder Id - Enter the Id of the file or folder to copy.
- Target Location - Select where to copy it: My Drive, Site’s drive or Group’s drive. Your choice adds To Drive Id and To Folder Id, plus To Site Id or To Group Id for a site or group drive, to pick the destination, and a New name for the copy.
- Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Create Folder
Creates a new folder in OneDrive.
- Location - Select where to create the folder: My drive, Site’s drive or Group’s drive. Your choice adds the Site Id or Group Id, Drive Id and Folder Id of the parent folder.
- Folder name - Enter the name of the new folder.
Create Share Link
Creates a sharing link for a file or folder.
- Location - Select the location of the file or folder. The Id fields appear as described at the start of this section.
- Type - Select the type of link: View (anyone with the link can view), Edit (anyone with the link can edit) or Embed (a link you can embed in other pages).
- Add Field - Click Add Field to add and populate additional fields for the selected activity: Scope (Anonymous, Organization or Users) and Password. To learn more about managing activity data, click here.
Delete File/Folder
Deletes a file or folder from OneDrive.
- Location - Select the location of the file or folder you want to delete.
Delete File/Folder Permission
Removes a permission from a file or folder.
- Location - Select the location of the file or folder. The Id fields appear as described at the start of this section.
- Permission Id - Enter the Id of the permission to remove. You can get it with Get Permissions.
Download File
Downloads a file from OneDrive.
- Location - Select the location of the file you want to download.
Get Drives
Gets the drives available in a location.
- OneDrive Location - Select My Drive, Site’s Drive or Group’s Drive.
Get File/Folder Info
Gets the details of a file or folder.
- Location - Select the location of the file or folder.
Get Files/Folders
Gets files and folders from a OneDrive location.
- Files or Folders - Select what to get: Files, Folders, or Files and Folders.
- OneDrive Location - Select My Drive, Site’s Drive, Groups’ Drive or Shared With Me. Your choice adds the same fields as the triggers: Drive Id and Folder Id (with Site Id or Group Id for those drives), and Query to search by file or folder name.
Get Permissions
Gets the permissions of a file or folder.
- Location - Select the location of the file or folder.
Get Sites
Searches the SharePoint sites of your Microsoft 365 account by keyword. It needs a work or school Microsoft account.
- Search - Enter a keyword to search site names for, for example
Marketing.
Get User Drive
Gets your own OneDrive drive.
Move File/Folder
Moves a file or folder to another folder.
- Drive Id - Enter the Id of the drive that holds the file or folder.
- File/Folder Id - Enter the Id of the file or folder to move.
- Target Location - Select where to move it: My Drive, Site’s drive or Group’s drive. Your choice adds To Drive Id and To Folder Id, plus To Site Id or To Group Id for a site or group drive, to pick the destination, and a New name.
Rename File/Folder
Renames a file or folder.
- File or Folder - Select File or Folder.
- Location - Select the location of the item. The Id fields appear as described at the start of this section.
- New name - Enter the new name.
Upload File
Uploads a file to OneDrive.
- Location - Select where to upload: My drive, Site’s drive or Group’s drive. Your choice adds the Site Id or Group Id, Drive Id and Folder Id of the destination folder.
- File Name - Required. The name the file gets in OneDrive, including its extension, for example
report.pdf. - File Content - Required. The content of the file as a base64 string, for example the base64 content of a file produced by a previous step.
- File Type - Optional. The type of the file, for example
application/pdf. If you leave it empty, it is detected automatically.
Initialize Recipients Array
Creates an empty recipients array that you can fill with Append to Recipients Array and use in Add Permission to File/Folder.
- Variable name - Enter the name of the variable that holds the array. You use this name whenever you refer to the array in the workflow.
- Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Append to Recipients Array
Adds a recipient to the end of a recipients array that you created with Initialize Recipients Array.
- Variable - Select the recipients array variable to append to.
- Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Initialize Roles Array
Creates an empty roles array that you can fill with Append to Roles Array and use in Add Permission to File/Folder.
- Variable name - Enter the name of the variable that holds the array. You use this name whenever you refer to the array in the workflow.
- Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Append to Roles Array
Adds a role to the end of a roles array that you created with Initialize Roles Array.
- Variable - Select the roles array variable to append to.
- Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Send API Request
This activity allows you to send a custom API request directly to the Microsoft Graph API that OneDrive uses.
- Base Url - The root URL of the API. It is filled in from your OneDrive connection and can’t be edited here.
- Relative url - You can specify additional path segments or parameters that need to be added to the end of the Base Url. This allows you to customize the specific request you want to perform.
- Method - Select the HTTP method (e.g., Get, Post, Put, Delete, Patch). The default is POST.
- Body Type - Defines the format of the data in the body of your request. The default, application/json, means the body contains a JSON-formatted payload.
- application/json – Sends the request body in JSON format. Commonly used by REST APIs.
- custom – Allows you to define a custom body format by manually setting the Content-Type header. Add a
Content-Typerow in Add Headers with the media type you need (for exampleapplication/xml). With any other Body Type, a Content-Type you type in Add Headers is not sent; Engini sets it from the Body Type, and the run history shows it underheadersnotsent. - application/x-www-form-urlencoded – Sends the body as URL-encoded key-value pairs, commonly used in form submissions.
- file – Sends a file as the request body.
- multipart/form-data – Sends form data that may include both text fields and files.
- text/html – Sends the request body as HTML content.
- text/plain – Sends the request body as plain text.
- text/xml – Sends the request body in XML format.
- Body - Contains any data that is being sent to the server.
- Add Headers - Additional metadata about the request, such as the type of data Engini can accept, the length of the request body, and authentication information.
- Add Queries - The query refers to the parameters or data that are included in the URL of an HTTP request to provide additional information or instructions to the server.