Skip to main content

Microsoft SharePoint ExecModule

Overview

MicrosoftSharePointModule connects ValkyrAI workflows to SharePoint through Microsoft Graph v1.0 and the native map I/O ExecModule ABI. Workflow Studio discovers the module as MicrosoftSharePointModule.

The connector covers site discovery, list and list-item reads and writes, document-library discovery, drive-item reads, child listing, and folder creation. Production traffic is fixed to https://graph.microsoft.com/v1.0. OAuth credentials resolve only from encrypted fields on a bound IntegrationAccount.

The implementation uses the n8n Microsoft SharePoint integration as a functional reference while following ValkyrAI security, metadata, execution, retry, and output contracts.

Usage

  1. Register an application in Microsoft Entra ID or select an approved tenant application.
  2. Grant the minimum delegated Microsoft Graph scopes required by the workflow.
  3. Complete tenant consent when the selected scopes require administrator approval.
  4. Store the resulting access token in a READY Microsoft SharePoint IntegrationAccount.
  5. Discover a site with search_sites, then select explicit site, list, item, drive, and folder IDs.
  6. Use mutation operations only after validating the target resource and expected business fields.
  7. Reconcile Microsoft Graph state by immutable ID before manually repeating an ambiguous write.

Use SharePoint list internal field names in fields. Display names can differ from internal names, especially for renamed or custom columns.

Inputs

InputTypeUsed byRequiredNotes
operationstringAllYesOne supported operation from the table below.
siteIdstringSite-list operationsOperation-specificMicrosoft Graph composite site ID; bounded to 2,048 safe characters.
listIdstringList-item operationsOperation-specificSharePoint list ID.
itemIdstringItem get/update/deleteOperation-specificSharePoint list-item ID.
driveIdstringDrive operationsOperation-specificDocument-library drive ID.
driveItemIdstringDrive-item/child operationsOperation-specificOmit for the drive root in child-list or folder-create operations.
searchQuerystringSite searchYesBounded site-search text, at most 200 characters.
fieldsobjectItem create/updateYesNon-empty field-value object, at most 256 KiB and eight nesting levels.
folderNamestringFolder createYesFolder name, at most 255 characters.
conflictBehaviorstringFolder createNofail by default, or rename.
cursorstringList operationsNoAn opaque cursor returned by this module; arbitrary URLs are rejected.
limitintegerList operationsNo1 through 1,000; defaults to 100.
confirmDeletebooleanItem deleteYesMust be true before permanent list-item deletion.

The module rejects credential-like keys such as authorization, API keys, passwords, secrets, and token fields anywhere in a request body.

Outputs

OutputTypeWhen presentMeaning
statusstringAlwayssuccess or error.
operationstringAlwaysNormalized operation name.
resourcestringAfter request constructionsites, lists, items, fields, drives, or driveItems.
httpStatusintegerProvider respondedMicrosoft Graph status code.
attemptsintegerAlwaysNumber of HTTP attempts consumed. Writes are always one attempt.
dataobjectSingle-resource successProvider resource or an empty object after successful deletion.
idstringProvider returned oneConvenience immutable resource ID.
webUrlstringProvider returned oneConvenience SharePoint browser URL.
itemsarrayList successBounded Microsoft Graph value array.
countintegerList successNumber of items in this page.
hasMorebooleanList successWhether Graph returned a supported continuation.
nextCursorstringMore results existValidated skip token or numeric skip, never a provider URL.
requestIdstringProvider supplied oneMicrosoft request correlation value.
errorobjectFailureStable code, safe message, optional HTTP status, and retryable flag.

IntegrationAccount Requirements

RequirementContract
ProviderMicrosoft Graph / Microsoft SharePoint
StatusREADY
CredentialOAuth access token in encrypted apiKey; encrypted password is a compatibility fallback
Read scopesSites.Read.All; add Files.Read.All for document-library operations
Write scopesSites.ReadWrite.All; add Files.ReadWrite.All for folder creation
Tenant consentRequired according to the Entra application and selected permissions

Use the least-privilege delegated scopes available. For higher-assurance deployments, prefer Microsoft selected-site permissions and grant access only to required sites. Rotate or revoke the IntegrationAccount when access is no longer needed.

The module does not accept client IDs, client secrets, refresh tokens, tenant IDs, or raw bearer tokens in workflow input.

Configuration

Minimal site discovery:

{
"operation": "search_sites",
"searchQuery": "Release Operations",
"limit": 25
}

Minimal list-item creation:

{
"operation": "create_item",
"siteId": "contoso.sharepoint.com,abc123,def456",
"listId": "f75b0e5d-41f8-40ac-bcab-8d22ca8ebc65",
"fields": {
"Title": "Verify public launch evidence",
"ReleaseState": "Ready for review"
}
}

