n8n-io/n8n · error · Error

Brave search failed

Error message

Brave search failed: ${response.status} ${response.statusText}

What it means

API failure from braveSearch after exhausting retry attempts (MAX_ATTEMPTS with exponential backoff on retryable statuses). It fires when the final response still has a non-ok HTTP status; the status and status text are surfaced verbatim. Indicates the Brave API endpoint persistently failed or rejected the request.

Solutions

  1. Check the Brave Search API status page and your API key/plan; 429 and 5xx are retried automatically with backoff before this error.
  2. Inspect the HTTP status in the message: 401/403 mean credential problems, 422 means a bad query.
  3. Reduce request rate or add your own retry with longer delays if quota limits persist.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at packages/@n8n/ai-utilities/src/web-search/brave-search.ts:104 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at packages/@n8n/ai-utilities/src/web-search/brave-search.ts:104

			function onAbort() {
				clearTimeout(timer);
				resolve();
			}
			signal?.addEventListener('abort', onAbort, { once: true });
		});

	let response = await runSearch();
	for (
		let attempt = 1;
		attempt < MAX_ATTEMPTS && !response.ok && isRetryable(response.status);
		attempt++
	) {
		await backoff(RETRY_BASE_MS * 2 ** (attempt - 1));
		response = await runSearch();
	}

	if (!response.ok) {
		throw new Error(`Brave search failed: ${response.status} ${response.statusText}`);
	}

	const data = (await response.json()) as BraveSearchApiResponse;

	return {
		query,
		results: (data.web?.results ?? []).map((r) => ({
			title: r.title,
			url: r.url,
			snippet: r.description,
			...(r.age ? { publishedDate: r.age } : {}),
		})),
	};
}

View on GitHub (pinned to 5ac6606e81)