What it does
A small n8n example of a conversational AI agent that uses a custom tool written in JavaScript. The sample tool returns a random color and excludes any colors the user names. It shows how to give an agent your own code to call. Requires n8n 1.19.4 or later.
Use cases
- 01Learn the pattern for adding a code tool to an agent
- 02Replace the sample code with your own business logic
- 03Test how an agent decides when to call a tool
Connects
AI Agent · OpenAI Chat Model · Code Tool