Reference

Templates

Breyta templates reference for reusable prompts, HTTP payloads, SQL, and notification channel definitions.

Quick Answer

Define reusable content in top-level :templates, then reference by :template and supply runtime :data.

Supported Template Types

TypePrimary useTypical consumers
:http-requestReusable HTTP request mapsflow/step :http
:llm-promptReusable system/user prompt contentflow/step :llm
:db-queryReusable SQL text and query shapeflow/step :db
:notificationReusable notification channel payloads/configflow/step :wait (:notify), flow/step :notify

Definition Shape

{:templates [{:id :welcome
              :type :llm-prompt
              :system "You are concise."
              :prompt "Welcome {{user.name}}"}
             {:id :approval-email
              :type :notification
              :channels {:http {:connection :sendgrid
                                :path "/v3/mail/send"
                                :method :post
                                :json {:subject "{{title}}"
                                       :content [{:type "text/plain"
                                                  :value "Approve: {{approval-url}}\nReject: {{rejection-url}}"}]}}}}]}

Usage Patterns

LLM prompt template:

(flow/step :llm :welcome-user
  {:connection :ai
   :template :welcome
   :data {:user {:name "Ada"}}})

HTTP request template:

(flow/step :http :create-order
  {:connection :orders-api
   :template :create-order
   :data {:customer-id "cus_123" :amount 4200}})

DB query template:

{:templates [{:id :recent-orders
              :type :db-query
              :sql "select * from orders where created_at >= {{from}}"}]}

Wait notification template:

(flow/step :wait :approval
  {:key "approval:123"
   :timeout "2h"
   :notify {:template :approval-email
            :data {:title "Order Approval"}}})

Size And Reliability Notes

TopicGuidance
Payload limitsCore flow payload cap is 150 KB; template/function content is budgeted separately (up to ~2.1 MB total package).
When to templatePrefer templates over inline params for repeated payloads, large static bodies, and reviewable content.
Notification reuseNotification templates are primarily for wait/checkpoint :notify, and can be reused by flow/step :notify (:http channels).
Large outputsIf step output may exceed inline thresholds, combine templates with :persist.
Data contractKeep variable names stable across template fields and step :data maps.

Related

As of Feb 13, 2026