Automation guide · 12 min read

How to Automate Contracts in n8n with TurboDocx

Как автоматизировать договоры в n8n с TurboDocx
Temporary fallback cover; replace in editorial pass.

A contract workflow usually breaks at the hand-offs: someone copies data into a document, waits for approval, sends a file for signing, then searches for the completed PDF. This guide connects those steps into one reproducible n8n workflow using TurboDocx, Slack, an e-signature provider, and SharePoint.

12 minutes Updated November 10, 2026 Level: from zero

What you will build

The workflow accepts structured contract data, creates a document from a template, asks an approver to review it in Slack, sends the approved document for electronic signature, waits for a completed status, downloads the signed PDF, and uploads it to SharePoint.

Input
  ↓
Validate contract data
  ↓
TurboDocx: create document
  ↓
Slack: request approval
  ↓
Approved?
  ├─ No → stop and record rejection
  └─ Yes
       ↓
E-signature provider: create signing request
       ↓
Wait for status callback or poll status
       ↓
Signed?
  ├─ No → retry later or route to exception
  └─ Yes
       ↓
Download signed PDF
       ↓
SharePoint: upload and return link

The examples below use placeholders such as YOUR_TURBODOCX_TOKEN. Replace them with credentials stored in n8n credentials or environment variables. Do not paste live secrets into node fields, Slack messages, templates, or screenshots.

Prerequisites

  • An n8n instance with permission to create workflows and credentials.
  • A TurboDocx account, a contract template, and the template's identifier.
  • A Slack workspace and an approval channel.
  • An e-signature service with an API or webhook integration.
  • A SharePoint site, document library, and upload permissions.

Provider names and request fields vary by account and plan. Treat the endpoint paths and field names in this article as configuration patterns. Confirm the exact API schema in the provider documentation available to your organization before activating the workflow.

1. Define one contract payload

Start with a stable JSON shape. The same fields should drive the document template, approval message, signature request, and file name.

{
  "contractId": "CTR-2026-001",
  "counterpartyName": "Example Ltd",
  "counterpartyEmail": "signer@example.invalid",
  "effectiveDate": "2026-11-10",
  "totalAmount": "1500.00",
  "currency": "EUR",
  "ownerEmail": "owner@example.invalid",
  "templateId": "YOUR_TEMPLATE_ID",
  "sharePointFolder": "/Contracts/2026"
}

In production, validate required fields before generating a document. A missing email should stop the workflow before a signing request is created. An invalid date should be rejected before it reaches the template.

Add a Code node after the trigger with a small validation expression:

const required = [
  'contractId',
  'counterpartyName',
  'counterpartyEmail',
  'effectiveDate',
  'templateId'
];

const missing = required.filter((key) => !$json[key]);

if (missing.length) {
  throw new Error(`Missing contract fields: ${missing.join(', ')}`);
}

return [{ json: $json }];

This is an example validation rule, not a substitute for legal or data-quality review.

2. Generate the contract with TurboDocx

Create a TurboDocx template with explicit placeholders, for example:

{{contractId}}
{{counterpartyName}}
{{effectiveDate}}
{{totalAmount}} {{currency}}

In n8n, use an HTTP Request node or the provider's dedicated node if your installation includes one. Configure:

Setting Example
Method POST
URL https://api.example.turbodocx.invalid/v1/documents
Authentication Credential stored in n8n
Body format JSON
Template field {{$json.templateId}}
Output name {{$json.contractId}}-draft.docx

A provider-specific request commonly has this logical shape:

{
  "templateId": "={{$json.templateId}}",
  "fileName": "={{$json.contractId}}-draft.docx",
  "data": {
    "contractId": "={{$json.contractId}}",
    "counterpartyName": "={{$json.counterpartyName}}",
    "effectiveDate": "={{$json.effectiveDate}}",
    "totalAmount": "={{$json.totalAmount}}",
    "currency": "={{$json.currency}}"
  }
}

Store the returned document ID and draft download URL in the next item. Do not assume the generated file is ready immediately; if the API returns a processing state, add a short retry branch before requesting the file.

3. Ask for approval in Slack

Use the Slack node to send a compact approval request. Include only the information an approver needs:

Contract {{$json.contractId}}
Counterparty: {{$json.counterpartyName}}
Effective date: {{$json.effectiveDate}}
Amount: {{$json.totalAmount}} {{$json.currency}}

Draft: {{$json.draftUrl}}

Reply with:
APPROVE {{$json.contractId}}
or
REJECT {{$json.contractId}} reason

For a button-based workflow, use a Slack app with an interaction endpoint. The button payload should contain a non-sensitive contract ID, not the entire contract or a token. Route the interaction to an n8n webhook and verify the Slack signature before changing the contract state.

A simpler first version can use a separate approval form or an n8n webhook URL. Whatever interface you choose, persist the decision with the contract ID, approver identity, timestamp, and decision. Never treat the presence of a message alone as approval.

4. Send the approved document for signing

Place an If node after the approval step:

={{$json.decision === "approved"}}

On the false branch, update the record to rejected, notify the owner, and stop. On the true branch, create the signing request through the provider's API.

