DocuSign Approval Then Signature
When a contract is requested, the flow runs an internal Approvals review of the terms first, and only on approval generates and sends the DocuSign envelope to the external signer, writing both the approval and signature audit trail to Dataverse. Chains internal sign-off before external signature.
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 flow chains an internal terms approval before any contract goes out for external signature on DocuSign. When a contract request is created in Dataverse, the flow pauses for an internal reviewer (Approvals). Only on approval does it generate and send the DocuSign envelope to the external signer. Every outcome - approved-and-sent or rejected - is written to a Dataverse Contract Audit Entry table with a unique correlation id, giving a complete, governed audit trail.
Why it matters: sending unreviewed contracts is a legal and financial risk. Gating signature behind a recorded internal approval enforces governance and produces an auditable record of who approved what, when, and which envelope it produced.
Ships Off (demo).
Use Case
A finance or legal team requires internal sign-off on contract terms before a contract is dispatched for external signature. The contract request originates as a Dataverse row (from a Power App, a portal, or another flow). The flow enforces the review gate and records the full approval + signature trail automatically.
Flow Architecture
When a Contract Request is created
Microsoft Dataverse - SubscribeWebhookTriggerFires when a new Contract Request row is created (Create, org scope).
Initialize Trace & Config
Initialize variableMints a correlation id and binds the approver email and audit table name from env vars.
Start Internal Terms Approval
Approvals - StartAndWaitForAnApprovalPauses for an internal reviewer to approve or reject the contract terms (Basic).
If Terms Approved
ConditionBranches on outcome == Approve.
Send Envelope & Log (approved)
DocuSign CreateEnvelopeFromTemplateNoRecipients + Dataverse CreateRecordGenerates and sends the DocuSign envelope from the template to the external signer (status Sent) and writes the approval + envelope id audit record.
Log Rejected (rejected)
Microsoft Dataverse - CreateRecordWrites a rejection audit record - no envelope sent.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_DocuSignAccountId | String | REPLACE_WITH_DOCUSIGN_ACCOUNT_ID | DocuSign account id used by the envelope action. |
| flowlibs_DocuSignTemplateId | String | REPLACE_WITH_DOCUSIGN_TEMPLATE_ID | DocuSign template id the envelope is generated from. |
| flowlibs_ContractApproverEmail | String | approver@yourcompany.com | Internal approver who reviews contract terms. |
| flowlibs_AuditTableName | String | flowlibs_contractauditentries | Audit table entity-set name (documentation/portability). |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| DocuSign | shared_docusign | CreateEnvelopeFromTemplateNoRecipients |
| Approvals | shared_approvals | StartAndWaitForAnApproval |
| Microsoft Dataverse | shared_commondataserviceforapps | SubscribeWebhookTrigger CreateRecord |
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.
- Tiered approval by value
- Replace the single approver with a Switch/Condition on the contract value that routes to different approvers, or use a JSON amount-to-approver map env var.
- Redline loop
- On rejection, set the Contract Request status back to a Needs Edits value and notify the requester instead of only logging.
- Counter-sign
- Add a second DocuSign template / recipient for an internal signer after the external signature completes.
- Status tracking
- Add a DocuSign SearchListEnvelopes poll or CreateHookEnvelopeV3 trigger in a companion flow to update the audit record's Signature Status to Completed.
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.01Correlation id (first action)
Stamped on the audit record.
EXPR.02Approved branch condition
Gate before signature.
EXPR.03Approval comments
Captured on the audit row.
EXPR.04Envelope id captured to audit
Links the audit row to the DocuSign envelope.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.