How flowgent-labs/flowgent works
Flowgent is a distributed AI-agent orchestration engine. A flow is configured through the namespace-scoped API, discovered and dispatched by the controller, scheduled by a per-flow JobManager, and executed by TaskManagers using DAG node executors; durable run/task state and human gates support pause, resume, and replay. Separate branches cover event and cron triggers, sandbox execution, notifications, A2A access, LLM providers, and optional x402 wallet signing. Edges cite README or shown source; unsampled subsystem wiring is omitted or marked unverified.
Main entry points: taskmanager.go TaskManager · controller.go Flow controller · server.go REST API · executor.go DAG node executors
Components 24
Access and configuration
- REST API
pkg/api/pkg/server.go - Authentication
pkg/api/pkg/auth/auth.go - Service configuration
pkg/config/pkg/config/config.go - A2A server
pkg/a2a/pkg/a2a.go
Flow orchestration
- Flow controller
pkg/controller/pkg/controller.go - Pod discovery
pkg/core/pkg/engine/discovery/discovery.go - JobManager
pkg/core/pkg/engine/jobmanager/jobmanager.go - Cron and webhook triggers
pkg/core/pkg/engine/trigger/trigger.go
Execution runtime
- TaskManager
pkg/core/pkg/engine/taskmanager/taskmanager.go - DAG node executors
pkg/core/pkg/engine/executor/executor.go - Sandbox worker
pkg/sandbox/pkg/sandboxmanager.go - LLM providers
pkg/core/pkg/llm/llm.go
State and integrations
- Message transport
pkg/messager/pkg/messager.go - Durable state
pkg/store/pkg/store.go - Notifications
pkg/notifier/pkg/notifier.go - OTEL tracing
pkg/common/pkg/tracing/otel.go
Economic layer
- Wallet manager
pkg/wallet/pkg/walletmanager.go - x402 payment client
pkg/core/pkg/client/x402_httpclient.go
Other components
- API clients
- OIDC provider
- LLM services
- Notification targets
- Kubernetes
- Payment network
Connections 24
- API clients → REST API: submits flows
- API clients → A2A server: uses agent protocol
- REST API → Authentication: authenticates
- OIDC provider → Authentication: provides identity
- Flow controller → REST API: discovers flows
pkg/controller/pkg/controller.go - Flow controller → Pod discovery: selects shard
- Flow controller → JobManager: dispatches per-flow
- JobManager → TaskManager: scales workers
- TaskManager → DAG node executors: executes plans
pkg/core/pkg/engine/taskmanager/taskmanager.go - TaskManager → REST API: resolves runtime resources
pkg/core/pkg/engine/taskmanager/taskmanager.go - TaskManager → Message transport: consumes plans
- DAG node executors → LLM providers: invokes agents
- DAG node executors → Sandbox worker: runs scripts
- Flow controller → Kubernetes: manages deployments
pkg/controller/pkg/controller.go - Cron and webhook triggers → JobManager: starts runs
- REST API → Durable state: persists runs and tasks
- DAG node executors → Notifications: sends notifications
- Notifications → Notification targets: delivers messages
- LLM providers → LLM services: calls providers
- TaskManager → OTEL tracing: records node spans
- x402 payment client → Wallet manager: requests signing
pkg/wallet/pkg/walletmanager.go - Wallet manager → Message transport: publishes signed result
pkg/wallet/pkg/walletmanager.go - x402 payment client → Payment network: pays via x402
- Service configuration → Flow controller: configures runtime