diff --git a/src/app/api/user/[uid]/workflows/route.ts b/src/app/api/user/[uid]/workflows/route.ts index b7acda1..40e869b 100644 --- a/src/app/api/user/[uid]/workflows/route.ts +++ b/src/app/api/user/[uid]/workflows/route.ts @@ -24,7 +24,7 @@ export async function GET( }); if (!workflows.length) { - return NextResponse.json("No workflows found", { status: 404 }); + return NextResponse.json([], { status: 200 }); } const res = workflows.map( diff --git a/src/lib/workflow/Workflow.ts b/src/lib/workflow/Workflow.ts index 9a7388e..c37ee90 100644 --- a/src/lib/workflow/Workflow.ts +++ b/src/lib/workflow/Workflow.ts @@ -436,12 +436,7 @@ export class Runner extends Base { } const sources = workflow.operations.filter((operation) => { - return workflow.operations.some((otherOperation) => { - return ( - otherOperation.sources?.includes(operation.id) && - otherOperation.id !== operation.id - ); - }); + return !operation.sources || operation.sources.length === 0; }); for (const source of sources) {