interface WorkflowDefinition {
nodes: WorkflowNodeDefinition[];
canvasState?: CanvasState;
}
interface AutomationTemplate {
id: string;
org_id: string;
name: string;
description: string | null;
nodes: TemplateNode[];
recurrence_enabled: boolean;
next_run_at: string | null;
last_run_at: string | null;
schedule_config: ScheduleConfig | null;
account_iteration_config: AccountIterationConfig | null;
created_at: string;
updated_at: string;
}
interface AutomationRun {
id: string;
template_id: string;
org_id: string;
tag: string | null;
status: 'pending' | 'running' | 'completed' | 'failed' | 'stopped';
variable_inputs: Record<string, PortValue> | null;
review_status: 'pending_review' | 'approved' | 'rejected' | null;
created_at: string;
completed_at: string | null;
}
interface ExecutorNode {
id: string;
template_node_id: string;
executor_index: number;
type: NodeType;
status: 'pending' | 'running' | 'completed' | 'failed' | 'skipped' | 'stopped';
output_value: unknown | null;
created_at: string;
completed_at: string | null;
}
interface ExecutionEdge {
id: string;
source_executor_id: string;
source_port: string;
target_executor_id: string;
target_port: string;
value: unknown | null;
}