n8n-io/n8n · error · NodeOperationError

${error.message}

Error message

${error.message}

What it means

Fallback branch of the Microsoft 365 Agent trigger webhook catch block, taken only when the error has no response.data.error envelope. Wraps the raw error.message as a NodeOperationError with no description. Covers any non-OAuth-structured failure inside the webhook handler.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/vendors/Microsoft/MicrosoftAgent365Trigger.node.ts:287

						? { microsoftMcpToolLogs: activityCapture.mcpToolLogs }
						: {}),
				};
			}

			return {
				noWebhookResponse: true,
				workflowData: [this.helpers.returnJsonArray({ ...returnData })],
			};
		} catch (error) {
			const errorData = error.response?.data;
			if (typeof errorData === 'object' && 'error' in errorData) {
				const message = 'Error: ' + String(errorData.error);
				const description = (errorData.error_description as string) ?? error.message;

				throw new NodeOperationError(node, message, { description });
			}

			throw new NodeOperationError(node, error.message);
		}
	}
}

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Inspect error.message in the execution — it's the raw underlying message with no enrichment.
  2. If it's a network/timeout error, Microsoft retries Bot Framework deliveries, so often no action is needed beyond monitoring.
  3. For malformed-activity errors, validate that the caller is the real Bot Framework (not a manual POST).
  4. Re-run with verbose logging to capture the full error object (stack/code) for diagnosis.
Defensive patterns

Strategy: try-catch

Type guard

function isStructuredError(e: unknown): boolean {
  return !!e && typeof e === 'object' && !!(e as { response?: { data?: { error?: unknown } } }).response?.data?.error;
}

Try / catch

try {
  await webhook();
} catch (e) {
  if (!isStructuredError(e)) {
    // raw message path: log code/stack for diagnosis, monitor for recurrence
    console.error('Microsoft trigger raw error:', (e as Error).message, (e as { code?: string }).code);
  }
  throw e;
}

Prevention

When it happens

Trigger: Network/transport errors (ECONNRESET, ETIMEDOUT) calling Microsoft, JSON parse failures on the request body, unexpected activity shape, missing helper return, or an uncaught throw inside the adapter callback that isn't an HTTP-layer error.

Common situations: Intermittent network blip to Graph; malformed incoming activity (custom client instead of real Bot Framework); a node version mismatch where the activity shape changed; downstream Graph call timing out.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/04e0896c84b4e647. Report an issue: GitHub.