{"record":{"id":"687c72541d144de0","repo":"mastra-ai/mastra","slug":"no-workflow-with-id-id","errorCode":null,"errorMessage":"No workflow with id \"${id}\".","messagePattern":"No workflow with id \"(.+?)\"\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mastracode/sdk/src/tools/workflows/get-workflow.ts","lineNumber":26,"sourceCode":"\nexport const getWorkflowTool = createTool({\n  id: 'get-workflow',\n  description: 'Return the full stored definition of a workflow (input/output schemas + the step graph).',\n  inputSchema: z.object({\n    id: z.string().describe('The workflow id.'),\n  }),\n  outputSchema: z.object({\n    id: z.string(),\n    description: z.string().optional(),\n    status: z.enum(['active', 'archived']),\n    inputSchema: z.any().optional(),\n    outputSchema: z.any().optional(),\n    graph: z.array(z.any()).optional(),\n  }),\n  execute: async ({ id }, { mastra }) => {\n    if (!mastra) throw new Error('get-workflow requires a Mastra context.');\n    const def = await getWorkflow(mastra as Mastra, id);\n    if (!def) throw new Error(`No workflow with id \"${id}\".`);\n    return {\n      id: def.id,\n      description: def.description,\n      status: def.status,\n      inputSchema: def.inputSchema,\n      outputSchema: def.outputSchema,\n      graph: def.graph,\n    };\n  },\n});\n","sourceCodeStart":8,"sourceCodeEnd":37,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/mastracode/sdk/src/tools/workflows/get-workflow.ts#L8-L37","documentation":"get-workflow loads a workflow definition by id and throws this error when the storage lookup returns undefined/null. It means no workflow with the given id exists (or it is not visible to the current storage backend).","triggerScenarios":"Calling get-workflow with an id that was never saved, was deleted via delete-workflow, or belongs to a different storage backend/environment.","commonSituations":"Typo in the workflow id; using a dev storage in prod (or vice versa); workflow previously archived/deleted; save from create-workflow actually failed earlier.","solutions":["Verify the id is correct — list workflows or check the id returned by save-workflow.","Confirm you're pointed at the same storage backend where the workflow was saved.","Re-create the workflow if it was deleted, or check whether it was archived."],"exampleFix":"// before\nawait getWorkflowTool.execute({ id: 'my-workflow' }, { mastra });\n// after: confirm id first\nconst wf = await mastra.getStorage().listWorkflows?.();\nawait getWorkflowTool.execute({ id: wf.find(w => w.id.includes('my-workflow'))?.id }, { mastra });","handlingStrategy":"try-catch","validationCode":"const exists = await listWorkflowIds(mastra); // ensure id present before lookup\nif (!exists.includes(id)) console.warn(`workflow \"${id}\" not found — get-workflow will throw`);","typeGuard":"function isWorkflowDef(d: unknown): d is { id: string; description?: string; status: 'active' | 'archived' } { return !!d && typeof d === 'object' && typeof (d as any).id === 'string'; }","tryCatchPattern":"try { const def = await tool.execute({ id }, { mastra }); } catch (e) { if (e.message.startsWith('No workflow with id')) { /* fall back to listing workflows or recreating it */ } else throw e; }","preventionTips":["Store and pass ids returned by save-workflow rather than hand-typing them.","Confirm storage backend/env consistency (dev vs prod).","Check archived/deleted status before lookup."],"tags":["workflows","not-found","storage"],"backgroundTag":"resource-not-found","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}