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})"}]
:invocations {:default
{:inputs [{:name :name
:type :text
:label "Name"
:default "World"}]}}
:interfaces {:manual [{:id :run :label "Run" :invocation :default :enabled true}]}
: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})]
{:breyta.viewer/kind :markdown
:breyta.viewer/options {:title "Greeting"}
:breyta.viewer/value (str "# Greeting\n\n" (:message 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 Markdown output artifact with a short greeting. The intermediate function
still returns structured data, but the final :flow return value is shaped as a
human-readable viewer artifact.
See Output Artifacts for the full final
output viewer contract.
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:
- input shape
- output contract
:requiresand external steps