{"record":{"id":"a821bbc6fe92ec45","repo":"Kong/insomnia","slug":"could-not-find-request-id","errorCode":null,"errorMessage":"Could not find request ${id}","messagePattern":"Could not find request (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/insomnia/src/common/templating/local-template-tags.ts","lineNumber":583,"sourceCode":"          defaultValue: 60,\n        },\n      ],\n\n      async run(context, field, id, filter, resendBehavior, maxAgeSeconds) {\n        filter = filter || '';\n        resendBehavior = (resendBehavior || 'never').toLowerCase();\n\n        if (!['body', 'header', 'raw', 'url'].includes(field)) {\n          throw new Error(`Invalid response field ${field}`);\n        }\n\n        if (!id) {\n          throw new Error('No request specified');\n        }\n\n        const request = await context.util.models.request.getById(id);\n        if (!request) {\n          throw new Error(`Could not find request ${id}`);\n        }\n\n        let shouldResend = false;\n        const environmentId = context.context.getEnvironmentId?.() || null;\n        const globalEnvironmentId = context.context.getGlobalEnvironmentId?.() || null;\n        let response = await context.util.models.response.getLatestForRequestId(id, environmentId);\n\n        switch (resendBehavior) {\n          case 'no-history': {\n            // if either global environment or collection environment changed, resend the request\n            shouldResend = !response\n              ? true\n              : response.environmentId !== environmentId || response.globalEnvironmentId !== globalEnvironmentId;\n            break;\n          }\n\n          case 'when-expired': {\n            if (!response) {","sourceCodeStart":565,"sourceCodeEnd":601,"githubUrl":"https://github.com/Kong/insomnia/blob/d9bb2b0142600f21309832daea3317942d285984/packages/insomnia/src/common/templating/local-template-tags.ts#L565-L601","documentation":"Error \"Could not find request ${id}\" thrown in Kong/insomnia.","triggerScenarios":"Thrown at packages/insomnia/src/common/templating/local-template-tags.ts:583 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d9bb2b0142600f21309832daea3317942d285984","analyzedAt":"2026-08-26T18:04:05.187Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}