n8n-io/n8n · error · Error

N8N_SANDBOX_SERVICE_URL is required for sandbox provider "n8

Error message

N8N_SANDBOX_SERVICE_URL is required for sandbox provider "n8n-sandbox". Set it to the service URL.

What it means

Thrown by resolveSandboxConfig when provider is 'n8n-sandbox' (the default) but N8N_SANDBOX_SERVICE_URL is not set. The n8n-sandbox provider needs the service URL of the running sandbox microservice to forward build/exec requests.

Source

Thrown at packages/@n8n/instance-ai/evaluations/harness/sandbox-config.ts:69

				env.N8N_INSTANCE_AI_SANDBOX_CREATE_TIMEOUT_SECONDS,
				'N8N_INSTANCE_AI_SANDBOX_CREATE_TIMEOUT_SECONDS',
			) ?? DEFAULT_DAYTONA_CREATE_TIMEOUT_SECONDS;
		return {
			enabled: true,
			provider: 'daytona',
			daytonaApiUrl,
			daytonaApiKey,
			timeout,
			createTimeoutSeconds,
			...(image ? { image } : {}),
			...(namePrefix ? { namePrefix } : {}),
		};
	}

	if (provider === 'n8n-sandbox') {
		const serviceUrl = env.N8N_SANDBOX_SERVICE_URL;
		if (!serviceUrl) {
			throw new Error(
				'N8N_SANDBOX_SERVICE_URL is required for sandbox provider "n8n-sandbox". Set it to the service URL.',
			);
		}
		const apiKey = env.N8N_SANDBOX_SERVICE_API_KEY;
		return {
			enabled: true,
			provider: 'n8n-sandbox',
			serviceUrl,
			...(apiKey ? { apiKey } : {}),
			timeout,
		};
	}

	const exhaustiveProvider: never = provider;
	throw new Error(
		`Invalid sandbox provider "${String(exhaustiveProvider)}". Set N8N_INSTANCE_AI_SANDBOX_PROVIDER to one of: ${VALID_PROVIDERS.join(', ')}.`,
	);
}

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Set N8N_SANDBOX_SERVICE_URL to the sandbox service base URL (e.g. http://sandbox-service:8080).
  2. Ensure the sandbox service is reachable from the eval process (DNS/network).
  3. If you intended to use Daytona instead, set N8N_INSTANCE_AI_SANDBOX_PROVIDER=daytona and provide DAYTONA_*.

Example fix

# before — default provider, no service URL
# N8N_SANDBOX_SERVICE_URL unset

# after
export N8N_SANDBOX_SERVICE_URL=http://sandbox-service:8080
Defensive patterns

Strategy: validation

Validate before calling

function n8nSandboxConfigComplete(env: NodeJS.ProcessEnv): boolean {
  const provider = env.N8N_INSTANCE_AI_SANDBOX_PROVIDER ?? 'n8n-sandbox';
  return provider !== 'n8n-sandbox' || !!env.N8N_SANDBOX_SERVICE_URL;
}

if (!n8nSandboxConfigComplete(process.env)) {
  throw new Error('N8N_SANDBOX_SERVICE_URL missing for n8n-sandbox provider');
}

Type guard

null

Try / catch

try {
  resolveSandboxConfig(process.env);
} catch (e) {
  if (e instanceof Error && /N8N_SANDBOX_SERVICE_URL is required/.test(e.message)) {
    // set the URL or switch provider, then retry
  }
  throw e;
}

Prevention

When it happens

Trigger: Default provider is used but the sandbox service URL env var was never configured; the service moved and the URL was not updated; the variable is set in docker-compose but not passed through to the eval process.

Common situations: Running the eval harness locally for the first time without configuring the sandbox service; deploying to a new environment and forgetting this var; the sandbox service was scaled to a new host.

Related errors


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