Skip to main content
Purpose: Help developers and AI agents choose the correct template type for their use case. Last Updated: 2026-02-01

Quick Decision


Decision Tree


Template Types Explained

1. Workflow Template (FW-28)

What it is: Pre-built workflow automation pattern that can be cloned and customized. Best for:
  • ✅ Employee onboarding automation
  • ✅ Invoice approval workflows
  • ✅ Incident response automation
  • ✅ Notification sequences
Storage: fw_workflow_templates table Key features:
  • Visual workflow builder integration
  • Template marketplace for sharing
  • Template parameterization
  • Version tracking
  • Usage statistics
Example:

2. Document Template (PF-64)

What it is: Structure template for printable documents with letterhead, sections, and approval chains. Best for:
  • ✅ Policies (CARF/HIPAA-aligned sections)
  • ✅ Procedures (step layout, verification blocks)
  • ✅ Business letters (letterhead, signature)
  • ✅ Report covers (title page, confidentiality)
  • ✅ Offer letters (HR documents)
Storage: pf_document_templates, pf_letterheads tables Key features:
  • Letterhead management (logo, address, branding)
  • Section configuration (required/optional)
  • Approval chain templates
  • Version history
  • PDF generation via edge function
Example:

3. Form Template (FW-01)

What it is: Form definition marked as a template that can be cloned to create new forms. Best for:
  • ✅ Standardized incident reports
  • ✅ Assessment form patterns
  • ✅ Survey templates
  • ✅ Intake form structures
Storage: fw_forms table with settings.is_template=true Key features:
  • Clone to create new form
  • Preserves field structure and validation
  • Organization-specific templates
  • Quick-start for common form types
Example:

4. Wizard Template (PF-41)

What it is: Configurable wizard definition for module-specific business processes. Best for:
  • ✅ Employee onboarding wizard
  • ✅ Resident admission wizard
  • ✅ Payroll run wizard
  • ✅ Organization setup wizard
Storage: pf_wizard_templates table Key features:
  • System templates (defaults)
  • Organization customization
  • Custom step components
  • Visibility conditions
  • Validation rules per step
Example:

5. Spec Template (Developer)

What it is: Markdown template for writing specifications and documentation. Best for:
  • ✅ Feature specifications
  • ✅ Implementation plans
  • ✅ Task breakdowns
  • ✅ Wizard UX specs
  • ✅ Document template specs
Storage: specs/_templates/ directory (file system only) Key templates:
  • SPEC_TEMPLATE.md - Complex features
  • SPEC_TEMPLATE_LITE.md - Simple features
  • SPEC_TEMPLATE.md (wizard flow; snippet snippets/wizard-flow.md) - Module wizards
  • SPEC_TEMPLATE_LITE.md - Printable documents
  • TASKS_TEMPLATE.md - Task breakdown

Side-by-Side Comparison


Common Mistakes

❌ Using Workflow Template for Documents

Wrong: Creating a workflow template to generate PDF policies Problem: Workflow templates define automation logic, not document structure Solution: Use Document Template (PF-64) for printable documents

❌ Using Document Template for Automation

Wrong: Trying to automate approval flow using document templates Problem: Document templates define structure, not automation Solution:
  • Use Document Template (PF-64) for the document structure
  • Use Approval Chain Template (also in PF-64) for approval workflow
  • Or use Workflow Template (FW-28) for complex automation

❌ Using Form Template for Documents

Wrong: Creating a form template to generate a policy document Problem: Forms are for data capture, not document generation Solution: Use Document Template (PF-64) for printable documents

❌ Confusing Spec Templates with Document Templates

Wrong: Using SPEC_TEMPLATE_LITE.md to create a policy (instead of defining a policy template) Problem:
  • Spec templates are for writing specifications
  • Document templates are for defining printable document structures
Solution:
  • Use SPEC_TEMPLATE_LITE.md to write a spec for a new document template
  • Use PF-64 API to create the actual document template

Integration Matrix


FAQ: Forms vs Document Templates

”How do I turn a form submission into a PDF?”

Forms (FW) capture data. Document Templates (PF-64) format printable documents. To export a form submission as a PDF:
  1. Quick Export: Open any submission at /fw/submissions/:id and click “Download PDF” for an instant export
  2. Branded Export: Click “Export with Letterhead” to choose your organization’s letterhead and formatting
  3. Signed Export: If the form has signature fields (FW-33), use “Signed PDF” to include captured signatures

”Should I create a form or a document template?”

“Where do I manage templates?”



Last Updated: 2026-02-05