Files
patchy631--ai-engineering-hub/open-agent-builder/convex/admin.ts
T
2026-07-13 12:37:47 +08:00

22 lines
448 B
TypeScript

import { mutation } from "./_generated/server";
/**
* Admin functions for database management
*/
// Clear all workflows (use with caution!)
export const clearAllWorkflows = mutation({
args: {},
handler: async ({ db }) => {
const workflows = await db.query("workflows").collect();
let deleted = 0;
for (const workflow of workflows) {
await db.delete(workflow._id);
deleted++;
}
return { deleted };
},
});