Step nodes transform input facts into output facts.
A Step receives a fact, applies its work function, and produces a new fact with the result. Steps are the primary computation nodes in a workflow.
Meta Expression Support
Steps can reference workflow state through meta expressions like state_of(:component).
When a Step has meta references, the :meta_refs field is populated during
macro compilation, and :meta_ref edges are drawn during Component.connect/3.
During the prepare phase, these edges are traversed to populate meta_context in
the CausalContext, making the referenced state available during execution.
Runtime Context
Steps can also reference external runtime values via context/1 expressions:
step = Runic.step(fn _x -> context(:api_key) end, name: :call_llm)
step = Runic.step(fn x -> x + context(:offset) end, name: :compute)When context/1 is detected, the step's work function is rewritten to arity-2
(input, meta_ctx) and meta_refs are populated with kind: :context entries.
Values are resolved from the workflow's run_context during the prepare phase.
Summary
Functions
Returns whether this step has meta references that need to be resolved during the prepare phase.
Executes the work function of the Lambda step returning the raw unwrapped value.
Runs the step work function with meta context available.
Types
Functions
Returns whether this step has meta references that need to be resolved during the prepare phase.
Executes the work function of the Lambda step returning the raw unwrapped value.
Runs the step work function with meta context available.
When a step has meta references, its work function is arity 2,
receiving (input, meta_context).