AI Recipe Generator for Telegram (Image and Text Input) - n8n Workflow

Automate recipe creation from fridge photos or text using an advanced n8n workflow powered by GPT-4 Vision. Get structured, categorized recipes instantly via Telegram.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Developers looking for complex n8n templates integrating vision AI and structured output parsing.
Users wanting a smart kitchen assistant accessible instantly via Telegram.
Automation experts building conversational n8n applications.
Anyone seeking practical use cases for the n8n node ecosystem and advanced AI orchestration.

Overview

This is a powerful, dual-path n8n workflow demonstrating advanced AI integration for culinary automation. It solves the common problem of looking into the fridge and wondering what to cook based on available items. A user can simply send a photo of their ingredients or a list of ingredients via Telegram.

The core of this n8n workflow handles two primary scenarios: if an image is sent, it routes to GPT-4 Vision for ingredient extraction; if text is sent, it uses the text directly. The subsequent steps utilize dedicated AI agents and n8n nodes to generate structured, professional recipes, ensuring a high-quality, reliable, and readable response delivered back to the user via the Telegram n8n node. This particular n8n template highlights the flexibility of n8n in orchestrating complex, multimodal inputs and ensuring structured AI outputs.

How it Works

This highly flexible n8n workflow executes a four-phase process to turn a user input into a set of structured recipes:


  1. Trigger and Input Routing: The process begins with the Telegram Trigger, which acts as the primary n8n trigger, activating upon receiving any message or image. The subsequent Check Input Type n8n node uses an IF condition to determine if text is present. If text is missing, the flow assumes an image was sent and routes to the Vision AI path.

  2. Ingredient Extraction (Dual Path):

Image Path: If an image is detected, the AI Vision Agent utilizes the OpenAI Vision Model to analyze the photo and identify ingredients. The subsequent Ingredient Parser n8n node ensures this unstructured vision output is converted into a strict JSON list of ingredients, which is then formatted by the Format Ingredients n8n node into a single comma-separated string.
Text Path: If text is detected, the Get Text Ingredients n8n node simply takes the user's message and stores it as the standardized ingredient string.

  1. Recipe Generation: Both paths merge into the Recipe Generator n8n node. This LangChain agent uses the OpenAI Recipe Model (GPT-4o Mini) and a custom system prompt to act as a chef, creating three detailed recipes based on the available ingredients. The subsequent Recipe Parser is critical; it forces the creative output into a predictable JSON schema (including instructions, cooking time, and difficulty) for reliable formatting.

  2. Response Delivery: The Format Response n8n node uses a custom JavaScript expression to transform the structured recipe JSON into an aesthetically pleasing, localized (Japanese in this case), and easy-to-read message for the user. Finally, the Send a text message Telegram n8n node sends the complete, structured recipe guide back to the original chat ID, completing the n8n workflow.

Installation Guide

To use this n8n workflow, follow these steps:


  1. Import the n8n template: Copy the provided JSON data and paste it directly into your n8n canvas using the 'New' > 'Import from JSON' option.

  2. Telegram Setup: Create a new Telegram Bot via BotFather and obtain the API Token. Configure the Telegram Trigger n8n node and the Send a text message n8n node using this credential.

  3. AI Credentials: This n8n workflow is configured to use OpenRouter (a router service for LLMs), but it utilizes OpenAI models (GPT-4 Vision and GPT-4o Mini). You must configure the OpenRouter API credential in the respective OpenAI Vision Model and OpenAI Recipe Model n8n nodes. Alternatively, you can swap these n8n nodes for native OpenAI Chat nodes if you prefer direct configuration.

  4. Activate: Save the n8n workflow and click 'Activate' to set the Telegram Trigger webhook.

Node Details

Telegram Trigger (n8n trigger): Starts the n8n workflow when a message or photo is received in the linked Telegram chat. It is configured to download files, enabling image processing.
Check Input Type (If n8n node): A critical flow control element. It checks for the existence of {{ $json.message.text }} to decide between the image processing path (no text) and the text processing path (text present).
AI Vision Agent (LangChain Agent n8n node): Manages the vision task. It is configured with a system message to identify ingredients and uses the image ID from the Telegram trigger as the input URL for analysis.
OpenAI Vision Model (LangChain LM n8n node): The large language model responsible for image analysis (GPT-4 Vision). It requires OpenRouter credentials.
Ingredient Parser (LangChain Output Parser n8n node): Forces the AI's image analysis output into a standardized JSON array containing the identified ingredients.
Recipe Generator (LangChain Agent n8n node): The core AI component for creation. It acts as a professional chef, taking the ingredient list and generating detailed recipe ideas.
Recipe Parser (LangChain Output Parser n8n node): Essential for reliability. It forces the generated recipes into a complex, predictable JSON structure, ensuring all necessary fields (name, instructions, cooking time) are present before final formatting.
Format Response (Set n8n node): Uses a complex JavaScript expression to iterate over the structured recipe JSON and format it into a single, highly readable Markdown message, ready for Telegram delivery.

Related n8n Workflows

Free

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

Business creator from Tokyo. Designing AI-driven automations that enhance marketing, reporting, and daily operations. I turn complex workflows into simple, elegant automations with n8n.

Featured*