Files
agents/control-plane/migrations/011_create_workflow_runs_and_steps.sql
zeekayandGitHub 5b5cf9e9db feat: merge AgentField control plane + SDKs as Hanzo Agents (#1)
Transforms hanzoai/agents from a marketplace config repo into a full
agent orchestration platform by merging the AgentField infrastructure:

- Go control plane (K8s-like agent orchestration, service mesh, DAG workflows)
- Python SDK (FastAPI-based agent framework, LiteLLM, memory, DID/VC)
- TypeScript SDK (@hanzo/agents - Vercel AI SDK, MCP, workflows)
- Go SDK (idiomatic agent builder + client)
- React 19 embedded dashboard (XyFlow DAGs, Recharts, Radix UI)
- Docker/K8s/Helm deployment configs
- Examples: hello world, deep research, RAG, simulation, benchmarks
- Functional test suite across Python/Go/TypeScript

All references rebranded: AgentField → Hanzo Agents
- Module: github.com/hanzoai/agents/control-plane
- Python: hanzo_agents
- TypeScript: @hanzo/agents
- Go: github.com/hanzoai/agents/sdk/go
- Env vars: HANZO_AGENTS_*
- Config: hanzo-agents.yaml

Previous marketplace configs moved to config/ directory.
2026-02-09 18:53:09 -08:00

55 lines
2.2 KiB
SQL

-- 011_create_workflow_runs_and_steps.sql
-- Introduces workflow_runs and workflow_steps tables for durable orchestration state.
CREATE TABLE IF NOT EXISTS workflow_runs (
run_id TEXT PRIMARY KEY,
root_workflow_id TEXT NOT NULL,
root_execution_id TEXT,
status TEXT NOT NULL DEFAULT 'pending',
total_steps INTEGER NOT NULL DEFAULT 0,
completed_steps INTEGER NOT NULL DEFAULT 0,
failed_steps INTEGER NOT NULL DEFAULT 0,
metadata JSONB NOT NULL DEFAULT '{}'::jsonb,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
completed_at TIMESTAMPTZ
);
CREATE TABLE IF NOT EXISTS workflow_steps (
step_id TEXT PRIMARY KEY,
run_id TEXT NOT NULL REFERENCES workflow_runs(run_id) ON DELETE CASCADE,
parent_step_id TEXT REFERENCES workflow_steps(step_id) ON DELETE SET NULL,
execution_id TEXT,
agent_node_id TEXT,
target TEXT,
status TEXT NOT NULL DEFAULT 'pending',
attempt INTEGER NOT NULL DEFAULT 0,
priority INTEGER NOT NULL DEFAULT 0,
not_before TIMESTAMPTZ NOT NULL DEFAULT NOW(),
input_uri TEXT,
result_uri TEXT,
error_message TEXT,
metadata JSONB NOT NULL DEFAULT '{}'::jsonb,
started_at TIMESTAMPTZ,
completed_at TIMESTAMPTZ,
leased_at TIMESTAMPTZ,
lease_timeout TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
CONSTRAINT uq_workflow_steps_run_execution UNIQUE (run_id, execution_id)
);
CREATE INDEX IF NOT EXISTS idx_workflow_runs_status ON workflow_runs(status);
CREATE INDEX IF NOT EXISTS idx_workflow_runs_root ON workflow_runs(root_workflow_id);
CREATE INDEX IF NOT EXISTS idx_workflow_steps_run_status ON workflow_steps(run_id, status);
CREATE INDEX IF NOT EXISTS idx_workflow_steps_status_not_before ON workflow_steps(status, not_before);
CREATE INDEX IF NOT EXISTS idx_workflow_steps_parent ON workflow_steps(parent_step_id);
CREATE TRIGGER update_workflow_runs_updated_at
BEFORE UPDATE ON workflow_runs
FOR EACH ROW EXECUTE FUNCTION update_updated_at_column();
CREATE TRIGGER update_workflow_steps_updated_at
BEFORE UPDATE ON workflow_steps
FOR EACH ROW EXECUTE FUNCTION update_updated_at_column();