n8n-io/n8n · error
PREFER_PREDEFINED_CREDENTIAL
PREFER_PREDEFINED_CREDENTIAL
Error message
This request targets a service with a dedicated n8n credential ("${resolution.credentialType}"). Use authentication: "predefinedCredentialType" with nodeCredentialType: "${resolution.credentialType}" instead of a generic credential. What it means
Error "This request targets a service with a dedicated n8n credential ("${resolution.credentialType}"). Use authentication: "predefinedCredentialType" with nodeCredentialType: "${resolution.credentialType}" instead of a generic credential." thrown in n8n-io/n8n.
Source
Thrown at packages/@n8n/instance-ai/src/tools/workflows/workflow-source-compiler.ts:332
context: InstanceAiContext,
): Promise<ValidationWarning[]> {
const hosts = await context.credentialService.listHttpCredentialHosts?.();
if (!hosts?.length) return [];
const index = buildCredentialHostIndex(hosts);
const warnings: ValidationWarning[] = [];
for (const node of json.nodes ?? []) {
if (node.type !== HTTP_REQUEST_NODE_TYPE) continue;
const params = node.parameters;
if (!isRecord(params) || params.authentication !== 'genericCredentialType') continue;
const url = typeof params.url === 'string' ? params.url : '';
if (!url) continue;
const resolution = resolveCredentialByUrl(url, index);
if (resolution.status === 'match') {
warnings.push({
code: 'PREFER_PREDEFINED_CREDENTIAL',
nodeName: node.name,
message: `This request targets a service with a dedicated n8n credential ("${resolution.credentialType}"). Use authentication: "predefinedCredentialType" with nodeCredentialType: "${resolution.credentialType}" instead of a generic credential.`,
});
} else if (resolution.status === 'ambiguous') {
warnings.push({
code: 'PREFER_PREDEFINED_CREDENTIAL',
nodeName: node.name,
message: `This request targets a service with dedicated n8n credentials (${resolution.candidates.join(', ')}). Prefer authentication: "predefinedCredentialType" with the matching nodeCredentialType.`,
});
}
}
return warnings;
}
export async function compileWorkflowSource(
context: InstanceAiContext,
filePath: string,View on GitHub (pinned to 5ac6606e81)
When it happens
Trigger: Thrown at packages/@n8n/instance-ai/src/tools/workflows/workflow-source-compiler.ts:332 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/76a7e0486cd20640.
Report an issue: GitHub.