Falaah Falaah AI

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

  1. Navigate to Documents → Templates
  2. Browse or search for a template
  3. Click Use Template
  4. Select data source (document, record)
  5. Review generated document
  6. Save or download

Template Preview

Before generating:

  1. Click Preview on any template
  2. See example output with sample data
  3. Understand what data is needed

Creating Custom Templates

Starting a New Template

  1. Go to Documents → Templates.
  2. Click New Template, or Generate with AI to have Muin draft the template from a short description (you review and edit it before saving).
  3. 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
  4. Write the template body. A new template starts from a simple outline with {{title}}, {{date}} and {{reference_number}} placeholders you can keep or replace.
  5. 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:

  1. In the variables section, add a variable.
  2. Give it a Variable Name (for example customer_name) and a Label people will see (for example “Customer Name”).
  3. Pick its type: Text, Number, Date or Yes/No.
  4. 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:

  1. Select the content block
  2. Click Make Conditional
  3. Set condition:
    • {{amount}} > 10000 - Show for large amounts
    • {{status}} == "overdue" - Show for overdue
  4. 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:

  1. Select content to repeat
  2. Click Make Repeating
  3. Choose the data collection (e.g., line items)
  4. 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

  1. Open a document
  2. Click Generate from Template
  3. Select template
  4. Preview the result
  5. Save or download

From a Record

  1. Open a record (vendor, employee, etc.)
  2. Click Generate Document
  3. Select template
  4. Choose which documents to include
  5. Preview and save

Batch Generation

Generate multiple documents at once:

  1. Select multiple records or documents
  2. Click Batch Generate
  3. Select template
  4. Documents generated for each
  5. 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:

  1. Open template
  2. Click Version History
  3. See all versions with changes
  4. 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

  1. Test with real data - Ensure fields work correctly
  2. Handle edge cases - What if a field is empty?
  3. Consistent branding - Match company standards
  4. Clear naming - Describe purpose and use case

Variable Fields

  1. Use descriptive names - Clear field references
  2. Provide defaults - For optional fields
  3. Format appropriately - Dates, currency, etc.
  4. Document requirements - Note what data is needed

Maintenance

  1. Review regularly - Keep content current
  2. Update for changes - When policies or branding change
  3. Archive old versions - Don’t delete, just deactivate

Troubleshooting

Fields Not Filling

  1. Verify field name matches data source
  2. Check data exists in source document/record
  3. Review field syntax
  4. Test with different source

Formatting Issues

  1. Check template formatting
  2. Verify field doesn’t break layout
  3. Use appropriate field types
  4. Test with various data lengths

Conditional Not Working

  1. Verify condition syntax
  2. Check field values match expected
  3. Test with known values
  4. Simplify condition to debug

Next Steps


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

  1. Go to Administration -> Document Types (/platform/document-types). Owners and admins only.
  2. The counters report Total Types, System Types (pre-configured), Custom Types (yours) and Active Types. Include inactive widens the list.
  3. Open a type to see its Schema Version, Display Order, what it Extends, its Extraction Schema, its Chat Keywords and its Document Lifecycle.
  4. 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:

  1. Documents – every document of this type, with Browse all documents.
  2. Templates – the templates for it, with Create template.
  3. Composer – its assembly projects, with Start composer project.
  4. 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