Topology stays explicit
Define nodes, edges, routes, and state bindings in a serializable Graph instead of an implicit loop.
Build reliable LLM workflows with explicit topology, checkpointed state, and a runtime that keeps every decision inspectable.
Agent workflow problems are not limited to whether a run completes. Control flow must be visible, state access must stay constrained, and failures must leave enough evidence to understand what happened.
Define nodes, edges, routes, and state bindings in a serializable Graph instead of an implicit loop.
Use State Ports and explicit paths to catch invalid access and conflicting writes before execution.
Events, steps, checkpoints, and Artifacts make runtime decisions inspectable after they occur.
Install the module, connect nodes, and choose a Runner. Add checkpoints, approvals, and dynamic routing only where the workflow needs them.
package main
import (
"github.com/dengzii/weaveflow"
"github.com/dengzii/weaveflow/node"
"github.com/dengzii/weaveflow/state"
)
func main() {
workflow := weaveflow.NewGraph()
conversation := state.Scope("agent", "conversation")
input := node.NewUserInputNode(node.WithID("input"))
message := node.NewConversationMessageNode(node.WithID("message"))
message.InputPath = input.ValuePath
message.ConversationPath = conversation
answer := node.NewLLMTurnNode(node.WithID("answer"))
answer.ConversationPath = conversation
answer.OutputPath = state.Shared("final", "answer")
_ = workflow.AddNode(input)
_ = workflow.AddNode(message)
_ = workflow.AddNode(answer)
_ = workflow.AddEdge(input.ID(), message.ID())
_ = workflow.AddEdge(message.ID(), answer.ID())
_ = workflow.AddEdge(answer.ID(), weaveflow.EndNodeRef)
_ = workflow.SetEntryPoint(input.ID())
_, _ = weaveflow.NewRunner(workflow)
}
go get github.com/dengzii/weaveflow
Choose the next node from structured state and an explicit Route Decision.
Bound fan-out and merge recorded patches in a defined order.
Pause at a safe boundary and resume with reviewed input.
Handle classified failures as deliberate Graph paths instead of hidden exceptions.
Associate outputs and evidence with the Run that produced them.
Inspect Runs, Events, Checkpoints, and State in the local Workbench.
Build agent systems with explicit execution paths, inspectable state, and controlled recovery.