Calafai Docs

Templates

Templates

What Are Templates?

Templates are reusable engagement configurations. Instead of designing a task pipeline from scratch for every engagement, you can select a template to generate the plan from a known starting point. Templates capture the engagement structure: name, description, brief, budget, task definitions (including DAG dependencies), and engine options.

System Templates

Groundtruth ships with five built-in system templates covering common consulting engagement types. System templates are available to all tenants and cannot be edited or deleted.

1. Brand Digital Presence

Slug: brand_digital_presence

A comprehensive brand and digital presence strategy engagement. Tasks cover brand audit, competitive landscape analysis, digital channel strategy, content framework, and implementation roadmap.

2. Business Transformation

Slug: business_transformation

A business transformation consulting engagement. Tasks cover current-state assessment, target operating model design, gap analysis, transformation roadmap, change management plan, and risk mitigation strategy.

3. Go-to-Market

Slug: go_to_market

A go-to-market strategy engagement. Tasks cover market sizing, customer segmentation, value proposition development, channel strategy, pricing analysis, and launch plan.

4. Product Strategy

Slug: product_strategy

A product strategy development engagement. Tasks cover user research synthesis, competitive analysis, product vision and roadmap, feature prioritization, technical feasibility assessment, and success metrics definition.

5. Research Deep Dive

Slug: research_deep_dive

A research deep-dive analysis engagement. Tasks cover desk research, stakeholder interview synthesis, data analysis, insight generation, opportunity mapping, and recommendations report.

Custom Templates

You can create custom templates from any existing engagement. This is useful when you have refined an engagement configuration that works well and want to reuse it for future clients or projects.

Saving a Template from an Engagement

On the engagement detail page, the brief section includes a Save as reusable framework button. Clicking it captures the engagement's current brief, budget, and task list into a reusable framework. The framework is automatically named after the engagement. A confirmation message appears once the framework is saved.

Custom templates are scoped to your tenant -- only your team members can see and use them. Custom templates are available on the Professional and Enterprise plans.

Creating a Template via the API

You can also create templates programmatically by sending a POST request to /api/templates with the following fields:

  • name (required) -- Display name for the template (max 200 characters).
  • description (required) -- A short description of what this template is for (max 2,000 characters).
  • brief (required) -- The engagement brief text (max 50,000 characters).
  • budget -- Budget in USD. Defaults to $5.00 if not specified (max $1,000).
  • tasks -- Array of task definitions, each with name, description, expected output, agent assignment, phase, and optional depends_on for DAG ordering.
  • options -- Additional engine options as a JSON object (e.g., enable_observer, enable_parallel).

A URL-safe slug is generated automatically from the name. If a slug collision occurs within your tenant, a random suffix is appended.

Template Fields

Each template stores the following configuration:

FieldDescription
nameDisplay name
slugURL-safe identifier (auto-generated)
descriptionShort summary of the template's purpose
briefFull engagement brief text
budgetDefault budget in USD
tasksArray of task definitions with DAG dependencies
optionsEngine options (observer, parallel execution, etc.)
isSystemWhether this is a built-in system template

Using a Template

Templates are used during engagement creation in Step 3 (Plan) of the wizard. At the top of the plan step, a template dropdown lets you choose from available templates -- system templates and your tenant's custom templates are listed together.

  • Select a template to generate the task pipeline based on that template's structure.
  • Select "Generate from brief" (the default) to have the AI design the plan from scratch using only the engagement brief.

After selecting a template and clicking Generate, the task planner creates a service plan using the template as a starting point. You can then review the generated tasks, provide feedback, and regenerate if needed before approving the plan.

Managing Templates

Listing Templates

GET /api/templates returns both system templates and your tenant's custom templates, sorted with system templates first and then alphabetically by name.

Deleting Templates

Custom templates can be deleted via DELETE /api/templates/[id]. System templates cannot be deleted -- attempts to do so return a 403 error.

  • Engagements -- Creating engagements using the wizard and task planner.

On this page