Archon/migrations/008_workflow_runs.sql
Rasmus Widing 759cb303a9 Add workflow engine for multi-step AI orchestration
Implement a prompt orchestrator that chains prompts together for sequential
AI execution with artifacts passed between steps:

- Add workflow YAML parser for .archon/workflows/ discovery
- Create step executor with context management (clearContext flag)
- Implement router response parser for WORKFLOW: name detection
- Add JSONL event logging for observability
- Create /workflow list and /workflow reload commands
- Add database table for workflow run tracking

Workflows enable automated multi-step development tasks like
plan -> implement -> create-pr with each step receiving context
from previous steps.
2026-01-02 11:31:04 +02:00

23 lines
997 B
SQL

-- Workflow runs tracking
-- Tracks workflow execution state for resumption and observability
CREATE TABLE IF NOT EXISTS remote_agent_workflow_runs (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
workflow_name VARCHAR(255) NOT NULL,
conversation_id UUID REFERENCES remote_agent_conversations(id) ON DELETE CASCADE,
codebase_id UUID REFERENCES remote_agent_codebases(id) ON DELETE SET NULL,
current_step_index INTEGER DEFAULT 0,
status VARCHAR(20) NOT NULL DEFAULT 'running', -- running, completed, failed
user_message TEXT NOT NULL,
metadata JSONB DEFAULT '{}',
started_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
completed_at TIMESTAMP WITH TIME ZONE
);
CREATE INDEX IF NOT EXISTS idx_workflow_runs_conversation
ON remote_agent_workflow_runs(conversation_id);
CREATE INDEX IF NOT EXISTS idx_workflow_runs_status
ON remote_agent_workflow_runs(status);
COMMENT ON TABLE remote_agent_workflow_runs IS
'Tracks workflow execution state for resumption and observability';