{
  "documentId": "={{$json.documentId}}",
  "signers": [
    {
      "name": "={{$json.counterpartyName}}",
      "email": "={{$json.counterpartyEmail}}",
      "role": "signer"
    }
  ],
  "metadata": {
    "contractId": "={{$json.contractId}}"
  },
  "callbackUrl": "https://YOUR_N8N_HOST/webhook/signature-status"
}

If your provider supports OAuth 2.0, use its credential type rather than manually managing access tokens. If it requires a bearer token, store that token in an n8n credential and reference the credential from the node.

5. Track the signing status

The preferred design is an event-driven callback. Configure the provider to call the n8n webhook when the request changes state. The webhook should:

  1. Verify the provider's signature or shared secret.
  2. Read the external signing-request ID and contract ID.
  3. Ignore duplicate events safely.
  4. Map provider states to your internal states.
Provider state Internal state Action
created, sent, viewed awaiting_signature Keep waiting
completed signed Download the signed PDF
declined, expired, canceled exception Notify the owner

If callbacks are unavailable, use a Wait node followed by an HTTP Request status check. Limit retries, for example to five checks with an increasing delay. A polling workflow must be idempotent: receiving the same status twice must not create duplicate files or duplicate notifications.

6. Store the signed PDF in SharePoint

When the state becomes signed, request the completed PDF from the signing provider. Keep the response as binary data in n8n. Then use the SharePoint node to upload the binary property.

SharePoint setting Example value
Site Your contract-management site
Library Documents
Folder ={{$json.sharePointFolder}}
File name ={{$json.contractId}}-signed.pdf
Binary property data

After the upload, save the returned SharePoint URL and send a final Slack message to the owner. Avoid putting the signed PDF itself in Slack; send a controlled link with appropriate access permissions.

Recommended workflow layout

Webhook / Manual Trigger
  → Code: validate input
  → HTTP Request: create TurboDocx document
  → Slack: request approval
  → Webhook: receive approval
  → If: approved?
      ├─ false → update rejected → notify owner
      └─ true
           → HTTP Request: create signing request
           → Webhook: receive signing status
           → If: completed?
               ├─ false → update exception or wait
               └─ true
                    → HTTP Request: download signed PDF
                    → SharePoint: upload binary
                    → Slack: send final link

In a real workflow, store state in a database, spreadsheet, or internal system rather than relying only on the latest n8n item. At minimum, store contractId, document ID, signing-request ID, current state, timestamps, and the final SharePoint URL.

Verification checklist

Run these checks in a test workspace with non-production data before enabling the workflow:

  • Submit a payload with a missing required field and confirm that no document is generated.
  • Generate a draft and confirm that every template placeholder is populated.
  • Reject the draft in Slack and confirm that no signing request is created.
  • Approve the draft and confirm that the signing request contains the intended signer.
  • Replay the same status event and confirm that it does not create a second SharePoint file.
  • Complete the signing flow and confirm that the uploaded file is a PDF with the expected name.
  • Send an expired or declined status and confirm that an owner notification is produced.
  • Inspect execution logs and remove personal data or secrets from retained test data.

These are recommended verification steps. They are not reported test results from this article.

Common failure cases

The template contains blank fields

Compare the placeholder spelling and capitalization with the JSON keys. Log the list of keys, not the full payload. Add validation for values that must not be empty.

Slack approval cannot be matched to a contract

Put a unique contract ID in the button payload or command. Do not match on the counterparty name, because names can be duplicated or edited.

The signing provider sends duplicate callbacks

Use the provider event ID or a combination of signing-request ID and status as an idempotency key. Before uploading, check whether the signed file already exists.

The PDF download returns an HTML error page

Check the response content type and status code before passing binary data to SharePoint. Confirm that the signing request is actually complete and that the API credential can download completed documents.

SharePoint upload fails for larger documents

Check the provider and SharePoint size limits. For large files, use the provider's direct download method and SharePoint's resumable upload approach if supported.

Security and operational limits

  • Use least-privilege credentials for TurboDocx, Slack, the signing service, and SharePoint.
  • Verify webhook signatures and reject requests with an invalid timestamp or replayed event.
  • Do not send full contract contents to Slack unless your organization's policy explicitly permits it.
  • Define retention rules for drafts, signed files, n8n execution data, and webhook payloads.
  • Keep legal review outside the automation. The workflow moves documents and records decisions; it does not determine whether contract language is legally acceptable.
  • Confirm identity verification, signing order, audit-trail, and jurisdiction requirements with your e-signature provider and legal team.

The exact node names, endpoints, authentication methods, and response fields depend on the versions and plans of the services you use. Treat the workflow shape as the reusable part and map each provider's current schema into it.

Conclusion

The reliable pattern is to make the contract ID the thread connecting every system: template data, Slack approval, signing request, status event, and SharePoint file. Build the workflow around explicit states, signed callbacks, idempotent uploads, and credentials managed outside the payload. That gives you a contract process that can be inspected, retried, and reproduced without manually moving files between applications.

For related automation patterns, continue with the guides or review the glossary.

We publish what works for us—and implement the same solutions for your business. We design AI automation, Telegram bots, chats, and AI agents for real-world processes. Discuss your project →