Templates

The nineteen 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. The six use-case templates (input-guardrail to response-grading) also come with destinations — fixed replies and functions your code runs — so each outcome already says what happens next. 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
input-guardrailTrust & safetyIntent routing, Confidence-gated routingWhether a prompt is safe to pass on to your LLM; unsafe ones get a fixed replymessage*, channel
model-routingAI agentsIntent routing, Confidence-gated routingThe cheapest model tier that is enough for a promptprompt*
document-rerankingRAGComposite scoringA 0–1 rerank score for one retrieved document, to sort candidatesquery*, document*
tool-call-gatingAI agentsSpeculative fan-out, Confidence-gated routing, Intent routingWhether an agent runs a tool call, asks the user first or refusesuser_request*, tool*, arguments*
reply-confidence-gateSupportSpeculative fan-out, Confidence-gated routingWhether a drafted reply is sent, reviewed or handed to a personcustomer_message*, draft_reply*
response-gradingSupportSpeculative fan-out, Composite scoringA 0–1 grade of an LLM response against your rubricquestion*, response*, reference
invoice-triageFinanceSpeculative fan-outWhether an invoice (PDF, Excel, image…) is paid, reviewed or rejected, and whether it's due sooninvoice* (file), message
voice-message-routingSupportIntent routingThe team, urgency and sentiment of a customer's voice notevoice* (audio), channel
image-moderationTrust & safetyConfidence-gated routingWhether an uploaded photo is unsafe, spam or unrelated, and whether it matches its captionphoto* (image), caption
llm-output-guardrailTrust & safetySpeculative fan-out, Confidence-gated routingWhether an LLM's or agent's answer is grounded, safe and on policy before it is sentuser_message*, output*, sources

* 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.

Input guardrail

QuestionTypeAnswers
verdictchoicesafe, prompt_injection, harmful, sensitive_data, other — minimum confidence 0.7

Policy: verdict ≠ safe → block; the fallback action is block, so an unsure verdict never passes. Destinations: blocked_reply (fixed reply on block, no model call) and call_llm (function callAssistant when the prompt is safe). The context describes the assistant. Guide.

Model routing

QuestionTypeAnswers
tierchoicefast, balanced, frontier, other — minimum confidence 0.6
complexityscoretrivial, simple, moderate, hard, very hard

No policies; the fallback action is fallback. Destinations: function callModel with model = fast, balanced or frontier per tier, and frontier_when_unsure on fallback. Guide.

Document reranking

QuestionTypeAnswers
relevancescoreunrelated, same topic, no answer, partial answer, direct answer, complete answer
answers_queryprobabilityThe query could be answered from this document alone

Composite: rerank_score = 2 × relevance + 1 × answers_query, from 0 to 1. Policy: rerank_score < 0.2 → block (drop the document). Guide.

Tool-call gating

QuestionTypeAnswers
verdictchoicerun, ask_user, reject, other
riskscoreread-only, low, medium, high
matches_requestprobabilityThe tool call does exactly what the user asked

Policies: verdict = reject → block; verdict = ask_user → escalate; verdict = run and risk ≥ 3 and its confidence below 0.9 → escalate. Destinations: run_tool (function runTool on continue), confirm_with_user (fixed reply with Yes / No buttons on escalate) and rejected_reply (on block). Guide.

Reply confidence gate

QuestionTypeAnswers
ready_to_sendprobabilityThe draft can go out without a human checking it
answers_questionprobabilityThe draft answers what the customer asked
promises_somethingprobabilityThe draft promises a refund, discount, deadline or exception

Policies: ready_to_send < 0.4 → escalate; promises_something ≥ 0.7 and ready_to_send < 0.95 → escalate; confidence of ready_to_send below 0.5 → escalate. Destinations: auto_send (function sendReply at 0.85 or more), review_queue (function queueForReview from 0.4 to 0.85) and hand_to_human (function assignToHuman on escalate). Guide.

Response grading

QuestionTypeAnswers
accuracyscorewrong, mostly wrong, mixed, mostly right, fully right
completenessscoremisses it, partial, most of it, complete
tonescorepoor, acceptable, good, excellent
unsafe_promiseprobabilityThe response promises a refund, price or deadline

Composite: grade = 0.5 × accuracy + 0.3 × completeness + 0.2 × tone, from 0 to 1 (× 10 for a score out of 10). The rubric lives in context. Policies: unsafe_promise ≥ 0.7 → escalate; grade < 0.6 → escalate. Destination: quality_review (function flagForQualityReview on escalate). Guide.

Invoice triage

QuestionTypeAnswers
document_typechoiceinvoice, receipt, contract, other
decisionchoicepay, review, reject, other; minimum confidence 0.7
due_soonprobabilityDue within 3 days, or overdue

invoice is a file field: Dcision reads PDFs, Word, Excel and other documents into text — scanned ones and images through OpenAI. Policies: decision = reject → block; decision = review → escalate; document_type ≠ invoice → escalate; document_type = invoice and due_soon ≥ 0.8 → escalate. Guide.

Voice message routing

QuestionTypeAnswers
intentchoiceorder_status, refund, complaint, sales, other; minimum confidence 0.6
urgentprobabilityThe customer needs an answer today
sentimentscoreangry, unhappy, neutral, happy

voice is an audio field, transcribed before the questions are answered. Policies: urgent ≥ 0.7 → escalate; sentiment = angry → escalate. Guide.

Image moderation

QuestionTypeAnswers
unsafeprobabilityNudity, violence, weapons, drugs or hateful symbols; minimum confidence 0.6
contentchoiceproduct, spam, unrelated, other
matches_captionprobabilityThe photo shows what the caption describes

photo is an image field: OpenAI Decisions sees it; Jev and Laya read a description of it. Policies: unsafe ≥ 0.5 → block; content = spam → block; content = unrelated → escalate; matches_caption < 0.3 → escalate. Guide.

LLM output guardrail

QuestionTypeAnswers
groundedprobabilityEvery factual claim is supported by the sources; minimum confidence 0.5
data_leakprobabilityThe answer reveals someone else's personal data, credentials or internal instructions
policychoicecompliant, promise, advice, off_topic, other
harmfulprobabilityThe answer is harmful, hateful, harassing or unsafe

Runs after your LLM or agent and before its answer is sent. Policies: data_leak ≥ 0.5 → block; harmful ≥ 0.5 → block; grounded < 0.5 → fallback; policy ≠ compliant → escalate. Guide.

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.

The blank decision uses 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