SharePoint
The SharePoint connector reads, writes, lists and deletes files in a SharePoint document library. Mention it as @extfs_sharepoint. Each run can take the next new file as a pipeline item.
Connect
The credential is an OAuth sign-in. In the credential dialog, enter a Credential Name, select Connect with Microsoft, and sign in to Microsoft in the pop-up window. Flow asks for permission to read and write files in your sites. Connectors, instances and credentials covers the rest of the setup.
| Setting | Default | What it does |
|---|---|---|
| Site URL | None, required | The site's address, such as https://contoso.sharepoint.com/sites/Finance. |
| Document Library | The site's default library | The library the workflow works in. |
| Root Folder | The library's top level | A folder inside the library that paths start from. |
| Max File Size (MB) | 100 | The largest file the workflow downloads or uploads, as a whole number of megabytes. Don't leave it empty. A copy or an upload must also finish within three minutes. |
| Include sub-folders | Off | When on, a scan for new files also looks in the folders below the one the workflow scans. |
What a step can do
| Action | What it does |
|---|---|
claim_next_file | Claims the next available file for this run. claim_next_files claims several at once. |
get_file | Copies a file into the run's files. |
put_file | Uploads a file from the run's files. If a file with that name is already there, the step fails, unless the step says to replace it. |
delete_file | Deletes a file. |
list_files | Lists files in a folder. It returns one file unless the step asks for more, and by default only files no run has taken yet; a step can ask for every file instead. A listing of new files reads at most 5,000 files and sub-folders from the folder, counting the files that don't match the step's pattern. When it stops there short of the number asked for, it says more may exist; claim_next_files takes them. |
mark_file_processed | Marks a claimed file Success or Failed. mark_files_processed marks several at once. |
Take the next new file from @extfs_sharepoint under
Invoices/Incoming. After processing, upload the extracted JSON toInvoices/Done.
How runs read the files
Unstract Flow reads the library only while a run is going; nothing watches it between runs. When a run claims a file, Flow takes a file it has already found in that folder, and in its sub-folders when Include sub-folders is on, for this connector instance, matching the step's pattern if it has one. A new instance has no record of earlier runs, so it processes every file already in the folder again; so does an imported workflow, even one imported into the same organization. When none is left, it scans the folder for new files, at most once every 30 seconds for each folder and pattern, shared by runs working in parallel. The scan looks in that folder only, unless the connector's Include sub-folders setting is on. The run copies the file into its own files at the same relative path, and a later step marks it Success or Failed. If a run ends with a file still in progress, the file is marked Failed once eight hours have passed since the claim; the check runs every 5 minutes. To free it sooner, select Release claims in the details of a run that ended Partial, Failed or Cancelled. Pipelines covers the states.
A listing returns up to 500 files. Flow tells files apart by their content: a copy of a file Flow has already seen, under any name, isn't picked up again, and a file whose content changes counts as a new file.