Examples

Hello World

Breyta hello world example for validating first flow push and run behavior.

Quick Answer

Use this minimal flow to verify your CLI, environment variables, and end-to-end run path before adding integrations.
Even here, keep shaping logic in top-level :functions, call it via flow/step :function, and label orchestration branches for readable run traces.

Use Case

Smallest possible flow to validate push/run wiring.

Full Definition

{:slug :hello-world
 :name "Hello World"
 :concurrency {:type :singleton :on-new-version :supersede}
 :functions [{:id :build-greeting
              :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 target"
                         :yes "Use provided name"
                         :no "Fallback to World"}
                       (if (:name input)
                         input
                         (assoc input :name "World"))
        output (flow/step :function :build-output
                 {:ref :build-greeting
                  :input greeting-input})]
    output)}

Run It

breyta flows push --file ./tmp/flows/hello-world.clj
breyta flows validate hello-world
breyta flows run hello-world --wait

Optional input:

breyta flows run hello-world --wait --input '{"name":"Ada"}'

Expected Output

A map with :message and your provided input payload.

Why This Matters

This example validates the full authoring and runtime path with minimal noise.

  • no external bindings required
  • deterministic result shape
  • safe baseline for CLI/environment troubleshooting

If this fails, fix environment or CLI workflow before building larger flows.

Customize in this order:

  1. input shape
  2. output contract
  3. :requires and external steps

Try Next

As of Feb 16, 2026