import type { PaginationOptions } from "../types"; export type WorkflowStatus = "active" | "archived"; export type WorkflowRunStatus = "running" | "completed" | "failed" | "canceled" | "terminated" | "unknown"; export interface WorkflowResponse { id: string; name: string; specification: string; data_plane_id: string; company_id: number; created_at: string; created_by: number; updated_at: string; status: WorkflowStatus; archived_at: string | null; /** Tags that describe the workflow. */ tags: string[]; } export interface CreateWorkflowRequest { specification: string; data_plane_id: string; trigger_immediately?: boolean | null; schedule_immediately?: boolean | null; /** Tags that describe the workflow. Defaults to an empty list. */ tags?: string[]; } export interface CreateWorkflowResponse extends WorkflowResponse { run_id?: string | null; } export interface TriggerWorkflowResponse { run_id: string; } export interface ScheduleWorkflowRequest { trigger_immediately?: boolean | null; } export interface ScheduleWorkflowResponse { run_id?: string | null; } export interface ListWorkflowsResponse { records: WorkflowResponse[]; prev_page?: number | null; current_page: number; next_page?: number | null; total_records: number; total_pages: number; } export interface WorkflowRun { run_id: string; status: WorkflowRunStatus; start_time: string; close_time?: string | null; } export interface ListRunsResponse { runs: WorkflowRun[]; next_page_token?: string | null; } /** * Query parameters for `GET /workflows/{id}/runs`. * * Deliberately has no index signature: an index signature would silently accept * misspelled or legacy parameter names (e.g. `pageSize`/`pageToken`), which the * server ignores — the request succeeds and pagination just never advances. */ export interface ListRunsParams { /** Maximum number of runs to return per page (`per_page` query param). Defaults to 10. */ per_page?: number; /** Opaque token from a previous response (`page_token` query param). */ page_token?: string; } /** Query parameters for `GET /workflows`. See {@link ListRunsParams} on why there's no index signature. */ export interface ListWorkflowsParams extends PaginationOptions { /** Narrow results to workflows on this data plane. */ data_plane_id?: string; }