Document Templates
Create documents from reusable templates with data auto-filled from Muin. Standardize reports and letters, cut manual work, and keep every output consistent.
Document templates let you create standardized documents with data automatically filled in from Muin. Generate reports, letters, and other documents without starting from scratch.
What Are Templates?
Templates are document blueprints with:
- Fixed content - Standard text, formatting, branding
- Variable fields - Placeholders filled with real data
- Conditional sections - Content that appears based on conditions
- Repeating sections - For lists and tables
Using Pre-Built Templates
Available Templates
Muin includes templates for common documents:
| Category | Templates |
|---|---|
| Finance | Invoice, Payment receipt, Statement |
| HR | Offer letter, Employment verification |
| Vendors | Purchase order, RFP, Vendor letter |
| General | Cover letter, Memo, Report |
Using a Template
- Navigate to Documents → Templates
- Browse or search for a template
- Click Use Template
- Select data source (document, record)
- Review generated document
- Save or download
Template Preview
Before generating:
- Click Preview on any template
- See example output with sample data
- Understand what data is needed
Creating Custom Templates
Starting a New Template
- Go to Documents → Templates.
- Click New Template, or Generate with AI to have Muin draft the template from a short description (you review and edit it before saving).
- Fill in the template details:
- Template Name and an optional Description of when to use it
- Module, which decides which templates list the template appears in
- Document type, the kind of document the template produces (required)
- Format: Markdown, HTML or Plain Text
- Write the template body. A new template starts from a simple outline with
{{title}},{{date}}and{{reference_number}}placeholders you can keep or replace. - Click Create Template. You land back on the templates list for that module.
Adding Variable Fields
Variables are the blanks a person fills in when they use the template:
- In the variables section, add a variable.
- Give it a Variable Name (for example
customer_name) and a Label people will see (for example “Customer Name”). - Pick its type: Text, Number, Date or Yes/No.
- Use it in the body as
{{customer_name}}. Every place it appears is filled with the same value.
You can remove a variable at any time; remove its {{name}} from the body too.
Template Variables
| Variable Type | Example | Source |
|---|---|---|
| Document | {{invoice.vendor}} |
Extracted data |
| Record | {{employee.title}} |
Linked record |
| System | {{current_date}} |
System generated |
| User | {{user.email}} |
Current user |
| Organization | {{org.name}} |
Organization settings |
Conditional Sections
Adding Conditions
Show content only when conditions are met:
- Select the content block
- Click Make Conditional
- Set condition:
{{amount}} > 10000- Show for large amounts{{status}} == "overdue"- Show for overdue
- Content appears only when true
Example: Payment Terms
{{#if payment_terms == "Net 30"}}
Payment is due within 30 days of invoice date.
{{/if}}
{{#if payment_terms == "Due on Receipt"}}
Payment is due immediately upon receipt.
{{/if}}
Repeating Sections
For Lists and Tables
Create sections that repeat for each item:
- Select content to repeat
- Click Make Repeating
- Choose the data collection (e.g., line items)
- Content repeats for each item
Example: Invoice Line Items
{{#each line_items}}
| {{description}} | {{quantity}} | {{unit_price}} | {{total}} |
{{/each}}
Produces a row for each line item.
Generating Documents
From a Document
- Open a document
- Click Generate from Template
- Select template
- Preview the result
- Save or download
From a Record
- Open a record (vendor, employee, etc.)
- Click Generate Document
- Select template
- Choose which documents to include
- Preview and save
Batch Generation
Generate multiple documents at once:
- Select multiple records or documents
- Click Batch Generate
- Select template
- Documents generated for each
- Download as ZIP or save individually
Template Management
Organizing Templates
Create folders for templates:
- By department (Finance, HR, Vendors)
- By document type (Letters, Reports, Forms)
- By use case (Internal, External)
Template Versioning
Track template changes:
- Open template
- Click Version History
- See all versions with changes
- Restore previous if needed
Sharing Templates
Control who can use templates:
- Personal - Only you
- Team - Your team
- Organization - Everyone
- Published - Available in template gallery
Best Practices
Template Design
- Test with real data - Ensure fields work correctly
- Handle edge cases - What if a field is empty?
- Consistent branding - Match company standards
- Clear naming - Describe purpose and use case
Variable Fields
- Use descriptive names - Clear field references
- Provide defaults - For optional fields
- Format appropriately - Dates, currency, etc.
- Document requirements - Note what data is needed
Maintenance
- Review regularly - Keep content current
- Update for changes - When policies or branding change
- Archive old versions - Don’t delete, just deactivate
Troubleshooting
Fields Not Filling
- Verify field name matches data source
- Check data exists in source document/record
- Review field syntax
- Test with different source
Formatting Issues
- Check template formatting
- Verify field doesn’t break layout
- Use appropriate field types
- Test with various data lengths
Conditional Not Working
- Verify condition syntax
- Check field values match expected
- Test with known values
- Simplify condition to debug
Next Steps
- Document Processing - Understanding document data
- Building Workflows - Auto-generate documents
- AI Agents - Automated document generation
Document types: the schema behind a template
A template controls how a document looks. A document type controls what Muin understands about it: the fields to extract, the chat keywords that find it, and the one workflow that governs its approval and lifecycle.
The document-types list
- Go to Administration -> Document Types (
/platform/document-types). Owners and admins only. - The counters report Total Types, System Types (pre-configured), Custom Types (yours) and Active Types. Include inactive widens the list.
- Open a type to see its Schema Version, Display Order, what it Extends, its Extraction Schema, its Chat Keywords and its Document Lifecycle.
- Workflow Triggers lists the workflows that type fires, with View in Workflow Catalog to open them.
The screen states the rule it enforces: every document type has exactly ONE governing workflow, which owns the document’s approval and lifecycle states. Automations enrich and route documents but never approve them.
The document type hub
Each type also has its own working page at /document-types/{type}, which gathers everything for
that one kind of document:
- Documents – every document of this type, with Browse all documents.
- Templates – the templates for it, with Create template.
- Composer – its assembly projects, with Start composer project.
- Approval Policy – the governing policy, with View pending approvals.
Use the hub when you are working on one kind of document, and the admin list when you are configuring types.
When it goes wrong
| What you see | What to do |
|---|---|
| “Failed to load document types” | Reload. No type was changed. |
| “Document type not found” | The type was deactivated. Turn on Include inactive to find it. |
| “No workflow configured for this document type” | Nothing governs its approval. Attach a workflow in the Workflow Catalog. |
| “Missing document type” or “Unknown document type” on the hub | The URL names a type that does not exist here. Go to the document-types list and open it from there. |
| “No templates yet” / “No composer projects yet” / “No documents yet” on the hub | Nothing of that kind exists for this type yet. Not an error. |
Next step
- Assemble a document from a template: Document Assembly
- Automate what happens next: Building Workflows