Contract Signature Lifecycle Tracker
When a contract is finalized in a SharePoint library, the flow sends it for signature via DocuSign, tracks envelope status events, files the completed signed PDF back to SharePoint, and notifies stakeholders in Outlook at each milestone (sent, viewed, signed, completed). Escalates if an envelope is not signed within a configurable SLA.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This solution (FlowLibs - Contract Signature Lifecycle Tracker) automates the full e-signature lifecycle with DocuSign, SharePoint, Outlook, and a Dataverse mirror table. When a finalized contract lands in a SharePoint library, the solution creates and sends a DocuSign envelope (uploading the actual document), tracks status changes (sent → delivered → signed → completed), files the completed signed PDF back into a SharePoint "Signed" library, notifies stakeholders at each milestone, and escalates envelopes that stall past a configurable SLA.
It is built as three cloud flows + one Dataverse table in a single solution, so the send, track, and escalate concerns are each driven by their natural trigger (SharePoint event, DocuSign event, schedule). A correlationId is minted at send time and carried through the mirror row and every notification for end-to-end tracing.
Why it matters: Signature chases are pure overhead. Automating send, status tracking, completed-doc filing, and SLA escalation closes contracts faster and keeps a clean, auditable record in SharePoint and Dataverse.
State: All three flows ship Off (demo). Going live requires only authorizing the four connections, setting a real DocuSign Account ID env var, and pointing the SharePoint/email env vars at real targets.
Use Case
Ops/legal teams route contracts for signature and then lose track of them in inboxes. They want one governed pipeline that sends, watches, files the signed copy, and nudges late signers — with stakeholders informed automatically and a Dataverse record for reporting.
Flow Architecture
When a Contract Is Finalized
SharePoint — GetOnNewFileItemsFires per new contract in the source library (5-min poll, split per file).
Send for Signature
DocuSign — CreateBlankEnvelope / AddDocumentsToEnvelope / AddRecipientToEnvelope / SendDraftEnvelopeRead the contract bytes (GetFileContent), create the envelope, attach the document, add the signer, and send the draft.
Create Mirror Record + Notify Sent
Microsoft Dataverse — CreateRecord + Office 365 Outlook — SendEmailV2Write the envelope to the mirror table and tell stakeholders it is out for signature.
When Envelope Status Changes
DocuSign — OnEnvelopeStatusChangesSecond flow trigger: fires per envelope status change (10-min poll).
Find + Update Mirror Status
Microsoft Dataverse — ListRecords + UpdateRecordLook up the mirror row by envelope id and write the new status; only act on envelopes this solution tracks.
File Signed PDF or Notify Milestone
DocuSign — GetDocumentsV2 + SharePoint — CreateFile + Office 365 Outlook — SendEmailV2On completion, download the combined signed PDF, archive it to the Signed library, record the path, and notify; otherwise send an interim milestone notice.
Daily SLA Sweep
RecurrenceThird flow trigger: daily scan of outstanding envelopes.
Escalate Past-SLA Envelopes
Microsoft Dataverse — ListRecords + DocuSign — AddReminders + Office 365 Outlook — SendEmailV2 + Microsoft Dataverse — UpdateRecordFor each outstanding row past the SLA, remind the signer, escalate to stakeholders, and mark the row escalated.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_SharePointSiteURL | String | https://your-tenant.sharepoint.com | SharePoint site URL (dataset for trigger / file ops). |
| flowlibs_ContractLibraryName | String | Contracts | Source contract document library. |
| flowlibs_SignedLibraryPath | String | /Signed Contracts | Server-relative folder for completed PDFs. |
| flowlibs_DocuSignAccountId | String | <configure> | DocuSign account id (required on every DocuSign op). |
| flowlibs_SignerName | String | Contract Signer | Default signer display name. |
| flowlibs_SignerEmail | String | signer@yourcompany.com | Default signer email. |
| flowlibs_StakeholderEmail | String | alerts@yourcompany.com | Milestone + escalation recipient. |
| flowlibs_SignatureSlaHours | String | 72 | SLA window before escalation. |
| flowlibs_SignedDocumentFormat | String | combined | DocuSign document id to download (combined = merged signed PDF). |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| DocuSign | shared_docusign | CreateBlankEnvelope AddDocumentsToEnvelope AddRecipientToEnvelope SendDraftEnvelope OnEnvelopeStatusChanges GetDocumentsV2 AddReminders |
| SharePoint | shared_sharepointonline | GetOnNewFileItems GetFileContent CreateFile |
| Office 365 Outlook | shared_office365 | SendEmailV2 |
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Signing tabs / templates
- For production, route signers via a DocuSign template (with pre-placed signature tabs) by swapping the CreateBlankEnvelope → AddDocumentsToEnvelope → AddRecipientToEnvelope → SendDraftEnvelope chain for SendEnvelope with a templateId, or add signHere anchor tabs to the recipient.
- Trigger filter
- Add a SharePoint column filter (e.g. a Ready for Signature choice) so only flagged contracts send, instead of every new file.
- Real-time status
- Replace Flow 2's polling trigger with the DocuSign Connect webhook (CreateHookEnvelopeV3) for instant status events (requires a DocuSign Connect configuration on the account).
- Multiple signers
- Extend AddRecipientToEnvelope's newRecipient/signers array with additional ordered recipients for counter-signatures.
- Reporting
- The flowlibs_contractenvelope table already mirrors every envelope; point a Power BI report at it for cycle-time and completion-rate dashboards.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Attach SharePoint doc to envelope (base64)
Pass the contract bytes as documentBase64.
EXPR.02File extension from filename
Derive the document file extension.
EXPR.03Match mirror row by envelope id
OData filter to find the mirror row for this envelope.
EXPR.04Completion check
Branch when the envelope is completed.
EXPR.05SLA breach (hours)
True when hours elapsed since sent exceeds the SLA.
Customize & download
Generate a ready-to-import copy of this solution with your environment-variable values baked in — available on Base, Pro, or Team.
Upgrade to customize
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.