{"record":{"id":"0b518dfffe7f71d6","repo":"n8n-io/n8n","slug":"no-tool-call-found-for-toolcallid-options-toolc","errorCode":null,"errorMessage":"No tool call found for toolCallId: ${options.toolCallId}","messagePattern":"No tool call found for toolCallId: (.+?)","errorType":"exception","errorClass":"StaleResumeError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/agents/src/runtime/loop/agent-runtime.ts","lineNumber":365,"sourceCode":"\tasync resume(\n\t\tmethod: 'stream',\n\t\tdata: unknown,\n\t\toptions: ResumeOptions & ExecutionOptions,\n\t): Promise<StreamResult>;\n\tasync resume(\n\t\tmethod: 'generate' | 'stream',\n\t\tdata: unknown,\n\t\toptions: ResumeOptions & ExecutionOptions,\n\t): Promise<GenerateResult | StreamResult> {\n\t\tthis.runId = options.runId;\n\t\tconst state = await this.runState.resume(this.runId);\n\t\tif (!state) {\n\t\t\tthrow new StaleResumeError(`No suspended run found for runId: ${this.runId}`);\n\t\t}\n\n\t\tconst toolCall = state.pendingToolCalls[options.toolCallId];\n\t\tif (!toolCall) {\n\t\t\tthrow new StaleResumeError(`No tool call found for toolCallId: ${options.toolCallId}`);\n\t\t}\n\n\t\tconst list = AgentMessageList.deserialize(state.messageList);\n\t\tthis.context.hydrateDeferredToolsFromList(list);\n\t\tawait hydrateFileParts(list.messages(), this.config.fileStore, {\n\t\t\tthreadId: state.persistence?.threadId,\n\t\t});\n\n\t\tconst tool = this.context\n\t\t\t.getCurrentTools(state.persistence)\n\t\t\t.find((t) => t.name === toolCall.toolName);\n\t\tif (!tool) throw new Error(`Tool ${toolCall.toolName} not found`);\n\n\t\tlet resumeData: unknown = data;\n\t\tlet abortScope: AgentAbortScope | undefined;\n\n\t\tconst resumeSchema = toolCall.suspended ? toolCall.resumeSchema : tool.resumeSchema;\n\t\tif (!isCancellation(resumeData) && resumeSchema) {","sourceCodeStart":347,"sourceCodeEnd":383,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/agents/src/runtime/loop/agent-runtime.ts#L347-L383","documentation":"Thrown when an HTTP Request node is configured with contentType='json' but the jsonBody actually looks like XML/SOAP. The validator flags this because sending an XML envelope through the JSON serializer produces a malformed request. Detected via payload starting with <?xml, <soap, <s:envelope, <env:envelope, or an expression referencing a soap/xml body field.","triggerScenarios":"params.contentType === 'json' AND looksLikeXmlPayload(params.jsonBody) is true — i.e. the jsonBody string matches the XML start pattern, or it is an expression (starts with '=' / contains '{{') whose body matches a soap/xml body/payload/envelope reference.","commonSituations":"Integrating a SOAP/legacy service and leaving the default JSON content type; an AI builder copies an XML envelope into jsonBody; the provider's docs show a SOAP envelope and the model maps it to the JSON body field.","solutions":["Set sendBody=true, contentType='raw', and place the envelope in the body field with rawContentType='text/xml' (or 'application/xml').","Omit specifyBody, jsonBody, and bodyParameters so they do not conflict with the raw body.","If the payload is dynamic, put an expression in body such as expr('{{ $json.soapBody }}') while keeping contentType='raw' and an XML rawContentType."],"exampleFix":"// before\nhttpRequest({\n  name: 'SOAP Call',\n  sendBody: true,\n  contentType: 'json',\n  jsonBody: '<soap:Envelope ...></soap:Envelope>',\n});\n\n// after\nhttpRequest({\n  name: 'SOAP Call',\n  sendBody: true,\n  contentType: 'raw',\n  rawContentType: 'text/xml',\n  body: '<soap:Envelope ...></soap:Envelope>',\n});","handlingStrategy":"validation","validationCode":"const XML_START = /^\\s*(?:=\\s*)?(?:\\{{\\s*)?['\"`]?\\s*(?:<\\?xml|<soap:?|<s:envelope|<env:envelope)/i;\n\nfunction looksLikeXml(value: unknown): boolean {\n  return typeof value === 'string' && XML_START.test(value);\n}\n\n// before building:\nif (params.contentType === 'json' && looksLikeXml(params.jsonBody)) {\n  throw new Error('XML payload detected; use contentType=raw with rawContentType=text/xml and the body field.');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When integrating SOAP/XML services, default to contentType='raw' with an XML rawContentType.","Never put an XML envelope in jsonBody; keep JSON bodies strictly JSON.","In an AI workflow generator, branch on detected payload type before assigning contentType."],"tags":["http-request","xml","soap","body","content-type"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}