Adobe PDF Contract Assembly and Merge
When a contract is ready, the flow combines the cover letter, main agreement, terms, and any exhibits from a SharePoint library into a single ordered PDF with Adobe PDF Services Combine, files the assembled contract, and emails it for review or signature. Removes manual PDF stitching and guarantees correct ordering.
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
FlowLibs - Adobe PDF Contract Assembly and Merge stitches a multi-part contract into a single, correctly ordered PDF using Adobe PDF Services Combine. On request it receives the ordered list of part files (cover letter, main agreement, terms, exhibits), uploads each to Adobe, combines them in order, files the assembled PDF back to SharePoint, and emails it to the reviewer/signer with the PDF attached.
Why it matters: Manually stitching cover letters, agreements, terms, and exhibits is slow and inconsistent. This flow guarantees the parts always combine in the correct order and the finished contract is filed and delivered automatically.
Status: Built — ships Off (demo). Going live requires only authorizing the SharePoint and Office 365 Outlook connections, setting the Adobe ClientId/ClientSecret environment variable values, and invoking the trigger URL from the upstream Power App / approval / button.
Use Case
Legal and operations teams assemble contracts from standard parts kept in a SharePoint library. When a contract is ready, an upstream app, approval, or button posts the ordered list of part paths to this flow. It returns a single assembled PDF — filed in SharePoint and emailed for review or signature — removing manual PDF stitching and guaranteeing correct ordering every time.
Flow Architecture
When a contract assembly is requested
Request (HTTP) triggerUpstream app/approval/button POSTs contractName, recipientEmail, and ordered partPaths.
Initialize correlation id + config
Initialize Variable (x10)Mint a trace id and load site URL, Adobe base/id/secret, assembled folder, contract name, recipient, asset list, and job status.
Get Adobe Access Token
HTTP — POST /tokenExchange the client id/secret for a Bearer token.
For Each Contract Part
Foreach (concurrency 1)For each part in order: read its PDF bytes (SharePoint GetFileContentByPath), create an Adobe upload asset, PUT the bytes, and append the assetID.
Compose Combine Body + Start Combine Job
Compose + HTTP — POST /operation/combinepdfBuild { assets: [...] } and submit the combine job (201 + Location header).
Until Combine Complete
Until loop (60x / 10 min)Poll the job status every 5s until done/failed.
Check Combine Succeeded
ConditionOn success: download the assembled PDF, save it to SharePoint (CreateFile), and email it attached. On failure: email an assembly-failure notice.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_SharePointSiteURL | String | https://your-tenant.sharepoint.com | Site holding the parts and the assembled output. |
| flowlibs_AdobePdfServicesBase | String | https://pdf-services.adobe.io | Adobe PDF Services REST base URL. |
| flowlibs_AdobeClientId | String | <configure> | Adobe API client id (also the X-API-Key header). |
| flowlibs_AdobeClientSecret | String | <configure> | Adobe API client secret (token minting only). |
| flowlibs_AssembledContractsFolder | String | /Shared Documents/Assembled Contracts | Server-relative folder for the assembled PDF. |
| flowlibs_ContractReviewerEmail | String | contracts-review@yourcompany.com | Fallback recipient when the request omits recipientEmail. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| HTTP | http | POST /token POST /assets PUT (upload) POST /operation/combinepdf GET (status/download) |
| SharePoint | shared_sharepointonline | GetFileContentByPath CreateFile |
| 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.
- e-signature
- Route the assembled PDF to DocuSign / Adobe Sign instead of (or alongside) the review email.
- Library auto-gathering
- Replace the partPaths input with a SharePoint GetFileItems on a folder plus an ordering rule, if you prefer the flow to enumerate the parts itself rather than receiving an explicit ordered list.
- Office parts
- Combine requires PDFs. Convert any Word/Excel/PowerPoint parts first with Adobe createpdf before assembly.
- Page ranges
- The Combine body supports a per-asset pageRanges array ({start,end}) to include only specific pages of a source file.
- Cover page / bookmarks
- Prepend a generated cover (Adobe Document Generation) or add a post-combine bookmarking step for navigation.
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.01Adobe token body
OAuth server-to-server token request body.
EXPR.02Append asset (ordered)
Append each uploaded asset to the ordered combine list.
EXPR.03Combine body
Request body for the Combine operation.
EXPR.04Poll URL (from Location header)
Status-poll URL from the combine job response.
EXPR.05Upload binary
Convert the SharePoint base64 content to binary for the PUT upload.
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.