Microsoft Sharepoint icon

Microsoft Sharepoint

Consume Microsoft SharePoint API

Overview

The Microsoft SharePoint node for n8n allows you to interact with Microsoft SharePoint resources. Specifically, the Folder → Get Children operation retrieves a list of all items (files and subfolders) contained within a specified folder in a SharePoint site. This is useful for automating workflows that need to process or analyze the contents of SharePoint folders, such as syncing files, generating reports, or triggering actions based on folder contents.

Practical examples:

  • Listing all documents in a project folder for further processing.
  • Monitoring a folder for new files to trigger downstream automation.
  • Aggregating metadata about all items in a specific SharePoint directory.

Properties

Name Meaning
Site ID The identifier or name of the SharePoint site containing the target folder. Options may include pre-configured site IDs such as "Financial".
Folder ID The unique identifier of the folder whose children (items) you want to retrieve.

Output

The output is an array of JSON objects, each representing an item (file or folder) found within the specified SharePoint folder. Each object typically contains metadata fields provided by the SharePoint API, such as:

[
  {
    "id": "string",
    "name": "string",
    "webUrl": "string",
    "createdDateTime": "string",
    "lastModifiedDateTime": "string",
    "size": number,
    // ...other SharePoint item properties
  }
]
  • Each object represents either a file or a subfolder.
  • The exact structure depends on the SharePoint API response but will always include at least the item's ID and name.

Dependencies

  • External Service: Requires access to Microsoft SharePoint Online.
  • Authentication: Needs valid OAuth2 credentials configured in n8n (microsoftSharepointOAuth2Api).
  • n8n Configuration: Ensure the Microsoft SharePoint credential is set up in your n8n instance.

Troubleshooting

Common issues:

  • Invalid Site ID or Folder ID: If the provided Site ID or Folder ID is incorrect, the node will fail to retrieve data. Double-check these values in SharePoint.
  • Insufficient Permissions: The connected account must have permission to read the specified folder.
  • API Rate Limits: Excessive requests may be throttled by Microsoft Graph API.

Error messages:

  • "Resource not found": Indicates an invalid Site ID or Folder ID. Verify the identifiers.
  • "Access denied": The authenticated user does not have permission to access the folder.
  • "Invalid authentication credentials": Check your OAuth2 setup in n8n.

Links and References

Discussion