Feature · Documents

Templates in. Locale-aware PDFs out. E-signed. Audited.

Carbone renders DOCX from JSON; Gotenberg converts to PDF; MinIO stores by content hash; DocuSeal collects signatures. Every step is jurisdiction-aware and locale-aware.

What it does

One pipeline. Many jurisdictions.

The documents context owns three aggregates: DocumentTemplate, GeneratedDocument, and SignatureRequest. Templates are versioned DOCX files with Carbone’s tag syntax. Generation is a single API call: pass a template id and a context object; the API runs Carbone (DOCX → DOCX), then Gotenberg (DOCX → PDF), computes the SHA-256 of the PDF, and stores it in MinIO at documents/{tenantId}/{sha256}. The audit chain references the SHA — not the bytes — so changing a generated document is structurally impossible.

Locale and calendar formatters are injected into the Carbone context: {date | format:$locale.calendar.long}, {amount | format:$locale.currency}, {name | dir:auto}. The same template renders correctly for an English-speaking US client (Gregorian, USD) and an Arabic-speaking Saudi client (Hijri, SAR, RTL paragraphs). Templates that try to embed locale-specific strings inline are rejected at upload time; CI checks for parity with the i18n catalog.

Signatures use DocuSeal. The API creates an envelope, attaches the generated document, and configures signers and roles. DocuSeal handles email or SMS delivery, the signing UI, and the X.509 certificate of completion. Webhooks back signal the documentSignatureWorkflow in Temporal, which writes audit events at every step (sent, viewed, signed, completed, voided).

Jurisdiction-specific templates ship in the box: SAMA-aligned account agreements, FCA-aligned suitability summaries, SEC-aligned Form CRS, CBI-aligned KYC packages. Customers add their own; the platform never assumes its templates are the only ones.

Document pipeline diagram
Pipeline

Five hops. Tracked end-to-end.

  1. 1 · Render

    Carbone consumes the template and the context object; produces a locale-correct DOCX.

  2. 2 · Convert

    Gotenberg runs LibreOffice to convert the DOCX to a PDF (PDF/A optional).

  3. 3 · Hash

    SHA-256 of the PDF computed and stored as contentHash on the GeneratedDocument record.

  4. 4 · Store

    PDF written to MinIO at documents/{tenantId}/{sha256}; bucket has versioning and per-tenant policies.

  5. 5 · Sign

    (optional) DocuSeal envelope created; webhooks signal Temporal for state progression and audit.

Capabilities

Six things this context owns.

Versioned templates

Per-tenant DOCX templates with effective ranges. Old documents render with their template version.

Locale formatters

Calendar, number, currency, direction, units — all available as Carbone filters.

Content addressing

SHA-256 of the PDF. Identical inputs produce identical outputs; the chain references hashes.

Object lock

MinIO compliance-mode object lock on the evidence bucket; documents cannot be deleted or overwritten.

E-signature

DocuSeal integration. Multi-party signing, decline reason capture, certificate of completion.

Pre-signed URLs

24-hour pre-signed URLs for client downloads. Watermarked when delivered through the client portal.

Documents demo

Bring your worst template.

We will port it to Carbone, render in three locales, route through DocuSeal, and show you the audit chain referencing the content hash.