diff --git a/packages/backend/src/graphql/mutations/execute-flow.ts b/packages/backend/src/graphql/mutations/execute-flow.ts index 5caeaa77..6b25960b 100644 --- a/packages/backend/src/graphql/mutations/execute-flow.ts +++ b/packages/backend/src/graphql/mutations/execute-flow.ts @@ -13,11 +13,13 @@ const executeFlow = async ( context: Context ) => { const { stepId } = params.input; - const { executionStep } = await testRun({ stepId }); const untilStep = await context.currentUser .$relatedQuery('steps') - .findById(stepId); + .findById(stepId) + .throwIfNotFound(); + + const { executionStep } = await testRun({ stepId }); if (executionStep.isFailed) { throw new Error(JSON.stringify(executionStep.errorDetails));