Skip to main content
This guide walks you through the practical aspects of building project templates in Kodexa. For detailed reference documentation on the complete structure and all available properties, see Project Template Structure Reference.

Table of Contents

  1. Quick Start
  2. Design Principles
  3. Building Your First Template
  4. Common Patterns
  5. Advanced Techniques
  6. Testing and Deployment
  7. Troubleshooting

Quick Start

What is a Project Template?

A project template is a blueprint that defines the complete structure of a Kodexa project. When a user creates a project from a template, Kodexa instantiates all the components defined in the template: stores, assistants, taxonomies, workspaces, and more.

Minimum Viable Template

The simplest project template:
Deploy this with:

Template Structure Overview


Design Principles

1. Start with the User Journey

Before writing YAML, map out the user’s workflow:
This journey might translate to:
  • Store: Raw documents (upload destination)
  • Assistant: PDF parser (automatic processing)
  • Workspace: Review interface
  • Document Statuses: New → Processing → Review → Approved
  • Data Form: Manual corrections

2. Use Variable Substitution for Uniqueness

Always use ${project.id} in slugs to ensure uniqueness:
Available variables:

3. Separate Concerns by Store Purpose

4. Build Incrementally

Start minimal and add complexity as needed:
  1. Phase 1: Single store + basic workspace
  2. Phase 2: Add assistant for automation
  3. Phase 3: Add taxonomy for classification
  4. Phase 4: Add data forms for manual entry
  5. Phase 5: Add status workflows

Building Your First Template

Scenario: Invoice Processing System

Let’s build a complete invoice processing template step by step.

Step 1: Define Base Metadata

Step 2: Create Stores

Step 3: Define Document Workflow

Step 4: Create Assistant for Processing

Step 5: Add Data Form for Manual Entry

Step 6: Create Taxonomy for Classification

Step 7: Configure Workspace

Step 8: Add User Options

Complete Template

Here’s the full template assembled:

Common Patterns

Pattern 1: Multi-Stage Processing Pipeline

Chain multiple assistants for sequential processing:

Pattern 2: Conditional Processing with Subscriptions

Use subscription expressions to control when assistants trigger:

Pattern 3: Reference Existing Components

Reuse taxonomies and other components across templates:

Pattern 4: Sample Data for Testing

Include sample files in stores:

Pattern 5: Pre-configured Workspaces

Create role-specific workspaces:

Pattern 6: Knowledge-Driven Processing

Use knowledge sets for rule-based automation:

Advanced Techniques

Dynamic Store References

Build store references dynamically:

Scheduled Processing

Run assistants on a schedule:

Complex Form Validation

Add sophisticated validation to data forms:

Conditional Panel Visibility

Show/hide workspace panels based on project configuration:

Multi-Level Taxonomies

Create deep hierarchical taxonomies:

Testing and Deployment

Pre-Deployment Checklist

Before deploying your template:
  • YAML Syntax: Validate YAML is well-formed
  • Variable Substitution: Check all ${...} variables are valid
    • ${project.id}, ${project.name}, ${project.slug}, ${orgSlug}
  • References: Verify all component references exist
    • Assistant definitions: orgSlug/assistant-name
    • Store refs: orgSlug/store-slug
    • Taxonomy refs: orgSlug/taxonomy-slug
  • Slugs: Ensure slugs are URL-safe (alphanumeric, hyphens, underscores only)
  • Required Fields: All required properties are set
    • Stores: slug, name, storeType, storePurpose
    • Assistants: name, slug, assistantDefinitionRef
  • Colors: Status colors are valid hex codes (#RRGGBB)
  • Workspace Panels: At least one panel is enabled
  • Subscription Expressions: Syntax is valid

Testing Strategy

1. Dry Run Validation

2. Create Test Project

3. Test Each Component

Test stores:
Test assistants:
Test workspace:
  • Open workspace in UI
  • Verify all panels appear correctly
  • Test navigation between components

4. Test Variable Substitution

Create a project and verify variables resolved correctly:

5. Test Workflows

  1. Upload document to intake store
  2. Verify assistant triggers
  3. Check document moves through statuses
  4. Test data form submission
  5. Verify taxonomy classification works

Deployment Best Practices

Version Numbering

Use semantic versioning:
  • Major: Breaking changes (incompatible with previous version)
  • Minor: New features (backward compatible)
  • Patch: Bug fixes (backward compatible)

Deployment Command

Rolling Updates

When updating templates:
  1. Test in staging: Deploy to test org first
  2. Version increment: Bump version number
  3. Document changes: Update changelog/release notes
  4. Deploy to production: Deploy to production org
  5. Monitor: Check new projects create successfully

Rollback Strategy

Keep previous versions available:

Troubleshooting

Common Issues and Solutions

Issue: “Variable substitution not working”

Problem: Variables like ${project.id} appearing literally in created projects. Cause: Variables only resolve during project creation, not in the template itself. Solution:
  • Variables are correct if they appear in the template YAML
  • Check created project to see resolved values
  • Use quotes around variable strings: "${project.id}-store"

Issue: “Assistant not triggering”

Problem: Assistant doesn’t process documents added to store. Debug steps:
Common causes:
  1. Wrong sourceRef: Verify store reference is correct
  2. Subscription filter: Check subscription expression
    • Remove temporarily to test without filter
  3. Store access: Verify assistant has store in stores list

Issue: “Components not appearing in workspace”

Problem: Created stores/forms don’t show in workspace. Cause: Panels must be explicitly enabled. Solution:

Issue: “Reference not found”

Problem: Component reference 'kodexa/my-assistant' not found Debug:
Solutions:
  1. Deploy the referenced component first
  2. Use correct version number
  3. Check organization slug is correct

Issue: “Invalid subscription expression”

Problem: Subscription expression syntax error Valid expression examples:

Issue: “Slug validation error”

Problem: Invalid slug format Requirements:
  • Only alphanumeric, hyphens, underscores
  • No spaces or special characters
  • Must start with letter or number
Examples:

Issue: “Options not appearing in UI”

Problem: Defined options don’t show when creating project. Solution: Check the nested options structure:

Issue: “Files not uploading to store”

Problem: Files defined in files list don’t appear in created store. Debug:
Common causes:
  1. URL not accessible (401, 404)
  2. File too large
  3. Invalid filename
Check logs:

Getting Help

Documentation Resources

API Reference

Support Channels


Summary

Key Takeaways

  1. Start Simple: Begin with minimal viable template, add complexity incrementally
  2. Use Variables: Always use ${project.id} for uniqueness
  3. Test Thoroughly: Validate, create test project, verify each component
  4. Document Well: Provide helpful descriptions and workspace overviews
  5. Version Carefully: Use semantic versioning, maintain backward compatibility

Next Steps

  1. Review Reference: Read the complete structure reference
  2. Explore Examples: Check existing templates in your organization
  3. Build Your Template: Start with the quick start example and customize
  4. Test and Deploy: Follow the testing checklist before production deployment
  5. Iterate: Gather user feedback and improve your template over time

Template Development Workflow

Happy template building!