Templates

The nine built-in templates — what each one decides, its questions, composites and policies, the patterns it demonstrates — and how to start a decision from one.

Templates are production-ready starting points. Using one creates an editable draft in your workspace with the template's name, description and schema; nothing is shared with the template afterwards.

Start from a template

  • Templates in the app → pick a card → Create decision, or
  • Decisions → New decision → choose a template (or Blank decision) → Create decision.

The Templates page opens with the four patterns — each card explains the pattern and links to the templates that implement it — followed by All templates, with each template's category, patterns and questions.

The slug — your endpoint — comes from the decision's name: Lead Qualification becomes lead-qualification (or lead-qualification-2 if it's taken). The four pattern templates have the pattern in their name — Support Ticket Triage (fan-out) would become support-ticket-triage-fan-out — so rename them in Name it to get a short slug such as ticket-triage, or edit the slug in the editor before the first deploy. When the slug matches a template id, the sidebar's Playground starts with the template's sample state.

With the CLI, dcision templates lists the template ids and dcision init --template <id> writes the schema to a file.

The templates

IdCategoryPatternsDecidesState
lead-qualificationSalesIntent routing, Confidence-gated routing, Composite scoringPurchase intent, priority, the team that gets an inbound lead and a lead scoremessage*, company_size, source
support-routingSupportIntent routing, Confidence-gated routingDepartment, urgency and whether a human is neededmessage*, plan
spam-detectionTrust & safetyIntent routingSpam probability and allow / review / blocktext
agent-routingAI agentsIntent routingThe agent's first tool and whether the task needs an LLMtask*
rag-relevanceRAG—Whether a retrieved chunk answers the query, and whether to retrieve morequery*, chunk*
ticket-triageSupportSpeculative fan-out, Intent routingCategory, bug severity, repro steps, refund and frustration in one callsubject, body*
voice-bankingFinanceConfidence-gated routing, Intent routingA spoken banking command, with more confidence required for risky actionstext
resume-screeningHiringComposite scoringFour skill levels combined into Senior IC and Engineering Manager fitresume*
customer-service-routerSupportIntent routing, Confidence-gated routingThe intent and complexity of a message, to route it to code, an LLM or a persontext

* required field.

Lead qualification

QuestionTypeAnswers
purchase_intentprobabilityReal intent to buy in the next 30 days (yes: asks for pricing, a demo, a quote or a start date)
priorityscorelow, medium, high, critical
routechoicesales, sdr, nurture, spam, other

Composite: lead_score = 2 × purchase_intent + 1 × priority + 1 × p(route = sales), from 0 to 1. Policies: route = spam → block; confidence of purchase_intent below 0.6 → escalate. Guide.

Support routing

QuestionTypeAnswers
departmentchoicebilling, technical, account, sales, other — minimum confidence 0.6
urgencyscorelow, normal, high, urgent
human_requiredprobabilityNeeds a human (yes: angry customer, legal threat, data loss, cancellation)

Policy: human_required ≥ 0.7 → escalate. A department below 60% confidence takes the fallback action. Guide.

Spam detection

QuestionTypeAnswers
spam_probabilityprobabilitySpam, phishing or an unsolicited promotion
actionchoiceallow, review, block, other

Policy: action = block → block. The state is plain text. Guide.

Agent routing

QuestionTypeAnswers
selected_toolchoicesearch, database, calculator, none, other
needs_reasoningprobabilityThe task needs multi-step reasoning from a large language model

Policy: needs_reasoning ≥ 0.8 → fallback. Guide.

RAG relevance

QuestionTypeAnswers
relevantprobabilityThe chunk helps answer the query
relevancescorenone, partial, direct
retrieve_moreprobabilityThe system should retrieve more context before answering

No policies: every answer returns continue. Guide.

Support ticket triage

QuestionTypeAnswers
categorychoicebug_report, billing, feature_request, how_to, other
bug_severityscorecosmetic, minor, major, critical (a structured level with a rubric)
has_reproducible_stepsprobabilityThe ticket includes steps to reproduce the problem
refund_requestedprobabilityThe customer explicitly asks for a refund or credit
frustrationscorecalm, annoyed, frustrated, very angry

Policies: category = bug_report and bug_severity ≥ 4 → escalate; refund_requested ≥ 0.8 → escalate; weighted level of frustration ≥ 3.5 → escalate. Pattern: Speculative fan-out.

Voice banking commands

QuestionTypeAnswers
intentchoicecheck_balance, transfer_money, approve_transfer, block_card, other — minimum confidence 0.6

Policies: intent = approve_transfer and its confidence below 0.9 → escalate; intent = transfer_money and its confidence below 0.8 → escalate. The state is plain text. Pattern: Confidence-gated routing.

Resume screening

QuestionTypeAnswers
python_depthscorenone, basic, working, strong, expert
team_leadershipscorenone, informal, tech lead, manager, manager of managers
system_designscorenone, basic, working, strong, expert
generalistscorenarrow, some, broad, very broad, full stack and ops

Composites: senior_ic (0.4 × python_depth, 0.1 × team_leadership, 0.4 × system_design, 0.1 × generalist) and eng_manager (0.15, 0.4, 0.2, 0.25). Policies: either fit ≥ 0.7 → continue; both below 0.35 → block; otherwise → escalate. Pattern: Composite scoring.

Customer service router

QuestionTypeAnswers
intentchoiceorder_status, billing_question, technical_issue, complaint, other
complexityscoresimple, moderate, complex

Policies: intent = complaint → escalate; intent = technical_issue and weighted level of complexity ≥ 2.5 → escalate; confidence of complexity below 0.5 → escalate. The state is plain text. Pattern: Intent routing.

Blank decision

Blank decision starts with one required message string field and one choice question, intent, with the options buy ("wants to buy or get pricing"), support ("needs help with an existing product") and other.

All templates and the blank decision use the default settings: input and output stored, 5,000 ms timeout, escalate as the fallback action and engine errors returned as errors.

On this page