Template Components

Feature Flags

Complete reference for options.features - the boolean flags that control which REFRACT Platform capabilities are activated per render request.

Overview

Feature flags live inside the options.features object on every render request. They are request-level switches - they control which REFRACT Platform services are invoked after the PDF is generated. This makes them distinct from templateSettings, which controls how the document is rendered and formatted.

{
  "templatePath": "DynamicsGP/Sales/gp-sales-order.vpdf",
  "payloadPath": "DynamicsGP/Sales/FULORD1008.json",
  "options": {
    "correlationId": "GUID-INV-001",
    "documentId": "FULORD1008",
    "docType": "Invoice",
    "generatedBy": "erp-service@contoso.com",
    "features": {
      "generatedDocuments": true,
      "auditSnapshot": true
    }
  }
}

All flags are optional and default to false

Omitting a flag is the same as setting it to false. You only need to include the flags you want to activate for a given request.


The options Object

Before diving into flags, here is the full options object. All fields are optional.

FieldTypeDescription
correlationIdstringUnique identifier for this render request. Used for deduplication, trace retrieval, and audit lookups. Recommended: a stable GUID per document.
documentIdstringDocument identifier written as the PDF filename and to SharePoint metadata (e.g. INV-2026-001).
docTypestringDocument category written to SharePoint columns (e.g. Invoice, Contract, Report).
generatedBystringEmail or identity of the user or service principal that triggered generation.
payloadIdstringReference ID of the source data payload.
userGroupstringClassification label for the requesting user group (e.g. Internal, External, Auditor).
featuresobjectBoolean feature flags - see Feature Flags Reference below.

Feature Flags Reference

Pass any combination of boolean flags inside options.features. Unrecognised flags are ignored.

FlagDescriptionLicense Tier
generatedDocumentsUpload the rendered PDF to the Generated Documents library in SharePoint or Azure Blob Storage.All
auditSnapshotWrite a PDFGenerated audit event to the Audit Logs library for activity tracking.All
dataRedactionApply the field-level redaction policy defined in the template before storing the document.Business+
explainDocumentCapture a machine-readable trace of every render decision. Auto-enabled when vaultESign, dataRedaction, or section508Accessibility is active. See Explain Document.Enterprise
immutableAuditWrite a tamper-evident audit record to the enterprise audit store. Required for signature and regulated workflows.Business+
vaultESignTrigger an electronic signature workflow after generation. Requires templateSettings.esign or templateSettings.workflow to be configured. See E-Sign.Business+
vaultDeliveryRoute the generated document through the Vault Delivery distribution service. See VaultDelivery.Business+
section508AccessibilityApply PDF/UA-1 tagging and generate an accessibility compliance trace. See Section 508.Business+
vaultWorkflowEnable Vault Workflow engine integration for multi-step approval and review flows. See VaultWorkflow.Enterprise

explainDocument auto-activation

You do not need to explicitly set explainDocument: true when vaultESign, dataRedaction, or section508Accessibility is enabled - the engine activates it automatically so that every regulated render has a full trace.


Use-Case Patterns

1. Standard Document Generation

Minimal setup: generate a PDF and store it in the document library with an activity record.

{
  "options": {
    "documentId": "INV-2026-001",
    "docType": "Invoice",
    "features": {
      "generatedDocuments": true,
      "auditSnapshot": true
    }
  }
}

When to use: ERP-integrated batch generation, internal reports, non-regulated documents.


2. Redacted Document

Apply template-defined field masking before storage. The explain trace is auto-enabled so every redaction decision is recorded.

{
  "options": {
    "documentId": "FULORD1008",
    "docType": "Invoice",
    "features": {
      "generatedDocuments": true,
      "auditSnapshot": true,
      "dataRedaction": true
    }
  }
}

When to use: Customer-facing copies of documents that contain internal cost data, HR documents shared with external parties, or any document where field-level masking is controlled by the template.


3. Electronic Signature Workflow

Route the generated document to a signature workflow and write a tamper-evident audit record when signing completes. immutableAudit is strongly recommended for any document that will be legally signed.

{
  "options": {
    "documentId": "CONTRACT-2026-042",
    "docType": "Contract",
    "features": {
      "generatedDocuments": true,
      "auditSnapshot": true,
      "vaultESign": true,
      "immutableAudit": true,
      "explainDocument": true
    }
  }
}

When to use: Vendor onboarding, NDAs, employment contracts, purchase agreements - any document that requires a legally defensible signature record.


4. Regulated / Immutable Audit Record

For documents that must satisfy SOX, HIPAA, or GDPR audit requirements. The immutable audit flag writes a record that cannot be modified or deleted after the fact.

{
  "options": {
    "documentId": "AUDIT-DOC-2026-001",
    "docType": "ComplianceReport",
    "features": {
      "generatedDocuments": true,
      "auditSnapshot": true,
      "immutableAudit": true,
      "explainDocument": true
    }
  }
}

When to use: Financial reports, compliance certifications, regulated healthcare or legal documents where every render decision must be provable at audit time.


5. Accessible Document (Section 508 / PDF/UA)

Tag the document for screen-reader compatibility and generate an accessibility compliance trace.

{
  "options": {
    "documentId": "REPORT-ACCESS-001",
    "docType": "Report",
    "features": {
      "generatedDocuments": true,
      "auditSnapshot": true,
      "section508Accessibility": true
    }
  }
}

When to use: Government agency submissions, publicly distributed reports, any document subject to ADA or Section 508 requirements.


6. Full Compliance Suite

The "Gold Standard" pattern for regulated industries. Every capability is active: storage, audit, redaction, signatures, accessibility, immutable record, and a complete explain trace.

{
  "options": {
    "correlationId": "GUID-COMPLIANCE-2026",
    "documentId": "REG-DOC-2026-001",
    "docType": "RegulatorySubmission",
    "generatedBy": "compliance-service@contoso.com",
    "features": {
      "generatedDocuments": true,
      "auditSnapshot": true,
      "dataRedaction": true,
      "explainDocument": true,
      "immutableAudit": true,
      "vaultESign": true,
      "section508Accessibility": true
    }
  }
}

When to use: Pharmaceutical submissions, financial regulatory filings, government contracts, or any workflow where full traceability, accessibility, and non-repudiation are mandatory.


Combining Features

Features compose independently. The table below shows which flags work well together and any dependencies to be aware of.

CombinationNotes
generatedDocuments + auditSnapshotBaseline. Always include both unless you explicitly don't want a storage record.
dataRedaction + explainDocumentexplainDocument auto-activates with dataRedaction. Redundant to set both, but harmless.
vaultESign + immutableAuditRequired pairing. Signed documents must have an immutable audit record to be legally defensible.
vaultESign + explainDocumentexplainDocument auto-activates with vaultESign. The trace records the pre-signature render state.
section508Accessibility + explainDocumentexplainDocument auto-activates. The trace includes the full accessibility compliance scorecard.
immutableAudit without auditSnapshotValid. immutableAudit writes to the enterprise store; auditSnapshot writes to the SharePoint Audit Logs library. They are separate destinations.

On this page