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
fw_workflow_templates table
Key features:
- Visual workflow builder integration
- Template marketplace for sharing
- Template parameterization
- Version tracking
- Usage statistics
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)
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
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
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
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
pf_wizard_templates table
Key features:
- System templates (defaults)
- Organization customization
- Custom step components
- Visibility conditions
- Validation rules per step
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
specs/_templates/ directory (file system only)
Key templates:
SPEC_TEMPLATE.md- Complex featuresSPEC_TEMPLATE_LITE.md- Simple featuresSPEC_TEMPLATE.md(wizard flow; snippetsnippets/wizard-flow.md) - Module wizardsSPEC_TEMPLATE_LITE.md- Printable documentsTASKS_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
- 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:- Quick Export: Open any submission at
/fw/submissions/:idand click “Download PDF” for an instant export - Branded Export: Click “Export with Letterhead” to choose your organization’s letterhead and formatting
- 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?”
Related Documentation
- TERMINOLOGY.md - Template terminology definitions
- Wizard Selection Guide - Choosing wizard types
- Clarity Analysis - Feature comparison
- Template Index - Spec template reference
- PF/FW Documentation Review - Detailed analysis
- Forms/Templates/UX Review (2026-02-05) - Comprehensive UX analysis
Last Updated: 2026-02-05