Your First Wire Workflow
A gentle first-pass tour of Wire source shape without the full language reference.
Your First Wire Workflow
Wire describes a graph of typed node boundaries. Each node says what it consumes, what it produces, and which registered executor or pure body implements it.
The smallest useful mental model is:
contract declarations
node declarations
edges between node ports
A Tiny Workflow
contract Topic;
contract Outline;
contract Result;
node plan
<- topic: Topic;
-> outline: Outline = @workflow.plan (topic);
node run
<- outline: Outline;
-> result: Result = @workflow.execute (outline);
plan
=> run
This source says:
Topic,Outline, andResultare named contracts.planconsumes aTopicand produces anOutline.runconsumes anOutlineand produces aResult.@workflow.planand@workflow.executeare executor references supplied by a registry.plan => runconnects compatible boundaries.
What Wire Does Not Do
Wire does not invent executor implementations. The leading @ is the authority boundary: the name
must be registered by the host or consumer library.
Wire also does not run the workflow directly. It compiles source into a circuit artifact. Pulse runs the materialized circuit.
Compiling From Haskell
The current public surface is the Haskell API:
import Data.Text (Text)
import Cortex.Wire
compileExample :: Text -> Either WireError CompiledCircuit
compileExample =
compileWireTextWithEnv emptyWireCompileEnv
The empty environment is useful for loose examples and early exploration. Most real consumers
construct a strict WireCompileEnv with their contract and executor registries before compiling:
env :: WireCompileEnv
env =
strictWireCompileEnv executorRegistry contractRegistry
The registries are consumer-owned values. A production environment should be strict about the registered alphabet it accepts.
Where To Look Up Syntax
This page is a teaching sketch. Use the reference pages when you need exact rules: