Headless & Integration package

Document generation pipeline

Turn contract data from any app into a filled Word contract and Excel fee schedule, file both in your DMS and send the contract for e-signature.

Headless / APIIntermediate~20 min setupv1.0.0

About this package

What it does

Document generation pipeline produces contract documents without anyone opening Word. An application (your CRM, billing system or a back-office tool) posts the contract data: document type, customer, reference, start date, amount, term, signer and the URL of the Word template.

The Document templates table sets the title, file name pattern, DMS folder, retention period, body text and whether the document type needs a signature. The workflow fills the Word template's {{TITLE}}, {{CUSTOMER}}, {{DATE}}, {{AMOUNT}}, {{REFERENCE}} and {{BODY}} placeholders and, when an Excel template URL is passed, fills a fee schedule with the dates, total and monthly equivalent.

Both files are registered in your document management system with their metadata and retention. Document types that need a signature are sent to the signer through your e-signature service, and the signer gets an email with the signing link. Add rows for your own document types and point the two integrations at your DMS and e-signature provider.

Headless / API

Headless: your application posts the contract data and template URL to the start API or an inbound webhook.

Another system starts it over REST or an inbound webhook. No UI is needed; people only appear where a decision needs a human.

The flow

Step by step

  1. 1

    Contract data received

    The calling app posts the document type, customer, reference, start date, amount, term, signer and template URL.

  2. 2

    Look up the document type

    The Document templates row gives the title, file name pattern, folder, retention, body text and signature rule.

  3. 3

    Fill the Word template

    The six placeholders are replaced with the contract values, including the term dates.

  4. 4

    Build the fee schedule

    When an Excel template is passed, the schedule is filled with the dates, total and monthly equivalent.

  5. 5

    File in the DMS

    The contract and schedule are registered with their metadata, folder and retention period.

  6. 6

    Send for signature

    Types that need a signature go to the e-signature service and the signer gets the signing link by email.

Generate contract documents — An application posts contract data; the document type sets the title, file name, folder, retention and signature rule; the Word template is filled, an optional Excel schedule is produced, the files are registered in the DMS and the contract is sent for e-signature. The same canvas you get in the designer after installing.

Forms

Inputs and task forms

The inputs a caller passes when it starts a run, and the forms people complete when the process needs a decision.

Start inputs

Generate contract documents

Passed by the calling system

Document type * doc_type · select
service_agreementorder_formrenewal_letternda
Document type (a row of the Document templates table)
Customer * customer_name · textCustomer legal name as it appears on the contract
Contract reference * contract_reference · textContract reference, e.g. CT-2026-118
Start date * start_date · dateYYYY-MM-DDContract start date (YYYY-MM-DD)
Amount * amount · number0Total contract value for the term, excluding tax
Currency currency · textISO currency code
Term (months) * term_months · number0Term in months
Signer name signer_name · textName of the person signing for the customer
Signer email * signer_email · emailname@company.comEmail of the signer: receives the signing link
Word template URL template_url · urlhttps://…URL of the Word template with {{TITLE}} {{CUSTOMER}} {{DATE}} {{AMOUNT}} {{REFERENCE}} {{BODY}} placeholders (required)
Excel schedule template URL schedule_template_url · urlhttps://…Optional: URL of an Excel template for the fee schedule (labels in A2:A9, values in B2:B9)

Headless

Call it from your systems

Every workflow can be started over REST, MCP or the CLI, whatever its trigger, with the sample input below. Runs start straight away on the published version; replace <workflow id> with the id the install created.

REST

shell
curl -X POST "$USERTASKS_URL/api/v1/workflows/start" \
  -H "Authorization: Bearer $USERTASKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"workflow_id":"<workflow id>","variables":{"doc_type":"service_agreement","customer_name":"Fourth Coffee Limited","contract_reference":"CT-2026-118","start_date":"2026-11-01","amount":48000,"currency":"NZD","term_months":24,"signer_name":"Robin Diaz","signer_email":"robin.diaz@fourthcoffee.example.com"}}'

CLI

shell
usertasks workflows inputs <workflow id>          # the start form: keys, types, required
usertasks workflows run <workflow id> --input doc_type=service_agreement --input customer_name="Fourth Coffee Limited" --input contract_reference=CT-2026-118 --input start_date=2026-11-01 … --wait

Inbound webhook

shell
usertasks webhooks create <workflow id>          # prints the hook slug and secret once
curl -X POST "$USERTASKS_URL/api/webhooks/inbound?hook=<slug>" \
  -H "Authorization: Bearer <webhook secret>" -H "Content-Type: application/json" \
  -d '{"doc_type":"service_agreement","customer_name":"Fourth Coffee Limited","contract_reference":"CT-2026-118","start_date":"2026-11-01","amount":48000,"currency":"NZD","term_months":24,"signer_name":"Robin Diaz","signer_email":"robin.diaz@fourthcoffee.example.com"}'

