{"record":{"id":"9cdc1afac5d10178","repo":"mastra-ai/mastra","slug":"not-implemented","errorCode":null,"errorMessage":"Not implemented","messagePattern":"Not implemented","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/workflows/evented/step-executor.ts","lineNumber":474,"sourceCode":"  }): Promise<boolean> {\n    const callId = randomUUID();\n    const outputWriter = this.createOutputWriter(runId);\n\n    return condition(\n      createDeprecationProxy(\n        {\n          workflowId,\n          runId,\n          mastra: this.mastra!,\n          requestContext,\n          inputData,\n          state,\n          retryCount,\n          resumeData: resumeData,\n          getInitData: () => stepResults?.input as any,\n          getStepResult: getStepResult.bind(this, stepResults),\n          bail: (_result: any) => {\n            throw new Error('Not implemented');\n          },\n          writer: new ToolStream(\n            {\n              prefix: 'workflow-step',\n              callId,\n              name: 'condition',\n              runId,\n            },\n            outputWriter,\n          ),\n          abort: () => {\n            abortController?.abort();\n          },\n          [PUBSUB_SYMBOL]: this.mastra!.pubsub,\n          [STREAM_FORMAT_SYMBOL]: undefined, // TODO\n          engine: {},\n          abortSignal: abortController?.signal,\n          // TODO","sourceCodeStart":456,"sourceCodeEnd":492,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/workflows/evented/step-executor.ts#L456-L492","documentation":"Inside evaluateCondition for the evented step executor, the ExecutionEngine context handed to condition functions stubs bail() as unimplemented — calling it always throws this Error. bail (early-terminating the workflow with a result) is not supported for condition evaluation in the evented engine yet.","triggerScenarios":"A workflow step's when/condition function calls ctx.bail(result) while executing on the evented engine.","commonSituations":"Reusing condition logic written for the standard engine (where bail works) in an evented workflow; authors using bail to short-circuit a run from a condition.","solutions":["Remove the bail() call from the condition; return a boolean that controls whether the step runs.","Use suspend/resume or step output routing to model early termination instead of bail.","Run the workflow on the standard engine if bail semantics are required.","Track Mastra releases for evented-engine bail support before relying on it."],"exampleFix":"// before\nwhen: async ({ bail }) => { if (done) bail({ done: true }); return true; }\n// after\nwhen: async ({ getStepResult }) => !getStepResult('finish')?.done","handlingStrategy":"validation","validationCode":"// statically disallow bail in conditions meant for the evented engine\nif (conditionFn.toString().includes('bail(')) {\n  throw new Error('bail() is not supported in evented-engine conditions');\n}","typeGuard":null,"tryCatchPattern":"try { await eventedWf.run({ input }); } catch (e) { if (e.message === 'Not implemented' && usingEventedEngine) { return runOnStandardEngine(input); } throw e; }","preventionTips":["Never call bail() inside when/condition functions for evented workflows.","Document engine-specific API support in shared step helpers.","Add lint/tests that scan condition source for bail usage.","Track Mastra changelog before using bail on the evented engine."],"tags":["workflows","evented","not-implemented","bail"],"backgroundTag":"unsupported-api-in-engine","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}