n8n-io/n8n · error · Error

Assistant SDK returned HTTP

Error message

Assistant SDK returned HTTP ${String(response.status)}

What it means

HTTP-failure error in assistant-handler's callSdk. It fires when the Assistant SDK chat response has a non-ok status; the numeric status is surfaced so callers can distinguish auth (401/403), rate limiting (429), and server errors (5xx). Raised before any streaming starts.

Solutions

  1. Check the AI Assistant/gateway service status; a non-2xx from the SDK means the upstream call failed.
  2. Verify authentication/configuration of the assistant client (credentials, project ids sent in the payload).
  3. Use the HTTP status in the message to distinguish auth (401/403), rate limit (429), and server (5xx) problems.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/@n8n/ai-workflow-builder.ee/src/assistant/assistant-handler.ts:150 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/41639792ae6c2921. Report an issue: GitHub.

Appendix: source

Thrown at packages/@n8n/ai-workflow-builder.ee/src/assistant/assistant-handler.ts:150

					displayName: context.credentialContext.displayName,
				},
			};
		}

		return { payload: initPayload };
	}

	/**
	 * Call the SDK and validate the response.
	 */
	private async callSdk(
		payload: { payload: object; sessionId?: string },
		userId: string,
	): Promise<Response> {
		const response = await this.client.chat(payload, { id: userId });

		if (!response.ok) {
			throw new Error(`Assistant SDK returned HTTP ${String(response.status)}`);
		}

		return response;
	}

	/**
	 * Consume the SDK's streaming response, mapping messages and writing chunks.
	 * Follows the same approach as the frontend streamRequest() utility.
	 */
	private async consumeSdkStream(
		response: Response,
		writer: StreamWriter,
		signal?: AbortSignal,
		toolCallId?: string,
		context?: AssistantContext,
	): Promise<AssistantResult> {
		const body = response.body;
		if (!body) {

View on GitHub (pinned to 5ac6606e81)