Build

Flow Basics

Breyta flow basics for authoring deterministic workflow automation with :slug, :concurrency, :triggers, and :flow.

Quick Answer

Start with a minimal deterministic flow, confirm it runs, then add one external requirement and one step at a time.
Keep :flow focused on orchestration, label branch nodes with metadata, and use top-level :functions for shaping logic.

Do This Now

Use this minimal structure as your base:

{:slug :hello-world
 :name "Hello World"
 :concurrency {:type :singleton :on-new-version :supersede}
 :functions [{:id :build-response
              :language :clojure
              :code "(fn [input] {:message (str \"Hello, \" (:name input) \"!\") :input input})"}]
 :triggers [{:type :manual :label "Run" :enabled true :config {}}]
 :flow
 '(let [input (flow/input)
        greeting-input ^{:label "Greeting input"
                         :yes "Use provided name"
                         :no "Default to World"}
                       (if (:name input)
                         input
                         (assoc input :name "World"))
        output (flow/step :function :build-output
                 {:ref :build-response
                  :input greeting-input})]
    output)}

What This Does

  • defines a unique flow identity
  • enables manual execution
  • returns deterministic output
  • models orchestration in :flow and shaping in top-level :functions

Field intent:

  • :slug: stable machine id for CLI/API operations
  • :name: human-readable label
  • :concurrency: controls overlap/version handoff behavior
  • :triggers: run entry points. For manual triggers, :label also controls the user-facing run CTA copy in Resource UI.
  • :flow: deterministic orchestration body

When To Use

Use this before adding external systems or advanced step chains.

First Extension Path

After this runs successfully:

  1. add :requires for an external system
  2. add one flow/step consuming that requirement
  3. keep output shape simple and explicit
  4. push -> validate -> configure (if required) -> run before adding more steps

This keeps failures easy to isolate and fix.

Draft Vs Live In Practice

  • Use draft (default) while building: push, validate, configure, then run.
  • push affects draft only (latest working copy), not installed live.
  • Use live when you need to verify what installed consumers run: breyta flows run <slug> --target live --wait.
  • breyta flows release <slug> publishes a release and updates live for the selected workspace by default.

Go Deeper

As of Mar 10, 2026