* Delete a workflow (and all its runs)
(workflowId: string, workflowName: string)
| 43 | * Delete a workflow (and all its runs) |
| 44 | */ |
| 45 | async function deleteWorkflow(workflowId: string, workflowName: string) { |
| 46 | const res = await fetch(`${API_BASE}/workflows/${workflowId}`, { |
| 47 | method: 'DELETE', |
| 48 | headers: HEADERS, |
| 49 | }); |
| 50 | |
| 51 | if (res.ok) { |
| 52 | console.log(` ✓ Deleted: ${workflowName}`); |
| 53 | } else if (res.status === 404) { |
| 54 | console.warn(` ⊘ Not found: ${workflowName} (already deleted)`); |
| 55 | } else { |
| 56 | console.warn(` ✗ Failed to delete: ${workflowName} (${res.status})`); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Main cleanup function |