Mini-project · 11 min read
n8n contract approval workflow: send the approved version, recover safely
An n8n contract approval workflow should preserve the PDF people approve, send that version for signature and file the completed documents without routing filing retries back through sending. We outline a proposed state-driven design using Slack, TurboDocx, SharePoint and PostgreSQL, with people resolving changes and uncertain outcomes.


A PDF approved in Slack should be the PDF sent for signature. If SharePoint filing then fails, the retry should file the signed document without sending another signature request. This proposed n8n contract approval workflow uses a hypothetical professional-services statement of work to show how those boundaries could work. 1,2,3,4,5
n8n’s TurboDocx walkthrough and its Excel-to-signature workflow template already cover the connectors. 6,1 We build on that starting point with version-bound approval and separate recovery paths, assembled from documented operations. The design is illustrative, not a tested workflow export. 2,3,4,5,7
What this n8n contract approval workflow will do
Start with the published contract workflow
A statement of work enters an Excel queue, receives internal approval in Slack, goes for signature through TurboDocx, then lands in SharePoint. The published template selects rows marked Ready to send, branches on Approve & send or Reject, and files the executed PDF when signing completes. 6,1
We would keep that sequence, with a person approving the document before it reaches the client. We would also keep the scope narrow: a repeatable, single-signer document. The published walkthrough excludes redlining and back-and-forth negotiation. 6,1
Documented capabilities versus our proposed controls
| Documented operation | Control we propose adding |
|---|---|
| Slack approval before sending. 1 | Bind the decision to a preserved PDF and internal version. 2,4 |
| Download the generated PDF and send it for signature. 1 | Permit one database-controlled send claim per version. 5,7 |
| Retrieve the executed PDF and file it in SharePoint. 1 | Track archive completeness and retry filing separately. 3,4 |
| Check status and retrieve an audit trail through the TurboDocx integration. 4 | Route uncertain outcomes to an owner for reconciliation. 4,5 |
The walkthrough does not document these persistent state and recovery controls. 6 They are the design work we cover here. The same human checkpoint also matters for quotes prepared for human approval.
Design the states before connecting the nodes
The normal path and its transition guards
A contract record in sending needs a different recovery path from one in filing_failed. We propose the following states and guards so each record makes clear what may happen next and who owns an exception. 1,2,3,4,5,7
| Current state | Permitted event and guard | Next state | Recovery owner |
|---|---|---|---|
pending_approval | Authorised approval matches preserved version | approved | Account manager |
pending_approval | Authorised rejection | rejected | Account manager |
approved | Version evidence matches; unique claim acquired | sending | Sales operations |
sending | Send confirmed; request ID recorded | sent | Sales operations |
sending | Ambiguous response | Stay; flag reconciliation | Sales operations |
sent | Verified completion | signed | Workflow operator |
sent | Confirmed expiry or recorded human decision | expired | Sales operations |
expired | Late completion indication | Stay; flag review | Sales operations |
signed | Required archive references recorded | archived | Workflow operator |
signed | Retrieval or upload fails | filing_failed | Workflow operator |
filing_failed | Filing completes and references are recorded | archived | Workflow operator |
These are our proposed transitions rather than vendor-defined statuses. 2,3,4,5
Rejection, uncertain sends and confirmed expiration
A rejected document returns to the account manager. Any revision starts a new approval version; rejection never falls through to sending. 1,2
A send timeout stays in sending with a reconciliation flag. PostgreSQL cannot make its write atomic with an external signature request, so a local claim cannot prove that TurboDocx did not accept the send. Sales operations must investigate before another attempt. 4,5
An elapsed local deadline means review is due. We would enter expired only after confirmed provider status or a recorded human decision. Late completion goes to review so an owner can resolve competing or superseding requests. 4
Filing retries never return to sending
The recovery edge is signed → filing_failed → archived. Retrieval and upload may resume there; the signature-send operation stays outside that path. 3,4
Steps 1–2: create a durable record and preserve the approval PDF
1. Define the contract-version and approval records
Start with a durable record identifying the exact document under review. This is our proposed schema, rather than a Slack or TurboDocx payload. 2,8,4
| Field | Illustrative value |
|---|---|
| Contract ID / internal version | sow-example / revision-b |
| Frozen-file reference | Reference to preserved unsigned PDF |
| Content digest | Digest of those preserved bytes |
| Approval-request ID | Identifier for this approval request |
| Permitted approver IDs | Explicit Slack user IDs |
| Deciding user / decision | Initially empty |
| Requested at / decided at | Request timestamp / initially empty |
Retain the decision against this version, alongside the approver identity and time. 2,8,4
2. Preserve the PDF instead of regenerating after approval
Present the preserved PDF to the approver. After approval, retrieve and send those same bytes. Any edit creates another internal version and requires another decision. 1,2,4
The original walkthrough says text outside template variables remains unchanged, but does not establish content-hash verification or approval-to-version binding. 6 You still need to implement and verify digest computation, comparison and protection against overwriting the preserved file. 1,2,4
Why SharePoint version history is not the approval ledger
Microsoft Graph can list file versions, and its version-content endpoint can retrieve a specified previous version. 8,9
Version creation and retention depend on configuration, and previous-version metadata is incomplete. We would keep the approval record separately: version history alone does not provide permanent storage or complete approval evidence. 8
Steps 3–4: restrict Slack approval and claim the send once
3. Configure an authorised Slack decision
In the n8n Slack approval node, select Message → Send and Wait for Response → Approval. The workflow pauses until approval or rejection. 2
- Configure an explicit approver list. An empty list permits anyone who can see the message to respond. 2
- Enable Slack app interactivity, set its Request URL to the n8n waiting-webhook URL, and put the app Signing Secret in the credential’s Signature Secret field. 2
- Use a public HTTPS-reachable n8n instance. One Slack app serves one instance because it has one interactivity Request URL. 2
- Capture the responder identity and response time, then persist them against the approval-request and contract-version records. 2
The node verifies signed callbacks and rejects unauthorised responders while continuing to wait. It records the first decision; later clicks cannot change it. A separate workflow execution can still create another approval request, which is why the send needs its own control. 2
4. Check the version and acquire a unique send claim
A PostgreSQL unique constraint with ON CONFLICT DO NOTHING can prevent a duplicate claim row from being inserted. 5 The RETURNING clause reports rows actually modified. 7
We would use those primitives as follows. This is non-executable pseudocode; transaction boundaries and n8n database-node settings remain implementation work. 5,7
require state == approved
require approval matches preserved version and digest
atomically check eligibility and attempt unique send claim:
INSERT claim(contract_version_id)
ON CONFLICT DO NOTHING
RETURNING contract_version_id
if no new claim returned: stop
record sending; send preserved PDF once, with automatic retries disabled
persist returned signature_request_id and confirmed outcome
on send error or interruption: retain claim; flag reconciliationUse the internal contract-version ID as the proposed unique key. Only the execution receiving a new claim proceeds. Store the returned signature-request ID for later completion and status checks. 4,5,7
As part of this proposed control, disable Retry On Fail on the signature-send node and disable any automatic retries in the HTTP client or other layer that issues the send. Keep retries for this operation disabled even when the database claim has been acquired: the claim governs entry to the operation, not repeated requests made inside it. The provider material does not document a send idempotency key. 4,5
Reconcile send errors and interrupted executions before any retry
The TurboDocx community-node repository does not document a send idempotency key or a way to discover an unknown request ID after an ambiguous timeout. 4 We would route every send error or execution interrupted after the claim to reconciliation, retaining both the claim and sending state. An operator must establish the previous outcome and record the decision before authorising any new send attempt; restarting the failed node is not a recovery path. 4,5
Steps 5–6: verify completion and file the signed artefacts
5. Persist verified completion before processing it
The TurboDocx Trigger documents signature.document.completed and signature.document.voided, automatic webhook registration on activation, and HMAC verification on every delivery. 4
We would first persist each verified callback in a durable database inbox, then process it against the stored request ID and current contract state. Record provider event IDs where stable identifiers are supplied; their availability and exact fields still need verification. Do not assume exactly-once delivery or automatic webhook redelivery. 10,4,5,7
In this proposed design, an unmatched callback or a completion received while the contract is still in sending remains pending in the inbox. Retry correlation after the send result and request ID are committed, and run a scheduled sweep of pending inbox records. Do not discard the event or mark it processed merely because the request ID is not yet available. 4,5,7
Once the request matches and the transition is permitted, commit the state change and a durable filing job together. Mark the inbox event processed only in that same commit, or after confirming that the state change or filing job is already durably recorded. This keeps filing recoverable without depending on another callback. A late completion against expired remains pending for human review and status reconciliation. 4,5,7
We would also schedule status reconciliation for known request IDs using the documented status operation, independently of callback delivery. Feed confirmed completion through the same state and filing checks. Route unresolved inbox events, unknown request IDs and conflicting outcomes to the workflow operator; this fallback cannot resolve an unknown request ID automatically. 4
6. Retrieve the signed PDF and available audit trail
TurboDocx documents signed-PDF download and audit-trail retrieval. 4 The n8n integration listing describes Get Audit Trail as retrieving a tamper-evident signature-document audit trail. It does not establish a particular certificate format or legal effect. 10
Keep the approved unsigned source distinct from the signed result in the proposed evidence chain. 2,4
We would record the following in an archive manifest. 2,4
| Manifest field | Record |
|---|---|
| Approved source | Preserved reference and source digest |
| Approval | Deciding user and decision time |
| Signature request | Returned request ID |
| Completed artefacts | Signed-PDF item reference and available audit-trail reference |
| Filing status | Required evidence present, or outstanding work |
The signed PDF is a different artefact. Do not expect its hash to match the unsigned source digest. 2,4
Record archive completeness and retry filing independently
For resumable filing, Microsoft Graph upload sessions document the route POST /sites/{siteId}/drive/items/{parentItemId}:/{fileName}:/createUploadSession. Send bytes to the returned upload URL, omitting the Authorization header on those PUT requests. Include Content-Length for the number of bytes in each request body and Content-Range: bytes {start}-{end}/{total}, identifying the zero-based, inclusive byte interval and total file size. 3
Upload ranges sequentially. Each request must be smaller than 60 MiB; for a split upload, every non-final chunk must be a multiple of 320 KiB. An intermediate 202 Accepted response means the upload is incomplete. Wait for the final successful response containing the driveItem before recording its archive reference. 3
Sessions support missing-range queries after interruption. Use exponential backoff for relevant 5xx retries; expired sessions may need recreation. Microsoft recommends resumable transfers above 10 MiB, so we would make this optional for ordinary small PDFs. 3
Record returned archive references before marking archived. If an upload response is ambiguous, check whether the file exists and is complete; the exact configuration still needs verification. Retrieval or upload failures stay in filing recovery. 3,4
Before deployment: permissions, unresolved settings and failure tests
Who can approve, send, edit the workflow and write the archive?
An n8n workflow editor can use credentials already used in that workflow, even without separate credential sharing. Treat editor access as part of the sending permission boundary. 11 Review n8n’s workflow-sharing behaviour alongside the explicit Slack approver list. 2,11
For previous-version downloads, Microsoft lists Files.Read as the least-privileged delegated work-or-school permission and Files.Read.All for application access. 9 Upload-session documentation lists Sites.ReadWrite.All for application permission and says app-only authentication cannot replace sensitivity-label-protected file contents. Review these implications before granting archive access. 3
Settings that still need verification in your environment
The TurboDocx repository documents self-hosted installation of @turbodocx/n8n-nodes-turbodocx, followed by an n8n restart, and requires n8n 1.60.0 or later. It does not establish an exact package version to pin or a tested version pair. 4 Confirm Cloud availability separately before choosing that deployment route. 6,4
TurboDocx credentials use an API key and organisation ID. 4 Before deployment:
- Confirm binary-input settings, digest comparison and protected source storage. 1,2,4
- Confirm send, status and audit-trail outputs, including request and event identifiers. 4
- Implement database transactions, claim recovery and logging of every decision and transition. 2,5,7
- Verify upload deduplication and completeness checks; define secret handling, evidence retention and exception alerts. 3,4
Test rejection, edits, overlaps, timeouts, late completion and upload failure
Run these proposed acceptance tests before relying on the workflow. No results are reported here. 6,2,3,4,5
| Injected condition | Expected outcome | Owner |
|---|---|---|
| Rejection or source edit | Rejected version stops; revision needs approval | Account manager |
| Unauthorised approval | Remain waiting | Workflow operator |
| Repeated clicks or overlapping queue runs | Existing decision retained; no second send claim | Workflow operator |
| Ambiguous send timeout | sending, reconciliation flagged | Sales operations |
| Confirmed expiry or late completion | Recorded expiry decision or review | Sales operations |
| Repeated completion delivery | Check request and state before processing | Workflow operator |
| SharePoint failure | filing_failed; retry filing only | Workflow operator |
Assign people to resolve expiration decisions and uncertain outcomes before releasing another send. 4,5 This operational ownership is part of how DEVORTEX builds and maintains workflow automation.
Where the extra controls pay off—and when they do not
A hypothetical 50-contract monthly workload
Consider a sales-operations owner handling 50 repeatable, single-signer statements of work per month. This is an illustrative workload, not a customer result or a break-even threshold. 6,1
We would compare the basic template with the proposed state-driven design. The intended benefit is less repetitive chasing and filing, while people retain document approval and exception decisions. That benefit has to justify maintaining the durable records and recovery paths. 1,2,3,4,5
Measure delays, touches, exceptions and archive completeness
Use these proposed measures before and during a pilot. 6,1
| Measure | Definition |
|---|---|
| Approval waiting time | Decision time minus approval-request time |
| Approved-to-sent time | Confirmed send time minus approval time |
| Administrative touches | Manual chasing, status checks and filing actions per contract |
| Intervention rate | Contracts requiring intervention divided by contracts processed |
| Archive completeness | Completed requests with all required artefacts divided by completed requests |
The published walkthrough reports no measured savings, exception rate, administrative effort or operating cost. Its manual end-to-end test is not a performance study. 6
Choose the simpler process when hardening costs more than it helps
Start by measuring your current work. Then review third-party subscriptions, database maintenance and the effort of handling exceptions. The sources do not establish a reliable running-cost total or break-even volume. 6,1
Negotiation-heavy contracts remain outside this build’s scope. 6 For a small workload with manageable manual checks, we would retain the simpler process until the measurements justify more automation.
If approved versions, uncertain sends or missing signed files are consuming your attention, discuss your contract approval bottleneck. Start with the handoff that needs control.
Sources
- 1Send TurboDocx e-signature contracts from Excel with Slack approval and SharePoint filing | n8n workflow templateDocumentation · n8n
- 2Approvals | Nodes | n8n DocsDocumentation · n8n Docs
- 3driveItem: createUploadSession - Microsoft Graph v1.0Documentation · spgraph-docs-team · Microsoft Learn
- 4TurboDocx/n8n-nodes-turbodocxRepository · TurboDocx · GitHub
- 5INSERTDocumentation · PostgreSQL Documentation · 2026-11-12
- 6Send contracts for e-signature from n8n, with TurboDocx, Slack approval and SharePoint filingDocumentation · Nicolas Fry (guest post; the page byline says n8n team) · n8n Blog · 2026-11-08
- 76.4. Returning Data from Modified RowsDocumentation · PostgreSQL Documentation · 2026-11-12
- 8List versions - Microsoft Graph v1.0Documentation · spgraph-docs-team · Microsoft Learn
- 9Download contents of a driveItemVersion resource - Microsoft Graph v1.0Documentation · spgraph-docs-team · Microsoft Learn
- 10TurboDocx integrations | Workflow automation with n8nDocumentation · n8n
- 11Share with others | Build | n8n DocsDocumentation · n8n Docs

