ChatGPTWorkBack officeAI score · PendingAI-assisted edit · no obvious prompt-injection riskn8n.io

Generate Recipes from Fridge Photos via Telegram

Input: fridge photo or text ingredient list → Process: n8n workflow identifies ingredients and calls AI to generate recipes → Output: formatted emoji-rich recipe sent back on Telegram

Some experienceStepsWorkflowPromptTip
Who
Operators or developers with an n8n instance who want to build an AI recipe assistant on Telegram
You get
Users receive 3 complete recipes with cooking time, difficulty, and step-by-step instructions after sending a photo or text of ingredients
You need
n8n · telegram

Constraints

Prerequisites: n8n instance (self-hosted or cloud); Telegram Bot Token; OpenRouter API key (or direct OpenAI credentials). Cost: each execution calls two AI models (vision + text generation), billed per your provider's pricing. Default output language is Japanese; change it by editing the prompt in the Recipe Generator node.

What they did

Author yusuke-yamamoto published an n8n template that lets Telegram users send a fridge photo or text ingredient list, then uses AI to identify ingredients and generate 3 detailed recipes with steps, returning them in the chat. The workflow uses a dual-model architecture: a vision model for image ingredients and a text model for recipe generation, with two Structured Output Parsers to enforce stable output formats.

How it went

Published as a template on n8n.io with full node wiring and parameters shown (author_report). 647 total views at time of collection. Default output is configured for Japanese.

Worth knowing

1) AI prompts are in English but recipe output defaults to Japanese; change language by editing the prompt in the Recipe Generator node. 2) Each execution calls two AI models and incurs corresponding costs. 3) Telegram nodes can be swapped for Discord, Slack, or Webhook for other platforms. 4) Dietary restrictions (e.g., vegan, gluten-free) or recipe count can be adjusted in the Recipe Generator prompt. 5) This site has not imported or run the workflow; node parameters are taken from workflow.json; test with sample data after building.

n8n workflow template

Structure checked · Not run-tested

Use “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

  • OpenAI Vision Model node: connect openRouterApi credentials.
  • OpenAI Recipe Model node: connect openRouterApi credentials.
  • Telegram Trigger node: connect Telegram API credentials.
  • Send a text message node: connect Telegram API credentials.

Configuration to replace

  • Source template is n8n public workflow #9558 (~16 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.

Template retrieved: 2026-10-24

Steps

  1. Configure trigger and input routing

    Add a Telegram Trigger node, enable message updates, and turn on download to receive images. Then add a Check Input Type (IF) node that checks whether $json.message.text exists: if not, route to the image recognition branch; if yes, route to the text input branch.

  2. Image branch: identify ingredients

    On the image branch, add an AI Vision Agent node connected to an OpenAI Vision Model (model: openai/gpt-4-vision-preview, temperature 0.3). The agent receives the image and outputs a structured ingredient list, which is forced into JSON by an Ingredient Parser (Structured Output Parser), then converted to a comma-separated string by a Format Ingredients (Set) node.

    Execution prompt · Source text。AI Vision Agent node text parameter (user prompt)

    =Please analyze this food image and identify all visible ingredients. List them clearly.
    
    Image URL: {{ $json.body.events[0].message.id }}

    Execution prompt · Source text。AI Vision Agent node options.systemMessage parameter (system prompt)

    =You are a food ingredient identification expert. Analyze food images and identify all visible ingredients accurately. Return a structured list of ingredients.
  3. Text branch: extract ingredients

    On the text branch, add a Get Text Ingredients (Set) node that assigns $json.message.text directly to the ingredients_text field, with no AI processing needed.

  4. Generate recipes

    After both branches converge, feed into a Recipe Generator (AI Agent) node connected to an OpenAI Recipe Model (model: openai/gpt-4o-mini, temperature 0.7). The agent generates 3 recipes from the ingredient list, then a Recipe Parser (Structured Output Parser) forces the output into a JSON structure with name, cuisine, difficulty, cookingTime, servings, ingredients, and instructions.

    Execution prompt · Source text。Recipe Generator node text parameter (user prompt)

    =Based on these ingredients: {{ $json.ingredients_text }}
    
    Please suggest 3 delicious recipes that can be made with these ingredients. Consider both Japanese and international cuisine options. Text is Japanese.

    Execution prompt · Source text。Recipe Generator node options.systemMessage parameter (system prompt)

    You are a professional chef and recipe expert. Create detailed, easy-to-follow recipes based on available ingredients. Include both traditional Japanese dishes and international cuisine. Always provide cooking time, difficulty level, and step-by-step instructions.
  5. Format and send response

    Add a Format Response (Set) node that uses a JavaScript expression to convert the Recipe Parser's JSON output into an emoji-rich, readable message. Finally, add a Send a text message (Telegram) node to deliver the formatted message back to the user's chat.

  6. Configure credentials and activate

    In n8n credentials, add telegramApi (Bot Token) and openRouterApi (API Key), then bind them to the Telegram Trigger/Send a text message nodes and the OpenAI Vision Model/OpenAI Recipe Model nodes respectively. Save and activate the workflow. [First-test safety] Before the first test, disconnect or disable the Send a text message node, or temporarily set chatId to a test account; reconnect real sends only after Format Response looks correct.

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 recipe bot. First confirm they have: 1) a running n8n instance; 2) a Telegram Bot Token; 3) an OpenRouter API Key (or OpenAI API Key). Then guide them to import workflow.json or build the nodes manually, with special attention to AI Agent prompt variables, Structured Output Parser JSON Schema, and Set-node JavaScript expressions referencing upstream output fields.

Before building, confirm your n8n version supports @n8n/n8n-nodes-langchain.agent and lmChatOpenRouter nodes.

Source

Generate recipes from fridge photos using GPT-4 Vision & Telegram · yusuke-yamamoto · n8n.io · 2025-10-13

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related