n8n-io/n8n · warning

FROM_AI_IN_NON_TOOL

FROM_AI_IN_NON_TOOL

Error message

'${node.name}' uses $fromAI() which is only valid in tool nodes connected to an AI agent.

What it means

Warning-level validator issue (code FROM_AI_IN_NON_TOOL, violationLevel 'major') emitted when a non-tool node uses $fromAI() in its parameters. $fromAI() is only valid inside tool nodes connected to an AI agent, where it lets the agent supply values dynamically. Using it elsewhere has no runtime backing and will not behave as expected.

Source

Thrown at packages/@n8n/workflow-sdk/src/workflow-builder/plugins/validators/from-ai-validator.ts:43

		_graphNode: GraphNode,
		_ctx: PluginContext,
	): ValidationIssue[] {
		const issues: ValidationIssue[] = [];

		// $fromAI is valid in tool nodes
		if (isToolNode(node.type)) {
			return issues;
		}

		const params = node.config?.parameters;
		if (!params) {
			return issues;
		}

		// Recursively search for $fromAI in all parameter values
		if (containsFromAI(params)) {
			issues.push({
				code: 'FROM_AI_IN_NON_TOOL',
				message: `'${node.name}' uses $fromAI() which is only valid in tool nodes connected to an AI agent.`,
				severity: 'warning',
				violationLevel: 'major',
				nodeName: node.name,
			});
		}

		return issues;
	},
};

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Move the $fromAI() usage into a tool node that is connected to an AI agent.
  2. If the node must be a tool, change its type to a recognized tool node (isToolNode true).
  3. Replace $fromAI() with a concrete value or a $json expression for non-tool nodes.

Example fix

// before
httpRequest({ url: '={{ $fromAI("endpoint") }}' }) // not a tool
// after
// wrap as a tool connected to an agent
toolNode({ url: '={{ $fromAI("endpoint") }}' })
Defensive patterns

Strategy: validation

Validate before calling

import { isToolNode } from '@n8n/workflow-sdk';

function containsFromAI(value: unknown): boolean {
  return typeof value === 'string' && /\$fromAI\s*\(/.test(value);
}
if (!isToolNode(node.type) && containsFromAI(node.config?.parameters)) {
  // warn: $fromAI only valid in tool nodes
}

Prevention

When it happens

Trigger: Adding '={{ $fromAI("x") }}' to a regular node (e.g. HTTP Request, Set) that is not a tool; copying a tool-only expression into a non-tool node.

Common situations: LLM-generated workflows that sprinkle $fromAI everywhere; misunderstanding that $fromAI requires a tool+agent context; refactoring that moved an expression out of a tool.

Related errors


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