Build a Telegram AI Chef Bot with n8n: Auto-Generate Recipes and Restaurant-Style Food Images
Input: Telegram dish name message → Process: n8n workflow calls OpenRouter to generate recipe and image → Output: recipe text + restaurant-plated food photo
- Who
- Operators or developers who want to provide automated recipe and food image service on Telegram
- You get
- User sends any dish name, bot replies with detailed recipe and restaurant-style plated image
Constraints
Prerequisites: n8n instance with public webhook support, Telegram Bot Token (from BotFather), OpenRouter API Key. Cost: OpenRouter pay-per-call; gemini-2.5-flash-image-preview:free is a free preview, subject to OpenRouter quotas and availability. Known limitations: Window Buffer Memory uses chat.id as sessionKey—users in the same chat share context. Image generation depends on OpenRouter free tier availability.
What they did
The author created an n8n workflow template: after a user sends a dish name via Telegram, the workflow calls an AI Agent to generate a recipe, calls a second AI Agent to convert the recipe into an image generation prompt, uses an HTTP Request node to call OpenRouter's gemini-2.5-flash-image-preview:free for image generation, extracts and converts the image format, and sends it back to the user via Telegram.
How it went
The author reports the bot replies with a full recipe and a restaurant-plated realistic image (author_report). Effectiveness not verified by this site.
Worth knowing
Window Buffer Memory uses chat.id as sessionKey, so multiple users in the same chat share memory context. The image generation node relies on an OpenRouter free preview model, so availability and output quality may vary. The HTTP Request node hardcodes Authorization: Bearer $OPENROUTER_API_KEY header format; actual runtime depends on n8n credential system variable substitution. Recommend testing the full chain with a simple dish name before public deployment.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- OpenRouter Chat Model node: connect openRouterApi credentials.
- Telegram Trigger node: connect Telegram API credentials.
- Send a text message node: connect Telegram API credentials.
- Nano 🍌 node: connect openRouterApi credentials.
- OpenRouter Chat Model1 node: connect openRouterApi credentials.
- Send a photo message node: connect Telegram API credentials.
- Replace __UKH_BEARER_4__ with your real secret/token (path /nodes/4/parameters/headerParameters/parameters/0/value; literal auth header).
Configuration to replace
- Source template is n8n public workflow #8221 (~12 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use. 1 literal secret value(s) replaced with __UKH_…__ placeholders.
Template retrieved: 2026-10-24
Steps
Import workflow and configure credentials
Import this template into your n8n instance. Go to Credentials and add telegramApi (BotFather token) and openRouterApi (OpenRouter key). Verify both credentials are bound in the workflow nodes.
Configure the AI Recipe node
Open the AI Recipe node (AI Agent type), confirm promptType is define, and text is `={{ $json.message.text }}`. Enter the following system message in Options > System Message to define the virtual chef assistant role and response style.
Execution prompt · Source text。AI Recipe node > Options > System Message field
You are a friendly and professional Virtual Chef Assistant. Your role is to help users with cooking, recipes, meal planning, food substitutions, nutrition tips, and step-by-step cooking guidance. Guidelines: - Always reply in a clear, simple, and conversational tone. - Suggest recipes based on available ingredients, dietary preferences, or cuisine styles. - Provide step-by-step cooking instructions when asked. - Offer ingredient substitutions if something is missing. - Give nutrition advice when relevant, but do not provide medical advice. - Be creative, encouraging, and make cooking feel fun and easy. - If the user asks for meal plans, suggest balanced options (breakfast, lunch, dinner, snacks). - If the user asks general questions about food or cooking techniques, explain in an easy-to-understand way. - Do not provide unsafe cooking practices or harmful instructions. Your personality: - Warm, supportive, and encouraging like a personal chef. - Use a mix of professional cooking knowledge and friendly conversation. - Adapt tone depending on user: beginner = simple steps, experienced = more advanced techniques.
Configure the Restaurant-Style Plating prompt node
Open the Restaurant-Style Plating prompt node (AI Agent type), confirm promptType is define, and text is `={{ $('AI Recipe').item.json.output }}` to receive the recipe text. Enter the following system message in Options > System Message to convert recipes into image generation prompts.
Execution prompt · Source text。Restaurant-Style Plating prompt node > Options > System Message field
You are an expert AI prompt generator for text-to-image models. Your task is to read the recipe text provided and generate a single, clear, and detailed prompt suitable for a photorealistic image generation AI. Do not explain the recipe, do not add extra commentary, and do not output anything else except the image prompt. Focus only on visual details: - How the dish looks on a plate - Plating style and arrangement - Colors, textures, garnishes - Lighting and perspective - Use only plates and dishware typically found in professional restaurants (white ceramic, slate, glass, or elegant serving dishes) - Make it look like a high-end restaurant presentation The output should be concise, a single paragraph of text, fully descriptive, ready to feed directly into an image generation model and output should be in English.
Configure image generation and file conversion chain
Verify the Nano 🍌 node (HTTP Request) is set to POST https://openrouter.ai/api/v1/chat/completions with model google/gemini-2.5-flash-image-preview:free, sending the recipe text as image generation prompt. The Edit Fields node extracts image_url.url, base64 data, MIME type, and filename from the response. The Convert to File node transforms the base64 string into binary for Telegram delivery.
Activate and test
Save and activate the workflow. Send any dish name to your bot on Telegram (e.g., Polpette di pesce). You should receive: 1) a detailed recipe text message; 2) a restaurant-plated food photo. If no image arrives, check OpenRouter free tier availability and n8n execution logs.
Prompt you can copy
Setup guidance · Editorial suggestion。Give to setup assistant; confirm inputs and permissions first
This block is the prompt. Ads are never placed here.
You are an n8n workflow setup assistant. The user wants to replicate a Telegram AI chef bot. First confirm they have: 1) an n8n instance that can receive webhooks; 2) a Telegram Bot Token; 3) an OpenRouter API Key. Then guide them step by step to import the template, configure credentials, paste the system messages, and activate for testing. Do not generate or modify prompt content for the user—use only the source-provided originals.
Before building, confirm your n8n instance supports webhooks and you have both Telegram Bot Token and OpenRouter API Key
Source
Generate custom recipes and restaurant-style food images with Telegram bot · shishirislam80 · n8n.io · 2025-09-03
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.