n8n-io/n8n · error · Error

DAYTONA_API_URL is required for sandbox provider "daytona".

Error message

DAYTONA_API_URL is required for sandbox provider "daytona". Set it to e.g. https://app.daytona.io/api.

What it means

Thrown by resolveSandboxConfig when provider is 'daytona' but DAYTONA_API_URL is not set. The Daytona sandbox provider needs a base API URL (e.g. https://app.daytona.io/api) to provision sandboxes; the harness fails at startup rather than mid-run.

Source

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

 */
const DEFAULT_DAYTONA_CREATE_TIMEOUT_SECONDS = 900;
const VALID_PROVIDERS: SandboxProvider[] = ['n8n-sandbox', 'daytona'];

export function resolveSandboxConfig(env: NodeJS.ProcessEnv): SandboxConfig {
	const providerRaw = env.N8N_INSTANCE_AI_SANDBOX_PROVIDER ?? 'n8n-sandbox';
	if (!VALID_PROVIDERS.includes(providerRaw as SandboxProvider)) {
		throw new Error(
			`Invalid sandbox provider "${providerRaw}". Set N8N_INSTANCE_AI_SANDBOX_PROVIDER to one of: ${VALID_PROVIDERS.join(', ')}.`,
		);
	}
	const provider = providerRaw as SandboxProvider;
	const timeout = parseTimeout(env.N8N_INSTANCE_AI_SANDBOX_TIMEOUT) ?? DEFAULT_TIMEOUT_MS;

	if (provider === 'daytona') {
		const daytonaApiUrl = env.DAYTONA_API_URL;
		const daytonaApiKey = env.DAYTONA_API_KEY;
		if (!daytonaApiUrl) {
			throw new Error(
				'DAYTONA_API_URL is required for sandbox provider "daytona". Set it to e.g. https://app.daytona.io/api.',
			);
		}
		if (!daytonaApiKey) {
			throw new Error(
				'DAYTONA_API_KEY is required for sandbox provider "daytona". Set the Daytona API key.',
			);
		}
		const image = env.N8N_INSTANCE_AI_SANDBOX_IMAGE;
		const namePrefix = env.N8N_INSTANCE_AI_SANDBOX_NAME_PREFIX;
		const createTimeoutSeconds =
			parsePositiveInt(
				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',

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Set DAYTONA_API_URL to the Daytona API base, e.g. https://app.daytona.io/api.
  2. Confirm the variable is exported in the same shell/process that runs the eval.
  3. If you did not intend to use daytona, switch N8N_INSTANCE_AI_SANDBOX_PROVIDER back to 'n8n-sandbox'.

Example fix

# before
export N8N_INSTANCE_AI_SANDBOX_PROVIDER=daytona
# DAYTONA_API_URL unset

# after
export N8N_INSTANCE_AI_SANDBOX_PROVIDER=daytona
export DAYTONA_API_URL=https://app.daytona.io/api
Defensive patterns

Strategy: validation

Validate before calling

function daytonaConfigComplete(env: NodeJS.ProcessEnv): boolean {
  return env.N8N_INSTANCE_AI_SANDBOX_PROVIDER === 'daytona' && !!env.DAYTONA_API_URL;
}

if (!daytonaConfigComplete(process.env)) {
  throw new Error('DAYTONA_API_URL missing for daytona provider');
}

Type guard

null

Try / catch

try {
  resolveSandboxConfig(process.env);
} catch (e) {
  if (e instanceof Error && /DAYTONA_API_URL is required/.test(e.message)) {
    // prompt operator to set DAYTONA_API_URL, then retry
  }
  throw e;
}

Prevention

When it happens

Trigger: Selecting the daytona provider via N8N_INSTANCE_AI_SANDBOX_PROVIDER=daytona without providing DAYTONA_API_URL; the variable is set in a different shell/env than the eval run.

Common situations: Local dev switching to daytona but forgetting the URL; CI secret injection skipped this var; the var was renamed in a config refactor.

Related errors


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