Agentic Workflows in Scala (Without the Buzzwords)
Briefly

Agentic Workflows in Scala (Without the Buzzwords)
"High-level view of the travel search workflow, highlighting parallel searches, explicit decision points, and iterative refinement. In Scala, we define this workflow using Workflows4s, encoding both state and transitions explicitly in the type system. Instead of opaque state blobs or untyped contexts, the state of the process is represented using algebraic data types - types like Started, Found, Sent, and Booked - each corresponding to a distinct point in the workflow's lifecycle."
"Agency doesn't have to live inside an autonomous loop. In contrast to frameworks where control flow happens inside a generative loop hidden in a prompt or internal agent state, here the logic lives in typed transitions you can inspect, test, and evolve. Instead: The workflow owns control flow and state Tools and agents perform specialised tasks The workflow orchestrates these pieces explicitly"
The travel search workflow encodes state and transitions explicitly using algebraic data types such as Started, Found, Sent, and Booked. Progress occurs through explicit signals like FindTrip and BookTrip, with each transition representing a clear orchestration step rather than hidden control flow. The workflow owns control flow and state while tools and agents perform specialized tasks under orchestration. Typed transitions enable inspection, testing, and evolution of logic without relying on opaque prompts or autonomous loops. The approach supports parallelism, allowing concurrent searches for flights and accommodations and natural joining of results for clearer observability and maintainability.
Read at Medium
Unable to calculate read time
[
|
]