What's included

7 assets, ready to adapt

TypeNameDetails
Email templateDocument ready to signSent to the signer with the signing link.
Data tableDocument templatesOne row per document type: the title printed on the document, the file name pattern ({reference}, {customer}), the DMS folder, how long to keep it and whether it needs a signature.
IntegrationDocument management system
IntegrationE-signature service
API referenceCreate signature requestPOST /signature-requests — Send the document for electronic signature to the signer and return the envelope and signing link.
API referenceRegister documentPOST /documents — Register a generated document in the DMS: the file is fetched from its URL and filed with its metadata and retention period.
WorkflowGenerate contract documents24 steps — An application posts contract data; the document type sets the title, file name, folder, retention and signature rule; the Word template is filled, an optional Excel schedule is produced, the files are registered in the DMS and the contract is sent for e-signature.

Document templates · 4 sample rows

Document typeTitleFile name patternDMS folderRetention (days)Signature requiredBody text

Requirements

What you connect it to

Credentials never travel in a package. The install wizard asks for what your environment must provide, or installs it incomplete until you finish setup.

Needs

  • REST API — A REST API integration: set its base URL and credentials on install.
  • Document templates — Word / Excel / PowerPoint template files reachable by URL or in storage.
  • Inbound webhook — An inbound webhook created for the workflow, so other systems can start it.
  • Email (optional) — Email delivery configured for the instance (EMAIL_PROVIDER), used for notifications.

After installing

  1. Word template: put {{TITLE}}, {{CUSTOMER}}, {{DATE}}, {{AMOUNT}}, {{REFERENCE}} and {{BODY}} in your contract template and store it where the workflow can fetch it by URL (pass it as template_url).
  2. Excel schedule (optional): a workbook whose first sheet takes labels in A2:A9 and values in B2:B9 (customer, reference, start and end date, term, total, monthly equivalent, document type), passed as schedule_template_url. Change the cells on Fill fee schedule to match your layout.
  3. Document management system: set the base URL and API token. Register document posts the generated file URL and metadata to /documents.
  4. E-signature service: set the base URL and API token. Create signature request posts to /signature-requests.
  5. Edit the Document templates rows: titles, file name patterns, folders, retention days, body text and which types need a signature.
  6. Email (optional): configure EMAIL_PROVIDER so signers get the signing email (the step continues on error).

Asked for on install

  • Integration “Document management system”Required

    • Tokenconfig.auth_config.token
    • Base urlconfig.base_urldefault https://dms.example.com/api· optional
  • Integration “E-signature service”Required

    • Tokenconfig.auth_config.token
    • Base urlconfig.base_urldefault https://esign.example.com/v1· optional

Install

Install it in your workspace

Works on UserTasks cloud and on any self-hosted instance. Installing creates the assets above; nothing runs until you complete setup and start it.

In the app

  1. Download document-generation-pipeline-1.0.0.utpkg.
  2. Open Automations → Packages and drag the file onto the page (or choose Import package). Browse gallery there lists every gallery package without downloading by hand.
  3. Pick the file. The wizard verifies the checksum, every file hash and the signature, and shows the readme.
  4. Review the changes (what is created) and the data rows.
  5. Fill in the requirements, or tick Keep incomplete and finish later with Complete setup.
  6. Done: the workflow is published and active once setup is complete.

With the CLI

shell
curl -fLO https://usertasks.com/gallery/document-generation-pipeline-1.0.0.utpkg
usertasks packages inspect document-generation-pipeline-1.0.0.utpkg       # offline: checksum, hashes, signature
usertasks packages install document-generation-pipeline-1.0.0.utpkg --dry-run
usertasks packages install document-generation-pipeline-1.0.0.utpkg       # prompts for each requirement
usertasks packages install document-generation-pipeline-1.0.0.utpkg --keep-incomplete --yes   # in CI; finish with:
usertasks packages complete document-generation-pipeline -f values.yaml

Verify the download

File SHA-256
4ffbe87c48463154314a81347a621da251b14997aa8afbe41b4d12a7594d1730
Package checksum (what is signed)
sha256:bc3f0fe727c5fcea4b94dddbf96d68eb926e2310b453ab1e8c0c9800e88495f1
Signer
Unsigned preview build — compare the SHA-256 above

shasum -a 256 document-generation-pipeline-1.0.0.utpkg should print the file SHA-256. How gallery packages are signed.

Versions

Version 1.0.0

  1. v1.0.02026-10-26First release.

Installing a newer version upgrades in place: local credentials and requirement values are kept, and changes you made are flagged first. How packages work

More packages

Related

Browse the whole gallery