AI Recipe Finder using API Ninjas - n8n Workflow

Learn how to deploy a powerful n8n workflow featuring an AI Agent that automatically fetches recipes from API Ninjas. Utilize this n8n template for conversational AI routing.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Automation specialists looking for advanced conversational AI n8n templates.
Developers building specialized chatbots or personalized assistants.
Users who need to demonstrate tool-use capabilities within an n8n workflow.
Anyone seeking a practical example of the LangChain Agent n8n node implementation.

Overview

This n8n workflow showcases how to build a highly functional AI agent capable of routing specific user queries to specialized tools. Instead of relying solely on the LLM's general knowledge, this setup ensures that when a user asks for a recipe, the AI Agent efficiently invokes the dedicated Recipe Tool - Fetch from API Ninjas n8n node. This dramatically improves accuracy and reliability for domain-specific tasks. By leveraging this n8n template, users can quickly deploy complex, multi-step conversational processes, making this a crucial n8n workflow for anyone exploring custom AI solutions. The core value of this n8n node architecture lies in its ability to maintain context via memory while intelligently deciding whether to generate a response or execute an external API call.

How it Works

This powerful n8n workflow is initiated by a specific n8n trigger designed for conversational interfaces.


  1. Trigger Initiation: The process begins with the Chat Trigger - Receive Message n8n trigger, which activates the n8n workflow upon receiving an incoming message from the integrated chat service.

  2. Context Maintenance: The message is first passed through the Memory - Recent Messages (Window) n8n node, ensuring the AI agent retains short-term conversational context.

  3. Intelligent Routing: The central AI Agent - Route to Tools n8n node receives the message and decides the next action. It is specifically configured with a system message instructing it to prioritize the dedicated recipe tool if the query relates to recipes.

  4. Tool Execution (If needed): If the agent detects a recipe request, it calls the Recipe Tool - Fetch from API Ninjas n8n node. This tool extracts the food item specified in the chat and uses it as a query parameter in the API Ninjas request.

  5. LLM Processing: The LLM - OpenAI Chat n8n node is connected to the Agent. Whether the agent uses the tool or not, the LLM processes the final input (or the tool's output) and synthesizes a clear, natural language response before sending it back to the chat user, completing the cycle of the n8n workflow.

Installation Guide

To successfully deploy this advanced n8n workflow, you will need to set up two critical credentials:


  1. Importing the n8n Template: Copy the provided JSON and import it directly into your n8n instance.

  2. OpenAI Credential Setup: Open the LLM - OpenAI Chat n8n node. You must connect your OpenAI API key to enable the language model capabilities. This is essential for the primary functionality of the AI agent.

  3. API Ninjas Credential Setup: Access the Recipe Tool - Fetch from API Ninjas n8n node. This node requires an HTTP Header Authentication credential containing your API Ninjas API key, ensuring the tool can successfully call the external recipe service. This completes the setup required for this specialized n8n workflow.

Node Details

This n8n workflow uses several specialized LangChain and utility n8n nodes:

Chat Trigger - Receive Message (n8n trigger): The starting point of the n8n workflow. It monitors for new messages in the connected chat platform, initiating the AI interaction.
Memory - Recent Messages (Window): A LangChain memory n8n node that stores a rolling window of recent messages, providing the agent with essential short-term conversational history.
AI Agent - Route to Tools: The core decision-making n8n node. It analyzes the user input, consults the memory, and determines whether to directly answer via the LLM or route the query to the available Recipe Tool.
LLM - OpenAI Chat: The language model provider, configured here using GPT-5 Mini. It handles natural language understanding, response generation, and synthesis of results returned by the tool n8n node.


  • Recipe Tool - Fetch from API Ninjas (n8n node): A specialized HTTP Request Tool. This n8n node is called by the agent specifically to query the API Ninjas recipe endpoint, using the user's requested food item as the query parameter.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by

We help you eliminate the busywork by building compact business tools tailored to your processes. 📞: https://smoothwork.ai/book-a-call ▶️: https://www.youtube.com/@vasarmilan

Featured*