Build agent workflows you can inspect, control, and recover

Build reliable LLM workflows with explicit topology, checkpointed state, and a runtime that keeps every decision inspectable.

A running ReAct graph appends user input to a conversation, lets an LLM call tools through a conditional edge, returns tool results to the LLM, and saves a resumable checkpoint.
ReAct-Agent / run_01J8F2 Completed

Explicit by design — inspectable by default

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.

01

Topology stays explicit

Define nodes, edges, routes, and state bindings in a serializable Graph instead of an implicit loop.

02

State has a contract

Use State Ports and explicit paths to catch invalid access and conflicting writes before execution.

03

Every run leaves evidence

Events, steps, checkpoints, and Artifacts make runtime decisions inspectable after they occur.

A focused API for structured workflows

Install the module, connect nodes, and choose a Runner. Add checkpoints, approvals, and dynamic routing only where the workflow needs them.

  • Go-native contracts and Context
  • OpenAI-compatible model adapter
  • Runnable examples that require no model
Browse all examples
main.go
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

Make execution paths explicit—and keep the evidence

01

Dynamic routing

Choose the next node from structured state and an explicit Route Decision.

02

Parallel execution

Bound fan-out and merge recorded patches in a defined order.

03

Human approval

Pause at a safe boundary and resume with reviewed input.

04

Failure routing

Handle classified failures as deliberate Graph paths instead of hidden exceptions.

05

Artifact storage

Associate outputs and evidence with the Run that produced them.

06

Live inspection

Inspect Runs, Events, Checkpoints, and State in the local Workbench.

Keep every workflow understandable

Build agent systems with explicit execution paths, inspectable state, and controlled recovery.

Explore WeaveFlow