Summary
Create the agent node component and custom edge component for the workflow canvas. Agent nodes are the target of workflow connections - they represent which agent executes the triggered work. Edges between trigger nodes and agent nodes carry the prompt template configuration.
Context
In the visual workflow model, each workflow is represented as a trigger node connected to an agent node via an edge. The edge is not just a visual connector - it carries the prompt template that defines what message the agent receives when the trigger fires. This mirrors the backend WorkflowConfig which binds a TriggerConfig to an agent_id with a prompt_template.
Implementation Details
1. Agent node component
Create ui/src/components/workflows/canvas/nodes/AgentNode.tsx:
- Displays agent information:
- Agent name (primary text)
- Status badge (running/stopped/pending/failed) using existing
AgentStatusBadge
- Model name (e.g., "claude-sonnet-4-20250514")
- Tool policy summary (e.g., "Allow all", "3 tools allowed")
- Input handle on the left side (receives connections from triggers)
- Visual styling:
- Distinct from trigger nodes (different shape/border treatment)
- Status-aware coloring (green border for running, red for failed, etc.)
- Agent icon from lucide-react (
Bot)
export interface AgentNodeData {
agentId: string;
name: string;
status: AgentStatus;
model?: string;
toolPolicy: ToolPolicy;
onAgentChange?: (agentId: string) => void;
}
2. Prompt template edge component
Create ui/src/components/workflows/canvas/edges/PromptEdge.tsx:
- Custom React Flow edge that visualizes the prompt template binding:
- Renders as a styled Bezier curve (using React Flow's
getBezierPath)
- Edge label shows truncated prompt template preview (first 40 chars)
- Click/double-click opens the existing
PromptTemplateEditor in a side panel or modal
- Visual indicator when prompt is empty/default vs. customized
- Poll interval display as a small badge on the edge
export interface PromptEdgeData {
promptTemplate: string;
pollIntervalSecs: number;
enabled: boolean;
onPromptChange?: (template: string) => void;
onIntervalChange?: (secs: number) => void;
}
3. Register node and edge types
Update ui/src/components/workflows/canvas/nodeTypes.ts:
export const workflowNodeTypes = {
trigger: TriggerNode,
agent: AgentNode,
} satisfies NodeTypes;
export const workflowEdgeTypes = {
prompt: PromptEdge,
} satisfies EdgeTypes;
4. Tests
- Agent node renders with name, status badge, model, and tool policy
- Agent node shows correct status colors
- Prompt edge renders with truncated template preview
- Edge click triggers prompt editor callback
- Edge visual state changes for empty vs. customized prompts
Files to Create/Modify
ui/src/components/workflows/canvas/nodes/AgentNode.tsx - new
ui/src/components/workflows/canvas/nodes/AgentNode.test.tsx - new
ui/src/components/workflows/canvas/edges/PromptEdge.tsx - new
ui/src/components/workflows/canvas/edges/PromptEdge.test.tsx - new
ui/src/components/workflows/canvas/edges/index.ts - new barrel
ui/src/components/workflows/canvas/nodeTypes.ts - update with agent + edge types
ui/src/components/workflows/canvas/nodes/index.ts - update exports
Acceptance Criteria
Blocked By
Stack Base
Stack on: feature/autonomous-pipeline after #1095 merges.
Summary
Create the agent node component and custom edge component for the workflow canvas. Agent nodes are the target of workflow connections - they represent which agent executes the triggered work. Edges between trigger nodes and agent nodes carry the prompt template configuration.
Context
In the visual workflow model, each workflow is represented as a trigger node connected to an agent node via an edge. The edge is not just a visual connector - it carries the prompt template that defines what message the agent receives when the trigger fires. This mirrors the backend
WorkflowConfigwhich binds aTriggerConfigto anagent_idwith aprompt_template.Implementation Details
1. Agent node component
Create
ui/src/components/workflows/canvas/nodes/AgentNode.tsx:AgentStatusBadgeBot)2. Prompt template edge component
Create
ui/src/components/workflows/canvas/edges/PromptEdge.tsx:getBezierPath)PromptTemplateEditorin a side panel or modal3. Register node and edge types
Update
ui/src/components/workflows/canvas/nodeTypes.ts:4. Tests
Files to Create/Modify
ui/src/components/workflows/canvas/nodes/AgentNode.tsx- newui/src/components/workflows/canvas/nodes/AgentNode.test.tsx- newui/src/components/workflows/canvas/edges/PromptEdge.tsx- newui/src/components/workflows/canvas/edges/PromptEdge.test.tsx- newui/src/components/workflows/canvas/edges/index.ts- new barrelui/src/components/workflows/canvas/nodeTypes.ts- update with agent + edge typesui/src/components/workflows/canvas/nodes/index.ts- update exportsAcceptance Criteria
workflowNodeTypes/workflowEdgeTypesBlocked By
Stack Base
Stack on:
feature/autonomous-pipelineafter #1095 merges.