The persisted workflow binds a generated IntegrationAccount relationship. Never place credentials in this JSON.

Operations

OperationMicrosoft Graph behaviorSide effect
search_sitesGET sites with search queryNone
get_siteGET one siteNone
list_listsGET lists for a siteNone
get_listGET one listNone
list_itemsGET list items with expanded fieldsNone
get_itemGET one list item with expanded fieldsNone
create_itemPOST an item with a fields envelopeCreates a list item
update_itemPATCH only the item fields resourceUpdates list fields
delete_itemDELETE one list itemPermanently deletes after explicit confirmation
list_drivesGET document-library drives for a siteNone
get_drive_itemGET one drive itemNone
list_childrenGET root or item childrenNone
create_folderPOST a folder to root or item childrenCreates a document-library folder

Arbitrary OData filters, arbitrary Graph paths, file-byte upload/download, sharing links, permissions, columns, content types, pages, webhooks, and list creation are intentionally deferred from version 1.0.0.

Errors and Failure Modes

CodeCauseRetryableRecovery
INTEGRATION_ACCOUNT_REQUIREDNo bound accountNoBind a Microsoft SharePoint IntegrationAccount.
INTEGRATION_ACCOUNT_NOT_READYAccount is not READYNoComplete OAuth authorization and validation.
VALIDATION_ERRORInvalid ID, unsafe fields, cursor, body, or tokenNoCorrect the named field.
MICROSOFT_GRAPH_HTTP_400Graph rejected the request or field nameNoCheck IDs, internal column names, and types.
MICROSOFT_GRAPH_HTTP_401Token expired or is invalidNoRefresh or replace the credential.
MICROSOFT_GRAPH_HTTP_403Scope, consent, or site access is missingNoGrant only the required permissions.
MICROSOFT_GRAPH_HTTP_404Resource is absent or hiddenNoRe-run discovery with the same account.
MICROSOFT_GRAPH_HTTP_409Folder conflict or concurrent state changeNoRe-read state and use rename only when acceptable.
MICROSOFT_GRAPH_HTTP_429 / 5xxRate limit or transient failureYes for GET onlyHonor Retry-After; reconcile writes before manual retry.
NETWORK_ERRORTimeout, DNS, TLS, or connectivity failureYes for GET onlyVerify connectivity and reconcile writes.
RESPONSE_TOO_LARGEResponse exceeded 5 MiBNoReduce the limit or narrow the site/list.
EXECUTION_ERRORUnexpected local/provider invariantNoInspect sanitized logs and request correlation.

Provider messages pass through ValkyrAI shared sensitive-data redaction and explicit OAuth-token replacement.

Example

Create one launch-tracking item:

{
"operation": "create_item",
"siteId": "contoso.sharepoint.com,abc123,def456",
"listId": "f75b0e5d-41f8-40ac-bcab-8d22ca8ebc65",
"fields": {
"Title": "Verify public SharePoint ExecModule launch",
"ReleaseState": "Ready for review",
"EvidenceUrl": "https://valkyrlabs.com/v1/valkyrai/workflow-engine/execmodules/microsoft-sharepoint"
}
}

Expected result:

{
"status": "success",
"operation": "create_item",
"resource": "items",
"httpStatus": 201,
"attempts": 1,
"id": "42",
"data": {
"id": "42",
"fields": {
"Title": "Verify public SharePoint ExecModule launch",
"ReleaseState": "Ready for review"
}
}
}

After an ambiguous network failure, query the target list for the intended immutable business key before repeating the create.

Notes

  • Pagination: list operations use OData top values up to 1,000 and convert Graph next links into bounded token or skip cursors. Provider URLs never become executable workflow input.
  • Rate limits: GET operations honor Retry-After and apply bounded exponential delay for 408, 429, and selected 5xx responses. Mutations are single-attempt.
  • API limits: response bodies are capped at 5 MiB; request bodies at 256 KiB, 1,000 array elements, and eight nesting levels.
  • Idempotency: Microsoft Graph does not provide one universal idempotency key for these operations. Reconcile by immutable site/list/item/drive ID and business key before retrying a write.
  • Destructive behavior: only item deletion is destructive and requires explicit confirmation. Item updates overwrite supplied fields. Folder rename conflict handling creates a new name rather than overwriting.
  • Consistency: SharePoint search, list indexes, and permission propagation may be eventually consistent. A successful write does not guarantee immediate search visibility.
  • External verification: deterministic tests cover auth, routing, OData continuation, payloads, mapping, redaction, retries, single-attempt writes, destructive confirmation, and metadata discovery. Live tenant execution requires separately authorized Microsoft credentials and is not exercised in repository tests.
  • References: n8n Microsoft SharePoint integration, Microsoft Graph site resource, SharePoint list resource, and driveItem resource.