Summary
Expand the frontend TaskSourceConfig type in ui/src/types/orchestrator.ts to cover all 14+ backend TriggerConfig variants, and reconcile the field naming mismatch between frontend (source_config) and backend (trigger_config).
Context
The backend TriggerConfig enum (in crates/orchestrator/src/scheduler/types.rs) supports 14 trigger types:
github_issues, github_pull_requests
cron, delay
webhook, manual
linear_issues
agent_lifecycle, agent_idle
dispatch_result
composite
queue
ask_response
The frontend TaskSourceConfig type only covers github_issues and github_pull_requests. Additionally, the frontend uses the field name source_config while the backend API serializes as trigger_config - this mismatch needs reconciliation.
Implementation Details
1. Rename and expand the type
In ui/src/types/orchestrator.ts, replace TaskSourceConfig with TriggerConfig:
export type TriggerConfig =
| { type: "github_issues"; owner: string; repo: string; labels: string[]; state: string }
| { type: "github_pull_requests"; owner: string; repo: string; labels: string[]; state: string }
| { type: "cron"; expression: string }
| { type: "delay"; run_at: string }
| { type: "webhook"; secret?: string; source: "github" | "linear" | "any" }
| { type: "manual" }
| { type: "linear_issues"; team_key?: string; project?: string; status?: string[]; labels: string[]; assignee?: string }
| { type: "agent_lifecycle"; event: "session_start" | "session_end" | "context_clear" }
| { type: "agent_idle"; idle_seconds: number }
| { type: "dispatch_result"; source_workflow_id?: string; status?: DispatchStatus }
| { type: "composite"; mode: "or" | "and"; triggers: TriggerConfig[]; correlation_window_secs?: number }
| { type: "queue"; queue_name: string; poll_interval_secs?: number; visibility_timeout_secs?: number }
| { type: "ask_response"; agent_id?: string; category?: string; response_pattern?: string };
2. Fix field naming
Update the Workflow interface to use trigger_config to match the backend JSON:
export interface Workflow {
id: string;
name: string;
agent_id: string;
trigger_config: TriggerConfig; // was: source_config: TaskSourceConfig
// ...
}
Similarly update CreateWorkflowRequest.
3. Add type guards and helpers
export type TriggerType = TriggerConfig["type"];
export function getTriggerLabel(type: TriggerType): string { /* human-readable labels */ }
export function getTriggerCategory(type: TriggerType): "external" | "schedule" | "event" | "internal" { /* categorization */ }
export function getDefaultTriggerConfig(type: TriggerType): TriggerConfig { /* defaults for each type */ }
4. Update all consumers
Update all components and hooks that reference source_config or TaskSourceConfig:
ui/src/components/workflows/WorkflowForm.tsx
ui/src/components/workflows/WorkflowTable.tsx
ui/src/pages/workflows/WorkflowDetail.tsx
ui/src/hooks/useWorkflows.ts
ui/src/services/orchestrator.ts
5. Keep backward compatibility
Add a deprecated alias if needed:
/** @deprecated Use TriggerConfig instead */
export type TaskSourceConfig = TriggerConfig;
Files to Modify
ui/src/types/orchestrator.ts - primary type changes
ui/src/components/workflows/WorkflowForm.tsx - update field references
ui/src/components/workflows/WorkflowTable.tsx - update source label logic
ui/src/pages/workflows/WorkflowDetail.tsx - update config display
ui/src/pages/workflows/WorkflowList.tsx - update if needed
ui/src/hooks/useWorkflows.ts - update type references
ui/src/services/orchestrator.ts - verify API mapping
Reference
Backend source of truth: crates/orchestrator/src/scheduler/types.rs (TriggerConfig enum)
Acceptance Criteria
Stack Base
- Stack on:
feature/autonomous-pipeline
- Parallel: no ordering constraint (can be implemented independently of canvas scaffold)
Summary
Expand the frontend
TaskSourceConfigtype inui/src/types/orchestrator.tsto cover all 14+ backendTriggerConfigvariants, and reconcile the field naming mismatch between frontend (source_config) and backend (trigger_config).Context
The backend
TriggerConfigenum (incrates/orchestrator/src/scheduler/types.rs) supports 14 trigger types:github_issues,github_pull_requestscron,delaywebhook,manuallinear_issuesagent_lifecycle,agent_idledispatch_resultcompositequeueask_responseThe frontend
TaskSourceConfigtype only coversgithub_issuesandgithub_pull_requests. Additionally, the frontend uses the field namesource_configwhile the backend API serializes astrigger_config- this mismatch needs reconciliation.Implementation Details
1. Rename and expand the type
In
ui/src/types/orchestrator.ts, replaceTaskSourceConfigwithTriggerConfig:2. Fix field naming
Update the
Workflowinterface to usetrigger_configto match the backend JSON:Similarly update
CreateWorkflowRequest.3. Add type guards and helpers
4. Update all consumers
Update all components and hooks that reference
source_configorTaskSourceConfig:ui/src/components/workflows/WorkflowForm.tsxui/src/components/workflows/WorkflowTable.tsxui/src/pages/workflows/WorkflowDetail.tsxui/src/hooks/useWorkflows.tsui/src/services/orchestrator.ts5. Keep backward compatibility
Add a deprecated alias if needed:
Files to Modify
ui/src/types/orchestrator.ts- primary type changesui/src/components/workflows/WorkflowForm.tsx- update field referencesui/src/components/workflows/WorkflowTable.tsx- update source label logicui/src/pages/workflows/WorkflowDetail.tsx- update config displayui/src/pages/workflows/WorkflowList.tsx- update if neededui/src/hooks/useWorkflows.ts- update type referencesui/src/services/orchestrator.ts- verify API mappingReference
Backend source of truth:
crates/orchestrator/src/scheduler/types.rs(TriggerConfig enum)Acceptance Criteria
TriggerConfigtype covers all 14 backend trigger variantsWorkflowinterface usestrigger_configfield name matching backend JSONStack Base
feature/autonomous-pipeline