DocuSign Signed Contract to Obligation Tracker
When a contract is signed in DocuSign, the flow extracts key dates and terms (renewal, expiry, payment milestones) via OCR/AI, creates obligation records and reminders in Dataverse, and schedules renewal alerts. Turns signed contracts into a tracked obligations calendar.
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 turns signed DocuSign contracts into a tracked obligations calendar in Dataverse. On a daily schedule it scans DocuSign for newly completed envelopes, downloads each signed contract, uses Azure OpenAI to extract key obligations (renewals, expiries, payment milestones), writes them as obligation records with pre-computed renewal-alert dates, and emails the contracts team to review any low-confidence extractions.
Why it matters: missed renewals and obligations cost money. Extracting terms at signing and tracking them - with a human-review gate on uncertain extractions - prevents surprises.
Ships Off (demo). Azure OpenAI is called via the built-in HTTP action; add Azure Document Intelligence OCR for full contract text in production.
Use Case
A finance or operations team wants every signed contract to automatically populate an obligations/renewals tracker, with renewal alerts scheduled ahead of each key date and a review step for anything the AI is unsure about.
Flow Architecture
Daily Contract Scan
RecurrenceRuns the contract scan once a day (07:00 ET).
Initialize Trace & Config
Initialize variableMints a guid() correlation id and binds the DocuSign account, renewal lead days, lookback, Azure OpenAI endpoint/deployment/version/key, and notify email.
Search Completed Envelopes
DocuSign - SearchListEnvelopesLists envelopes completed within the lookback window.
For Each Envelope
Apply to eachDownloads the signed PDF (GetDocumentsV2), composes the contract text (OCR boundary in prod), and calls Azure OpenAI to extract obligations as strict JSON.
For Each Obligation
Apply to eachComputes the renewal-alert date (obligation date minus lead days), creates an obligation record in Dataverse, and on Low confidence emails the contracts team to verify (High importance).
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_DocuSignAccountId | String | 00000000-0000-0000-0000-000000000000 | DocuSign API account id (accountId). |
| flowlibs_ObligationTable | String | flowlibs_obligations | Obligations table entity-set name. |
| flowlibs_RenewalLeadDays | String | 60 | Days before a date to alert. |
| flowlibs_OpenAIEndpoint | String | https://YOUR-RESOURCE.openai.azure.com | Azure OpenAI endpoint. |
| flowlibs_OpenAIDeployment | String | gpt-4o | Azure OpenAI deployment name. |
| flowlibs_OpenAIApiVersion | String | 2024-08-01-preview | Azure OpenAI api-version. |
| flowlibs_OpenAIApiKey | String | REPLACE_WITH_KEYVAULT_OPENAI_KEY | Azure OpenAI api-key header (use Key Vault in production). |
| flowlibs_EnvelopeLookbackDays | String | 1 | Days back to scan envelopes. |
| flowlibs_NotifyEmail | String | contracts-team@yourcompany.com | Low-confidence review recipient. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| DocuSign | shared_docusign | SearchListEnvelopes GetDocumentsV2 |
| HTTP | shared_http | POST chat/completions (Azure OpenAI) |
| Microsoft Dataverse | shared_commondataserviceforapps | CreateRecord |
| Office 365 Outlook | shared_office365 | SendEmailV2 |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
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.
- Event-driven trigger
- Swap the Recurrence for DocuSign CreateHookEnvelopeV3 (envelope-completed) to process contracts the moment they are signed.
- Real OCR
- Insert an Azure Document Intelligence (Read/Layout) step at the OCR boundary to feed the model full contract text.
- Owner routing
- Add a lookup/assignment so each obligation is routed to a contract owner.
- Calendar push
- Add Outlook Create event to drop renewal alerts onto a shared calendar on the alert date.
- Clause library
- Extend the model prompt to flag non-standard clauses for legal review.
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.01Search window start
Lower bound of the completed-envelope search.
EXPR.02Renewal alert date
Obligation date minus the configured lead days.
EXPR.03Azure OpenAI URI
The chat-completions endpoint for extraction.
EXPR.04Model content path
Reaches the model's JSON output.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.