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
| Id | Category | Patterns | Decides | State |
|---|---|---|---|---|
lead-qualification | Sales | Intent routing, Confidence-gated routing, Composite scoring | Purchase intent, priority, the team that gets an inbound lead and a lead score | message*, company_size, source |
support-routing | Support | Intent routing, Confidence-gated routing | Department, urgency and whether a human is needed | message*, plan |
spam-detection | Trust & safety | Intent routing | Spam probability and allow / review / block | text |
agent-routing | AI agents | Intent routing | The agent's first tool and whether the task needs an LLM | task* |
rag-relevance | RAG | — | Whether a retrieved chunk answers the query, and whether to retrieve more | query*, chunk* |
ticket-triage | Support | Speculative fan-out, Intent routing | Category, bug severity, repro steps, refund and frustration in one call | subject, body* |
voice-banking | Finance | Confidence-gated routing, Intent routing | A spoken banking command, with more confidence required for risky actions | text |
resume-screening | Hiring | Composite scoring | Four skill levels combined into Senior IC and Engineering Manager fit | resume* |
customer-service-router | Support | Intent routing, Confidence-gated routing | The intent and complexity of a message, to route it to code, an LLM or a person | text |
* required field.
Lead qualification
| Question | Type | Answers |
|---|---|---|
purchase_intent | probability | Real intent to buy in the next 30 days (yes: asks for pricing, a demo, a quote or a start date) |
priority | score | low, medium, high, critical |
route | choice | sales, 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
| Question | Type | Answers |
|---|---|---|
department | choice | billing, technical, account, sales, other — minimum confidence 0.6 |
urgency | score | low, normal, high, urgent |
human_required | probability | Needs 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
| Question | Type | Answers |
|---|---|---|
spam_probability | probability | Spam, phishing or an unsolicited promotion |
action | choice | allow, review, block, other |
Policy: action = block → block. The state is plain text. Guide.
Agent routing
| Question | Type | Answers |
|---|---|---|
selected_tool | choice | search, database, calculator, none, other |
needs_reasoning | probability | The task needs multi-step reasoning from a large language model |
Policy: needs_reasoning ≥ 0.8 → fallback. Guide.
RAG relevance
| Question | Type | Answers |
|---|---|---|
relevant | probability | The chunk helps answer the query |
relevance | score | none, partial, direct |
retrieve_more | probability | The system should retrieve more context before answering |
No policies: every answer returns continue. Guide.
Support ticket triage
| Question | Type | Answers |
|---|---|---|
category | choice | bug_report, billing, feature_request, how_to, other |
bug_severity | score | cosmetic, minor, major, critical (a structured level with a rubric) |
has_reproducible_steps | probability | The ticket includes steps to reproduce the problem |
refund_requested | probability | The customer explicitly asks for a refund or credit |
frustration | score | calm, 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
| Question | Type | Answers |
|---|---|---|
intent | choice | check_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
| Question | Type | Answers |
|---|---|---|
python_depth | score | none, basic, working, strong, expert |
team_leadership | score | none, informal, tech lead, manager, manager of managers |
system_design | score | none, basic, working, strong, expert |
generalist | score | narrow, 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
| Question | Type | Answers |
|---|---|---|
intent | choice | order_status, billing_question, technical_issue, complaint, other |
complexity | score | simple, 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.
Decision settings
engine, storeInput, storeOutput, timeoutMs, fallbackAction and onEngineError — what each runtime setting of a decision does, its default and its limits — plus the workspace settings.
Engines and BYOK
Decisions run on Jev or Laya. Use Dcision's key on TypeSafe, bring your own OpenRouter, TypeSafe or Vercel AI Gateway key, or run Laya on your own server — plus cost, limits and errors.