diff --git a/web/app/workflows/[id]/page.tsx b/web/app/workflows/[id]/page.tsx
index 5f9e7e7..cc9656b 100644
--- a/web/app/workflows/[id]/page.tsx
+++ b/web/app/workflows/[id]/page.tsx
@@ -84,7 +84,7 @@ export default function WorkflowBuilder() {
return
Loading…
;
}
- const libById = (sid: string) => library?.find((l) => l.step_id === sid);
+ const libById = (sid?: string) => (sid ? library?.find((l) => l.step_id === sid) : undefined);
const sortedSteps = [...wf.steps].sort((a, b) => a.order - b.order);
const selectedRef = selected !== null ? sortedSteps[selected] : null;
diff --git a/web/lib/api.ts b/web/lib/api.ts
index 157f87b..bb726d7 100644
--- a/web/lib/api.ts
+++ b/web/lib/api.ts
@@ -148,10 +148,13 @@ export interface WorkflowStep {
declared_outputs: string[];
declared_inputs: InputParam[];
secret_refs: string[];
+ source?: "user" | "default";
+ slug?: string;
}
export interface WorkflowStepRef {
- step_id: string;
+ step_id?: string;
+ inline?: WorkflowStep;
order: number;
on_failure: "stop" | "continue" | "retry";
max_retries: number;
@@ -419,6 +422,30 @@ export const api = {
return request(`/steps/${stepId}`, { method: "DELETE" });
},
+ exportStepUrl(stepId: string): string {
+ return `/api/steps/${stepId}/export`;
+ },
+
+ importStep(doc: unknown): Promise {
+ return request("/steps/import", {
+ method: "POST",
+ body: JSON.stringify(doc),
+ });
+ },
+
+ parseStep(doc: unknown): Promise {
+ return request("/steps/parse", {
+ method: "POST",
+ body: JSON.stringify(doc),
+ });
+ },
+
+ seedDefaults(): Promise<{ created: number; updated: number }> {
+ return request<{ created: number; updated: number }>("/steps/seed-defaults", {
+ method: "POST",
+ });
+ },
+
// Workflows
listWorkflows(): Promise {
return request("/workflows");