Documentation
¶
Overview ¶
Package zenflow is a declarative multi-agent workflow engine for Go. A zenflow workflow is a YAML DAG of steps. Each step has an agent (an LLM-backed conversational role), instructions, optional dependencies, and an optional retry/timeout/isolation policy. The engine schedules steps respecting their dependencies, runs them concurrently when safe, and threads inter-step messages through a coordinator. Three execution modes share one engine: - [Orchestrator.RunFlow] runs a fully-declared YAML DAG. - [Orchestrator.RunGoal] asks a coordinator LLM to plan a workflow from a goal string, then runs it. - [Orchestrator.RunAgent] runs a single agent loop with no DAG. The CLI binary at cmd/zenflow is a thin wrapper around the same Orchestrator. Embedders use the library form directly:
import "github.com/zendev-sh/zenflow"
func main {
orch := zenflow.New(zenflow.WithModelResolver(modelResolver)) defer orch.Close wf, err := zenflow.LoadWorkflow("workflow.yaml") if err != nil { panic(err) } res, err := orch.RunFlow(ctx, wf) // ...
}
# Coordinator and messaging A coordinator is itself an AgentRunner running in parallel with the step DAG. It owns four default tools: forward_to_agent (coord -> step's mailbox), send_message (step -> coord upstream), narrate (emit a progress event), and finalize (terminate the run with a summary). Peer agents never address each other directly - every inter-step message flows through the coordinator (hub-and-spoke). # Race-safe delivery Every send goes through the DeliveryEngine (Mailbox + Wake pair). The Mailbox is the per-step inbox; the Wake is a 1-buffered channel that signals "new mail." A drop returns a typed DropReason - there is no silent loss, no out-of-order delivery, and no leaked goroutines. # Resume from transcript A long step can be resumed across process boundaries via the TranscriptStore interface. The executor records the system prompt, model ID, and message history; resume calls [Executor.ResumeStep] to spawn a fresh runner that continues from the last appended turn. # Provider routing zenflow does no LLM I/O itself. All provider work goes through goai (https://goai.sh). Any model goai supports - Google Gemini, AWS Bedrock, Azure (DeepSeek / Anthropic / GPT chat / GPT responses), Vertex, and others - works as a zenflow agent backend. See goai.ProviderRouter and the WithModel option. # Stability Pre-1.0. The exported surface (Orchestrator, RunFlow/RunGoal/RunAgent, the With* options, Workflow / Step / StepResult / WorkflowResult, the MailboxStore / TranscriptStore / Storage / StepIsolation interfaces, and the YAML schema in spec/v1/) is intended to settle at v0.1.0 but may still change. See docs/architecture, docs/concepts, and docs/yaml at zenflow.sh for the full reference. The CLI's own help is `zenflow --help`.
Index ¶
- Constants
- Variables
- func DefaultStorageDir() string
- type AgentConfig
- type AgentError
- type AgentHandle
- type AgentResult
- type AgentRunner
- type AgentRunnerOption
- type AgentStatus
- type ApprovalHandler
- type BoundedInMemoryStore
- type ChanWakeTarget
- type ClosedAware
- type CoordLoopOption
- type CoordOption
- type CoordinatorValidationError
- type CycleError
- type DeliveryEngine
- type DropError
- type DropEvent
- type DropReason
- type DuplicateStepError
- type Duration
- type EngineActiveStepsSource
- type EngineClock
- type EngineOption
- type EngineStepLocker
- type EngineWakeRegistry
- type EngineWakeTarget
- type EvalContext
- type EvalStepContext
- type Event
- type EventType
- type Executor
- type FactoryCache
- type FileStorage
- type ForEachContext
- type HostSpecificEnvError
- type InMemoryMailboxStore
- type InMemoryTranscriptStore
- type InMemoryTranscriptStoreOption
- type IncludeConflictError
- type JSONParseError
- type LenAware
- type Loop
- type LoopValidationError
- type MCPConfig
- type MCPOption
- type MCPServerConfig
- type MCPToolset
- type MailboxStore
- type MapWakeRegistry
- type MemoryStorage
- type MessageKind
- type MessageRouter
- type MetadataSetter
- type MissingAgentError
- type MissingDepError
- type MissingNameError
- type ModelResolver
- type NoStepsError
- type NopIsolation
- type Option
- type Orchestrator
- type Output
- type OutputTransformer
- type PermissionHandler
- type PermissionPolicy
- type PermissionRequest
- type PortabilityWarning
- type ProgressSink
- type RealClock
- type ResumeHandle
- type Resumer
- type RouterMessage
- type RouterMessageType
- type Run
- type RunFlowOption
- type RunGoalOption
- type RunStore
- type SharedMemory
- type SharedMemoryStore
- type Step
- type StepIsolation
- type StepResult
- type StepResultStore
- type StepStatus
- type StepTranscript
- type Storage
- type SubmitResultHandler
- type TokenBudgetTransformer
- type ToolNotFoundError
- type Tracer
- type TranscriptStore
- type TranscriptTruncatedLoader
- type UnicodeUnsafeError
- type ValidationError
- type Workflow
- type WorkflowOptions
- type WorkflowResult
- type WorkflowStatus
Constants ¶
const ( AgentStatusCompleted = exec.AgentStatusCompleted AgentStatusTruncated = exec.AgentStatusTruncated )
AgentStatus enum values re-exported from internal/exec.
const ( MessageKindNotification = types.MessageKindNotification MessageKindContent = types.MessageKindContent )
MessageKind constants re-exported from internal/types.
const ( EventWorkflowStart = types.EventWorkflowStart EventWorkflowEnd = types.EventWorkflowEnd EventStepStart = types.EventStepStart EventStepEnd = types.EventStepEnd EventStepSkipped = types.EventStepSkipped EventAgentTurn = types.EventAgentTurn EventToolCall = types.EventToolCall EventMessage = types.EventMessage EventError = types.EventError EventCoordinatorNarration = types.EventCoordinatorNarration EventCoordinatorMessage = types.EventCoordinatorMessage EventCoordinatorSynthesis = types.EventCoordinatorSynthesis EventCoordinatorInboxMessage = types.EventCoordinatorInboxMessage EventMessageSent = types.EventMessageSent EventPlanReady = types.EventPlanReady EventAgentInboxDrain = types.EventAgentInboxDrain EventMessageDropped = types.EventMessageDropped EventAgentIdle = types.EventAgentIdle EventAgentWake = types.EventAgentWake EventMaxWakeCyclesWarning = types.EventMaxWakeCyclesWarning EventResumeStarted = types.EventResumeStarted EventResumeCompleted = types.EventResumeCompleted EventResumeFailed = types.EventResumeFailed EventResumeQueued = types.EventResumeQueued EventTranscriptSealed = types.EventTranscriptSealed )
EventType constants re-exported from internal/types.
const ( RouterMessageInfo = router.MessageInfo RouterMessageCancel = router.MessageCancel RouterMessageContextUpdate = router.MessageContextUpdate RouterMessageResumeReply = router.MessageResumeReply )
RouterMessageType enum re-exports.
const ( DropReasonUnspecified = router.DropReasonUnspecified DropReasonWorkflowCancelled = router.DropReasonWorkflowCancelled DropReasonTargetTerminal = router.DropReasonTargetTerminal DropReasonUnknownStep = router.DropReasonUnknownStep DropReasonMailboxClosedByFinalize = router.DropReasonMailboxClosedByFinalize DropReasonMaxWakeCycles = router.DropReasonMaxWakeCycles DropReasonHoldTimeout = router.DropReasonHoldTimeout DropReasonMailboxFull = router.DropReasonMailboxFull DropReasonNoTranscript = router.DropReasonNoTranscript DropReasonTranscriptTooLarge = router.DropReasonTranscriptTooLarge DropReasonResumeShutdown = router.DropReasonResumeShutdown DropReasonResolverError = router.DropReasonResolverError )
DropReason enum re-exports.
const ( LoopOutputModeLast = spec.LoopOutputModeLast LoopOutputModeCumulative = spec.LoopOutputModeCumulative )
LoopOutputMode constants re-exported from internal/spec.
const ( FailureCascade = spec.FailureCascade FailureSkipDependents = spec.FailureSkipDependents FailureAbort = spec.FailureAbort )
FailureStrategy values re-exported from internal/spec.
const ( SchedulerDependencyFirst = spec.SchedulerDependencyFirst SchedulerRoundRobin = spec.SchedulerRoundRobin SchedulerLeastBusy = spec.SchedulerLeastBusy )
SchedulerStrategy values re-exported from internal/spec.
const ( StatusRunning = spec.StatusRunning StatusCompleted = spec.StatusCompleted StatusFailed = spec.StatusFailed StatusPartial = spec.StatusPartial )
WorkflowStatus values re-exported from internal/spec.
const ( StepCompleted = spec.StepCompleted StepFailed = spec.StepFailed StepSkipped = spec.StepSkipped StepCancelled = spec.StepCancelled )
StepStatus values re-exported from internal/spec.
const CoordRouterInboxID = exec.CoordRouterInboxID
CoordRouterInboxID is re-exported from internal/exec.
const DefaultAgentHandleTTL = exec.DefaultAgentHandleTTL
DefaultAgentHandleTTL is re-exported from internal/exec.
const DefaultCoordCleanupTimeout = exec.DefaultCoordCleanupTimeout
DefaultCoordCleanupTimeout is re-exported from internal/exec. It bounds the cleanup phase of RunCoordinatorLoop's returned func.
const DefaultCoordColdStartPrompt = exec.DefaultCoordColdStartPrompt
DefaultCoordColdStartPrompt is re-exported from internal/exec.
const DefaultCoordContinuationPrompt = exec.DefaultCoordContinuationPrompt
DefaultCoordContinuationPrompt is re-exported from internal/exec.
const DefaultCoordSystemPrompt = exec.DefaultCoordSystemPrompt
DefaultCoordSystemPrompt is re-exported from internal/exec.
const DefaultMaxBytesPerDep = exec.DefaultMaxBytesPerDep
DefaultMaxBytesPerDep is re-exported from internal/exec. It is the per-dependency byte cap applied by the orchestrator's default OutputTransform when WithOutputTransform is not provided.
const DefaultMaxMailboxSize = exec.DefaultMaxMailboxSize
DefaultMaxMailboxSize is re-exported from internal/exec. It is the per-step mailbox cap installed by New when WithMaxMailboxSize is not provided. Pass WithMaxMailboxSize(0) to opt out of the cap.
const DefaultMaxTranscriptBytes = resume.DefaultMaxTranscriptBytes
DefaultMaxTranscriptBytes re-exports resume.DefaultMaxTranscriptBytes so external consumers (and the WithMaxTranscriptBytes docstring) can reference the canonical default per-step byte cap applied to the Day-1 InMemoryTranscriptStore. Stable.
const DefaultMaxTranscriptMessages = resume.DefaultMaxTranscriptMessages
DefaultMaxTranscriptMessages re-exports resume.DefaultMaxTranscriptMessages so external consumers (and the WithMaxTranscriptMessages docstring) can reference the canonical default per-step message-count cap applied to the Day-1 InMemoryTranscriptStore. Stable.
const DefaultTruncatedResumeMessages = resume.DefaultTruncatedResumeMessages
DefaultTruncatedResumeMessages re-exports resume.DefaultTruncatedResumeMessages so external consumers can read or mirror the executor's tail bound for LoadTruncated when no explicit cap is supplied. Stable.
const MetadataKeyResumeReverse = router.MetadataKeyResumeReverse
MetadataKeyResumeReverse is re-exported from internal/router.
Variables ¶
var ( WithRunnerModel = exec.WithRunnerModel WithRunnerTools = exec.WithRunnerTools WithRunnerPermissions = exec.WithRunnerPermissions WithRunnerProgress = exec.WithRunnerProgress WithRunnerGoAIOptions = exec.WithRunnerGoAIOptions WithRunnerStreaming = exec.WithRunnerStreaming WithRunnerVerbose = exec.WithRunnerVerbose WithRunnerRunID = exec.WithRunnerRunID WithRunnerStepID = exec.WithRunnerStepID WithRunnerSystemPrompt = exec.WithRunnerSystemPrompt WithRunnerModelID = exec.WithRunnerModelID WithRunnerStateRef = exec.WithRunnerStateRef WithRunnerMailbox = exec.WithRunnerMailbox WithRunnerWake = exec.WithRunnerWake WithRunnerRouter = exec.WithRunnerRouter WithRunnerSpawnDepth = exec.WithRunnerSpawnDepth WithRunnerSpawnParentCallID = exec.WithRunnerSpawnParentCallID WithRunnerMaxWakeCycles = exec.WithRunnerMaxWakeCycles WithRunnerTranscript = exec.WithRunnerTranscript WithRunnerInitialMessages = exec.WithRunnerInitialMessages WithRunnerPreStartDrainGate = exec.WithRunnerPreStartDrainGate WithRunnerWakeContextProvider = exec.WithRunnerWakeContextProvider )
WithRunner* options re-exported from internal/exec.
var ( ErrAgentHandleTimeout = exec.ErrAgentHandleTimeout ErrAgentCancelled = exec.ErrAgentCancelled ErrAgentPanicked = exec.ErrAgentPanicked ErrAgentTurnLimitExceeded = exec.ErrAgentTurnLimitExceeded ErrAgentNoSubmitResult = exec.ErrAgentNoSubmitResult ErrInvalidAgentHandleID = exec.ErrInvalidAgentHandleID ErrAgentToolDirectInvocation = exec.ErrAgentToolDirectInvocation )
AgentError sentinels re-exported from internal/exec.
var ( ErrForwardTargetRequired = coord.ErrForwardTargetRequired ErrSendMessageEmpty = coord.ErrSendMessageEmpty ErrNarrateEmpty = coord.ErrNarrateEmpty )
Coord tool argument-validation sentinels re-exported from internal/coord. Consumers can match against these via errors.Is to distinguish missing-argument failures from other tool errors.
var ( // LoadMCPConfig reads and parses an MCP settings file. LoadMCPConfig = exec.LoadMCPConfig // ConnectMCPConfig connects to every server in a config and aggregates tools. ConnectMCPConfig = exec.ConnectMCPConfig // WithMCPClientInfo sets the advertised client name/version. WithMCPClientInfo = exec.WithMCPClientInfo // WithMCPRequestTimeout bounds each MCP request. WithMCPRequestTimeout = exec.WithMCPRequestTimeout // WithMCPStderr routes stdio subprocess stderr. WithMCPStderr = exec.WithMCPStderr )
MCP functions + options re-exported from internal/exec.
var ( WithModel = exec.WithModel WithTools = exec.WithTools WithAdditionalTools = exec.WithAdditionalTools WithGoAIOptions = exec.WithGoAIOptions WithStorage = exec.WithStorage WithPermissions = exec.WithPermissions WithProgress = exec.WithProgress WithDefaultModel = exec.WithDefaultModel WithForceModel = exec.WithForceModel WithMaxConcurrency = exec.WithMaxConcurrency WithMaxTurns = exec.WithMaxTurns WithMaxDepth = exec.WithMaxDepth WithApproval = exec.WithApproval WithApprovalTimeout = exec.WithApprovalTimeout WithTracer = exec.WithTracer WithCoordinator = exec.WithCoordinator WithIsolation = exec.WithIsolation WithOutputTransform = exec.WithOutputTransform WithStreaming = exec.WithStreaming WithoutStreaming = exec.WithoutStreaming WithVerbose = exec.WithVerbose WithoutVerbose = exec.WithoutVerbose WithMaxWakeCycles = exec.WithMaxWakeCycles WithHoldTimeout = exec.WithHoldTimeout WithAgentHandleTTL = exec.WithAgentHandleTTL WithDropCallback = exec.WithDropCallback WithDropCallbackBufferSize = exec.WithDropCallbackBufferSize WithMaxMailboxSize = exec.WithMaxMailboxSize WithMailboxStore = exec.WithMailboxStore WithMailboxDelivery = exec.WithMailboxDelivery WithoutMailboxDelivery = exec.WithoutMailboxDelivery WithProgressBufferSize = exec.WithProgressBufferSize WithTranscriptStore = exec.WithTranscriptStore WithMaxTranscriptMessages = exec.WithMaxTranscriptMessages WithMaxTranscriptBytes = exec.WithMaxTranscriptBytes WithExternalInbox = exec.WithExternalInbox WithModelResolver = exec.WithModelResolver WithTruncationOnCapReached = exec.WithTruncationOnCapReached WithoutTruncationOnCapReached = exec.WithoutTruncationOnCapReached WithRouterObserver = exec.WithRouterObserver WithRunID = exec.WithRunID WithFlowContext = exec.WithFlowContext WithGoalContext = exec.WithGoalContext )
All Orchestrator With* options re-exported from internal/exec.
var ( ErrApprovalTimeout = exec.ErrApprovalTimeout ErrModelRequired = exec.ErrModelRequired ErrStorageRequired = exec.ErrStorageRequired ErrNilAgentHandle = exec.ErrNilAgentHandle ErrNilOrchestrator = exec.ErrNilOrchestrator ErrResumeNoModel = exec.ErrResumeNoModel ErrWorkflowNil = exec.ErrWorkflowNil ErrPlanDenied = exec.ErrPlanDenied ErrRunnerNil = exec.ErrRunnerNil ErrEmptyGoal = exec.ErrEmptyGoal ErrRunNotFound = exec.ErrRunNotFound ErrStepNotFound = exec.ErrStepNotFound ErrIncludePathEscape = exec.ErrIncludePathEscape ErrIncludeDepthExceeded = exec.ErrIncludeDepthExceeded ErrRefPathEscape = exec.ErrRefPathEscape )
var ( ErrResumeShutdown = router.ErrResumeShutdown ErrModelResolverMissing = router.ErrModelResolverMissing ErrModelResolverError = router.ErrModelResolverError ErrMailboxFullOnResume = router.ErrMailboxFullOnResume )
Router error sentinels re-exported.
var ( // ErrNoTranscript re-exports resume.ErrNoTranscript. // Stable. ErrNoTranscript = resume.ErrNoTranscript // ErrTranscriptTooLarge re-exports resume.ErrTranscriptTooLarge. // Stable. ErrTranscriptTooLarge = resume.ErrTranscriptTooLarge )
Sentinel errors re-exported from resume.
var AgentToolDef = exec.AgentToolDef
AgentToolDef is re-exported from internal/exec.
var ApplyDefaults = exec.ApplyDefaults
ApplyDefaults is re-exported from internal/exec.
var AssemblePrompt = exec.AssemblePrompt
AssemblePrompt is re-exported from internal/exec. Builds the user prompt from agent + step + baseDir + prior step results. Useful for SDK consumers that want to dry-run or inspect the assembled prompt without invoking the executor.
var AssemblePromptWithForEach = exec.AssemblePromptWithForEach
AssemblePromptWithForEach is re-exported from internal/exec. Same as AssemblePrompt but accepts an optional *ForEachContext for forEach loop iterations.
var BuildCoordStepMenu = exec.BuildCoordStepMenu
BuildCoordStepMenu is re-exported from internal/exec.
var BuildEvalContext = exec.BuildEvalContext
BuildEvalContext is re-exported from internal/exec.
var BuildToolCatalog = exec.BuildToolCatalog
BuildToolCatalog is re-exported from internal/exec.
var CoordinatorChat = exec.CoordinatorChat
CoordinatorChat is re-exported from internal/exec.
var CoordinatorPrompt = exec.CoordinatorPrompt
CoordinatorPrompt is re-exported from internal/exec.
var CoordinatorStreamChat = exec.CoordinatorStreamChat
CoordinatorStreamChat is re-exported from internal/exec.
var DecidePermission = exec.DecidePermission
DecidePermission is re-exported from internal/exec. Applies a static PermissionPolicy plus the caller-owned alwaysAllow map and returns (allowed, prompt, err): see exec.DecidePermission docs.
var DetectMixedScript = exec.DetectMixedScript
DetectMixedScript is re-exported from internal/exec.
var DropReasonStrings = router.DropReasonStrings
DropReasonStrings is re-exported from internal/router.
var ErrMailboxFull = router.ErrMailboxFull
ErrMailboxFull is re-exported from internal/router.
var ErrNilFactoryInner = exec.ErrNilFactoryInner
ErrNilFactoryInner is re-exported from internal/exec.
var ErrOrchestratorClosed = exec.ErrOrchestratorClosed
ErrOrchestratorClosed is re-exported from internal/exec.
var ErrToolDenied = exec.ErrToolDenied
ErrToolDenied is re-exported from internal/exec. Wrapped by DecidePermission when a tool matches the policy's Deny list.
var ErrToolNotAllowed = exec.ErrToolNotAllowed
ErrToolNotAllowed is re-exported from internal/exec. Wrapped by DecidePermission when a strict-mode policy rejects a tool not on the Allow list.
var EvaluateCEL = exec.EvaluateCEL
EvaluateCEL is re-exported from internal/exec.
var EvaluateCELToArray = exec.EvaluateCELToArray
EvaluateCELToArray is re-exported from internal/exec.
var FilterTools = exec.FilterTools
FilterTools is re-exported from internal/exec.
var FinalizeToolDef = coord.FinalizeToolDef
FinalizeToolDef is re-exported from internal/coord.
var FormatDuration = spec.FormatDuration
FormatDuration is re-exported from internal/spec.
var ForwardToAgentToolDef = coord.ForwardToAgentToolDef
ForwardToAgentToolDef is re-exported from internal/coord.
var LintPortability = exec.LintPortability
LintPortability is re-exported from internal/exec.
var LoadWorkflow = exec.LoadWorkflow
LoadWorkflow is re-exported from internal/exec.
var MailboxLen = router.MailboxLen
MailboxLen is re-exported from internal/router.
var MessageIDs = router.MessageIDs
MessageIDs is re-exported from internal/router.
var NarrateToolDef = coord.NarrateToolDef
NarrateToolDef is re-exported from internal/coord.
var New = exec.New
New is re-exported from internal/exec.
var NewAgentHandle = exec.NewAgentHandle
NewAgentHandle is re-exported from internal/exec.
var NewAgentRunner = exec.NewAgentRunner
NewAgentRunner is re-exported from internal/exec.
var NewBoundedInMemoryStore = router.NewBoundedInMemoryStore
NewBoundedInMemoryStore is re-exported from internal/router.
var NewChanWakeTarget = router.NewChanWakeTarget
NewChanWakeTarget is re-exported from internal/router.
var NewDefaultCoordRunner = exec.NewDefaultCoordRunner
NewDefaultCoordRunner is re-exported from internal/exec.
var NewDeliveryEngine = router.NewDeliveryEngine
NewDeliveryEngine is re-exported from internal/router.
var NewFactoryCache = exec.NewFactoryCache
NewFactoryCache is re-exported from internal/exec.
var NewFileStorage = exec.NewFileStorage
NewFileStorage is re-exported from internal/exec.
var NewInMemoryMailboxStore = router.NewInMemoryMailboxStore
NewInMemoryMailboxStore is re-exported from internal/router.
var NewInMemoryTranscriptStore = resume.NewInMemoryTranscriptStore
NewInMemoryTranscriptStore re-exports resume.NewInMemoryTranscriptStore. Stable.
var NewInMemoryTranscriptStoreWithCaps = resume.NewInMemoryTranscriptStoreWithCaps
NewInMemoryTranscriptStoreWithCaps re-exports resume.NewInMemoryTranscriptStoreWithCaps. Stable.
var NewInMemoryTranscriptStoreWithOptions = resume.NewInMemoryTranscriptStoreWithOptions
NewInMemoryTranscriptStoreWithOptions re-exports resume.NewInMemoryTranscriptStoreWithOptions. Stable.
var NewMemoryStorage = exec.NewMemoryStorage
NewMemoryStorage is re-exported from internal/exec.
var NewMessageRouter = router.NewRouter
NewMessageRouter is re-exported from internal/router.
NewSharedMemory is re-exported from internal/exec.
NewSharedMemoryTools is re-exported from internal/exec.
var NewSubmitResultHandler = exec.NewSubmitResultHandler
NewSubmitResultHandler is re-exported from internal/exec.
var NewWakeRegistry = router.NewWakeRegistry
NewWakeRegistry is re-exported from internal/router.
var ParseCoordinatorResponse = exec.ParseCoordinatorResponse
ParseCoordinatorResponse is re-exported from internal/exec.
var ParseDurationStrict = spec.ParseDurationStrict
ParseDurationStrict is re-exported from internal/spec.
var ParseWorkflow = exec.ParseWorkflow
ParseWorkflow is re-exported from internal/exec.
var ParseWorkflowJSON = exec.ParseWorkflowJSON
ParseWorkflowJSON is re-exported from internal/exec.
var RunCoordinatorLoop = exec.RunCoordinatorLoop
RunCoordinatorLoop is re-exported from internal/exec.
var SandboxDefaultAllow = exec.SandboxDefaultAllow
SandboxDefaultAllow is re-exported from internal/exec - the canonical safe-tool allow-list applied by --sandbox (read, write, grep, glob). bash is intentionally absent. Returns a fresh slice on each call so callers cannot mutate the canonical list.
var SanitizeUnicode = exec.SanitizeUnicode
SanitizeUnicode is re-exported from internal/exec.
var SanitizeWorkflowUnicode = exec.SanitizeWorkflowUnicode
SanitizeWorkflowUnicode is re-exported from internal/exec.
var SendMessageToolDef = coord.SendMessageToolDef
SendMessageToolDef is re-exported from internal/coord.
var SetRunAgentAsyncRunnerForTest = exec.SetRunAgentAsyncRunnerForTest
SetRunAgentAsyncRunnerForTest is re-exported from internal/exec.
var SubmitResultToolDef = exec.SubmitResultToolDef
SubmitResultToolDef is re-exported from internal/exec.
var SynthesizeOnly = exec.SynthesizeOnly
SynthesizeOnly is re-exported from internal/exec.
var TopoSort = exec.TopoSort
TopoSort is re-exported from internal/exec.
var ValidateToolNames = exec.ValidateToolNames
ValidateToolNames is re-exported from internal/exec.
var ValidateWorkflow = exec.ValidateWorkflow
ValidateWorkflow is re-exported from internal/exec.
var WaitForCoordWake = exec.WaitForCoordWake
WaitForCoordWake is re-exported from internal/exec.
var WithCleanupTimeout = exec.WithCleanupTimeout
WithCleanupTimeout is re-exported from internal/exec.
var WithCoordContextProvider = exec.WithCoordContextProvider
WithCoordContextProvider is re-exported from internal/exec.
var WithCoordMaxWakeCycles = exec.WithCoordMaxWakeCycles
WithCoordMaxWakeCycles is re-exported from internal/exec.
var WithCoordSystemPrompt = exec.WithCoordSystemPrompt
WithCoordSystemPrompt is re-exported from internal/exec.
var WithCoordSystemPromptSuffix = exec.WithCoordSystemPromptSuffix
WithCoordSystemPromptSuffix is re-exported from internal/exec.
var WithCoordTools = exec.WithCoordTools
WithCoordTools is re-exported from internal/exec.
var WithEngineClock = router.WithEngineClock
WithEngineClock is re-exported from internal/router.
var WithEngineTickInterval = router.WithEngineTickInterval
WithEngineTickInterval is re-exported from internal/router.
var WithStepLocker = router.WithStepLocker
WithStepLocker is re-exported from internal/router.
var WithTranscriptCaps = resume.WithTranscriptCaps
WithTranscriptCaps re-exports resume.WithTranscriptCaps. Stable.
Functions ¶
func DefaultStorageDir ¶
func DefaultStorageDir() string
DefaultStorageDir returns the default directory for FileStorage: $HOME/.zenflow/runs. When os.UserHomeDir fails (no HOME, etc.) it falls back to <os.TempDir>/zenflow/runs so the path is always usable. CLI consumers and embedders that want the standard zenflow storage location should call this and pass the result to NewFileStorage:
storage := zenflow.NewFileStorage(zenflow.DefaultStorageDir) orch := zenflow.New(zenflow.WithStorage(storage))
Stable.
Types ¶
type AgentConfig ¶
type AgentConfig = spec.AgentConfig
AgentConfig is re-exported from internal/spec.
type AgentHandle ¶
type AgentHandle = exec.AgentHandle
AgentHandle + lifecycle re-exports from internal/exec.
type AgentResult ¶
type AgentResult = exec.AgentResult
AgentResult is re-exported from internal/exec.
type AgentRunner ¶
type AgentRunner = exec.AgentRunner
AgentRunner is re-exported from internal/exec.
type AgentRunnerOption ¶
type AgentRunnerOption = exec.RunnerOption
AgentRunnerOption is re-exported from internal/exec. The canonical internal name is exec.RunnerOption (C14 stutter rename). The public facade keeps the AgentRunnerOption name so external SDK consumers don't see a breaking rename. exec keeps AgentRunnerOption as an alias of RunnerOption, so either form resolves to the same underlying type here.
type AgentStatus ¶
type AgentStatus = exec.AgentStatus
AgentStatus is re-exported from internal/exec.
type ApprovalHandler ¶
type ApprovalHandler = spec.ApprovalHandler
ApprovalHandler is re-exported from internal/spec.
type BoundedInMemoryStore ¶
type BoundedInMemoryStore = router.BoundedInMemoryStore
BoundedInMemoryStore is re-exported from internal/router.
type ChanWakeTarget ¶
type ChanWakeTarget = router.ChanWakeTarget
ChanWakeTarget is re-exported from internal/router.
type ClosedAware ¶
type ClosedAware = router.ClosedAware
ClosedAware is re-exported from internal/router.
type CoordLoopOption ¶
type CoordLoopOption = exec.CoordLoopOption
CoordLoopOption is re-exported from internal/exec.
type CoordOption ¶
type CoordOption = exec.CoordOption
CoordOption is re-exported from internal/exec.
type CoordinatorValidationError ¶
type CoordinatorValidationError = exec.CoordinatorValidationError
CoordinatorValidationError is re-exported from internal/exec.
type DeliveryEngine ¶
type DeliveryEngine = router.DeliveryEngine
DeliveryEngine is re-exported from internal/router.
type DropReason ¶
type DropReason = router.DropReason
DropReason is re-exported from internal/router.
type DuplicateStepError ¶
type DuplicateStepError = exec.DuplicateStepError
DuplicateStepError is re-exported from internal/exec.
type EngineActiveStepsSource ¶
type EngineActiveStepsSource = router.EngineActiveStepsSource
EngineActiveStepsSource is re-exported from internal/router.
type EngineClock ¶
type EngineClock = router.EngineClock
EngineClock is re-exported from internal/router.
type EngineOption ¶
type EngineOption = router.EngineOption
EngineOption is re-exported from internal/router.
type EngineStepLocker ¶
type EngineStepLocker = router.EngineStepLocker
EngineStepLocker is re-exported from internal/router. Renamed from the previously unexported `engineStepLocker` in zenflow root when the messaging substrate was extracted to internal/router (so out-of-package callers can satisfy it).
type EngineWakeRegistry ¶
type EngineWakeRegistry = router.EngineWakeRegistry
EngineWakeRegistry is re-exported from internal/router.
type EngineWakeTarget ¶
type EngineWakeTarget = router.EngineWakeTarget
EngineWakeTarget is re-exported from internal/router.
type EvalContext ¶
type EvalContext = exec.EvalContext
EvalContext is re-exported from internal/exec.
type EvalStepContext ¶
type EvalStepContext = exec.EvalStepContext
EvalStepContext is re-exported from internal/exec.
type FactoryCache ¶
type FactoryCache = exec.FactoryCache
FactoryCache is re-exported from internal/exec.
type FileStorage ¶
type FileStorage = exec.FileStorage
FileStorage is re-exported from internal/exec.
type ForEachContext ¶
type ForEachContext = exec.ForEachContext
ForEachContext is re-exported from internal/exec.
type HostSpecificEnvError ¶
type HostSpecificEnvError = exec.HostSpecificEnvError
HostSpecificEnvError is re-exported from internal/exec.
type InMemoryMailboxStore ¶
type InMemoryMailboxStore = router.InMemoryMailboxStore
InMemoryMailboxStore is re-exported from internal/router.
type InMemoryTranscriptStore ¶
type InMemoryTranscriptStore = resume.InMemoryTranscriptStore
InMemoryTranscriptStore re-exports resume.InMemoryTranscriptStore. Stable.
type InMemoryTranscriptStoreOption ¶
type InMemoryTranscriptStoreOption = resume.InMemoryTranscriptStoreOption
InMemoryTranscriptStoreOption re-exports resume.InMemoryTranscriptStoreOption. Stable.
type IncludeConflictError ¶
type IncludeConflictError = exec.IncludeConflictError
IncludeConflictError is re-exported from internal/exec.
type JSONParseError ¶
type JSONParseError = exec.JSONParseError
JSONParseError is re-exported from internal/exec.
type LoopValidationError ¶
type LoopValidationError = exec.LoopValidationError
LoopValidationError is re-exported from internal/exec.
type MCPServerConfig ¶ added in v0.2.0
type MCPServerConfig = exec.MCPServerConfig
MCPServerConfig describes one MCP server (stdio or remote).
type MCPToolset ¶ added in v0.2.0
type MCPToolset = exec.MCPToolset
MCPToolset owns live MCP clients and exposes their tools.
type MailboxStore ¶
type MailboxStore = router.MailboxStore
MailboxStore is re-exported from internal/router.
type MapWakeRegistry ¶
type MapWakeRegistry = router.MapWakeRegistry
MapWakeRegistry is re-exported from internal/router.
type MemoryStorage ¶
type MemoryStorage = exec.MemoryStorage
MemoryStorage is re-exported from internal/exec.
type MessageKind ¶
type MessageKind = types.MessageKind
MessageKind is re-exported from internal/types.
type MessageRouter ¶
MessageRouter is re-exported from internal/router.
type MetadataSetter ¶
type MetadataSetter = resume.MetadataSetter
MetadataSetter re-exports resume.MetadataSetter. Stable.
type MissingAgentError ¶
type MissingAgentError = exec.MissingAgentError
MissingAgentError is re-exported from internal/exec.
type MissingDepError ¶
type MissingDepError = exec.MissingDepError
MissingDepError is re-exported from internal/exec.
type MissingNameError ¶
type MissingNameError = exec.MissingNameError
MissingNameError is re-exported from internal/exec.
type ModelResolver ¶
type ModelResolver = spec.ModelResolver
ModelResolver is re-exported from internal/spec (the canonical definition); internal/exec.ModelResolver is itself a type alias to spec.ModelResolver, so callers can mix the two interchangeably.
type NoStepsError ¶
type NoStepsError = exec.NoStepsError
NoStepsError is re-exported from internal/exec.
type NopIsolation ¶
type NopIsolation = exec.NopIsolation
NopIsolation is re-exported from internal/exec.
type Orchestrator ¶
type Orchestrator = exec.Orchestrator
Orchestrator is re-exported from internal/exec.
type OutputTransformer ¶
type OutputTransformer = spec.OutputTransformer
OutputTransformer is re-exported from internal/spec.
type PermissionHandler ¶
type PermissionHandler = types.PermissionHandler
PermissionHandler is re-exported from internal/types.
type PermissionPolicy ¶
type PermissionPolicy = exec.PermissionPolicy
PermissionPolicy is re-exported from internal/exec.
type PermissionRequest ¶
type PermissionRequest = types.PermissionRequest
PermissionRequest is re-exported from internal/types.
type PortabilityWarning ¶
type PortabilityWarning = exec.PortabilityWarning
PortabilityWarning is re-exported from internal/exec.
type ProgressSink ¶
type ProgressSink = types.ProgressSink
ProgressSink is re-exported from internal/types.
type ResumeHandle ¶
type ResumeHandle = router.ResumeHandle
ResumeHandle is re-exported from internal/router.
type RouterMessage ¶
RouterMessage is re-exported from internal/router.
type RouterMessageType ¶
type RouterMessageType = router.MessageType
RouterMessageType is re-exported from internal/router.
type RunFlowOption ¶
type RunFlowOption = exec.RunFlowOption
RunFlowOption is re-exported from internal/exec.
type RunGoalOption ¶
type RunGoalOption = exec.RunGoalOption
RunGoalOption is re-exported from internal/exec.
type RunStore ¶
RunStore is re-exported from internal/spec. Narrow role: persist/load workflow Run records only.
type SharedMemory ¶
type SharedMemory = exec.SharedMemory
SharedMemory is re-exported from internal/exec.
type SharedMemoryStore ¶
type SharedMemoryStore = spec.SharedMemoryStore
SharedMemoryStore is re-exported from internal/spec. Narrow role: persist/load the per-run shared key/value memory only.
type StepIsolation ¶
type StepIsolation = spec.StepIsolation
StepIsolation is re-exported from internal/spec.
type StepResultStore ¶
type StepResultStore = spec.StepResultStore
StepResultStore is re-exported from internal/spec. Narrow role: persist/load per-step results only.
type StepTranscript ¶
type StepTranscript = resume.StepTranscript
StepTranscript re-exports resume.StepTranscript. Stable.
type SubmitResultHandler ¶
type SubmitResultHandler = exec.SubmitResultHandler
SubmitResultHandler is re-exported from internal/exec.
type TokenBudgetTransformer ¶
type TokenBudgetTransformer = exec.TokenBudgetTransformer
TokenBudgetTransformer is re-exported from internal/exec.
type ToolNotFoundError ¶
type ToolNotFoundError = exec.ToolNotFoundError
ToolNotFoundError is re-exported from internal/exec.
type TranscriptStore ¶
type TranscriptStore = resume.TranscriptStore
TranscriptStore re-exports resume.TranscriptStore so existing consumers can keep importing it from the zenflow root package. Stable.
type TranscriptTruncatedLoader ¶
type TranscriptTruncatedLoader = resume.TranscriptTruncatedLoader
TranscriptTruncatedLoader re-exports resume.TranscriptTruncatedLoader. Stable.
type UnicodeUnsafeError ¶
type UnicodeUnsafeError = exec.UnicodeUnsafeError
UnicodeUnsafeError is re-exported from internal/exec.
type ValidationError ¶
type ValidationError = exec.ValidationError
ValidationError is re-exported from internal/exec.
type WorkflowOptions ¶
type WorkflowOptions = spec.WorkflowOptions
WorkflowOptions is re-exported from internal/spec.
type WorkflowResult ¶
type WorkflowResult = spec.WorkflowResult
WorkflowResult is re-exported from internal/spec.
type WorkflowStatus ¶
type WorkflowStatus = spec.WorkflowStatus
WorkflowStatus is re-exported from internal/spec.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
zenflow
command
Command zenflow runs multi-agent workflows from YAML definitions.
|
Command zenflow runs multi-agent workflows from YAML definitions. |
|
zenflow/dag
Package dag renders a Unicode box-drawing diagram of a zenflow workflow DAG.
|
Package dag renders a Unicode box-drawing diagram of a zenflow workflow DAG. |
|
zenflow/tool
Cross-platform helpers for (Windows support).
|
Cross-platform helpers for (Windows support). |
|
internal
|
|
|
coord
Package coord houses the workflow coordinator surface: the small behavioural contract a coord-side AgentRunner must implement (RunnerHandle), the four goai.Tool factories the coord LLM uses to drive a workflow (forward_to_agent / send_message / narrate / finalize), and the factory + default system prompt that wire those tools onto a pre-configured *AgentRunner.
|
Package coord houses the workflow coordinator surface: the small behavioural contract a coord-side AgentRunner must implement (RunnerHandle), the four goai.Tool factories the coord LLM uses to drive a workflow (forward_to_agent / send_message / narrate / finalize), and the factory + default system prompt that wire those tools onto a pre-configured *AgentRunner. |
|
exec
Package exec is the zenflow execution core.
|
Package exec is the zenflow execution core. |
|
resume
Package resume holds the persistence contract and default implementation for resumable step transcripts.
|
Package resume holds the persistence contract and default implementation for resumable step transcripts. |
|
spec
Package spec holds the workflow specification types - the schema-shaped data the YAML parser, validator, and executor share.
|
Package spec holds the workflow specification types - the schema-shaped data the YAML parser, validator, and executor share. |
|
types
Package types holds the small, dependency-free contract surface of zenflow that can be shared across all internal packages without triggering an import cycle.
|
Package types holds the small, dependency-free contract surface of zenflow that can be shared across all internal packages without triggering an import cycle. |
|
observability
|
|
|
otel
module
|
|