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.

Approve once. Send once., beside a signed printed contract with a pen and an approval message for sow-example revision-b.Approve once. Send once., beside a signed printed contract with a pen and an approval message for sow-example revision-b.

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 operationControl we propose adding
Slack approval before sending. 1Bind the decision to a preserved PDF and internal version. 2,4
Download the generated PDF and send it for signature. 1Permit one database-controlled send claim per version. 5,7
Retrieve the executed PDF and file it in SharePoint. 1Track archive completeness and retry filing separately. 3,4
Check status and retrieve an audit trail through the TurboDocx integration. 4Route 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

Contract workflow states with approval, signature, expiration review and filing-only recovery paths.Contract workflow states with approval, signature, expiration review and filing-only recovery paths.Open full size
Figure 1Each revision starts a new approval; ambiguous sends require sales operations investigation before retry, late completion requires human reconciliation, and filing recovery never returns to sending.
Current statePermitted event and guardNext stateRecovery owner
pending_approvalAuthorised approval matches preserved versionapprovedAccount manager
pending_approvalAuthorised rejectionrejectedAccount manager
approvedVersion evidence matches; unique claim acquiredsendingSales operations
sendingSend confirmed; request ID recordedsentSales operations
sendingAmbiguous responseStay; flag reconciliationSales operations
sentVerified completionsignedWorkflow operator
sentConfirmed expiry or recorded human decisionexpiredSales operations
expiredLate completion indicationStay; flag reviewSales operations
signedRequired archive references recordedarchivedWorkflow operator
signedRetrieval or upload failsfiling_failedWorkflow operator
filing_failedFiling completes and references are recordedarchivedWorkflow 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

FieldIllustrative value
Contract ID / internal versionsow-example / revision-b
Frozen-file referenceReference to preserved unsigned PDF
Content digestDigest of those preserved bytes
Approval-request IDIdentifier for this approval request
Permitted approver IDsExplicit Slack user IDs
Deciding user / decisionInitially empty
Requested at / decided atRequest 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

  1. Configure an explicit approver list. An empty list permits anyone who can see the message to respond. 2
  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
  3. Use a public HTTPS-reachable n8n instance. One Slack app serves one instance because it has one interactivity Request URL. 2
  4. 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 reconciliation

Use 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

Evidence chain linking the approved source PDF, the Slack decision, the signature request and the archived signed artefacts.Evidence chain linking the approved source PDF, the Slack decision, the signature request and the archived signed artefacts.Open full size
Figure 2The digest belongs to the preserved unsigned source, not the signed PDF, whose hash is not expected to match.

We would record the following in an archive manifest. 2,4

Manifest fieldRecord
Approved sourcePreserved reference and source digest
ApprovalDeciding user and decision time
Signature requestReturned request ID
Completed artefactsSigned-PDF item reference and available audit-trail reference
Filing statusRequired 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 conditionExpected outcomeOwner
Rejection or source editRejected version stops; revision needs approvalAccount manager
Unauthorised approvalRemain waitingWorkflow operator
Repeated clicks or overlapping queue runsExisting decision retained; no second send claimWorkflow operator
Ambiguous send timeoutsending, reconciliation flaggedSales operations
Confirmed expiry or late completionRecorded expiry decision or reviewSales operations
Repeated completion deliveryCheck request and state before processingWorkflow operator
SharePoint failurefiling_failed; retry filing onlyWorkflow 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

MeasureDefinition
Approval waiting timeDecision time minus approval-request time
Approved-to-sent timeConfirmed send time minus approval time
Administrative touchesManual chasing, status checks and filing actions per contract
Intervention rateContracts requiring intervention divided by contracts processed
Archive completenessCompleted 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.

Scroll or pinch to zoom, drag to move

Sources

  1. 1Send TurboDocx e-signature contracts from Excel with Slack approval and SharePoint filing | n8n workflow templateDocumentation · n8n
  2. 2Approvals | Nodes | n8n DocsDocumentation · n8n Docs
  3. 3driveItem: createUploadSession - Microsoft Graph v1.0Documentation · spgraph-docs-team · Microsoft Learn
  4. 4TurboDocx/n8n-nodes-turbodocxRepository · TurboDocx · GitHub
  5. 5INSERTDocumentation · PostgreSQL Documentation · 2026-11-12
  6. 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
  7. 76.4. Returning Data from Modified RowsDocumentation · PostgreSQL Documentation · 2026-11-12
  8. 8List versions - Microsoft Graph v1.0Documentation · spgraph-docs-team · Microsoft Learn
  9. 9Download contents of a driveItemVersion resource - Microsoft Graph v1.0Documentation · spgraph-docs-team · Microsoft Learn
  10. 10TurboDocx integrations | Workflow automation with n8nDocumentation · n8n
  11. 11Share with others | Build | n8n DocsDocumentation · n8n Docs

Tailored AI for business

Want a system like this in your business?

You leave with a clear idea of what AI can do for your business.

Contact us