Telegram Fitness Bot: Custom Workout Plans from Photo/Text via Gemini AI
User sends photo or message via Telegram → n8n routes by type → Gemini AI analyzes and generates a 7-day workout plan → formatted and sent back via Telegram
- Who
- Fitness coaches, personal trainers, developers automating client workout plans, and startups building virtual fitness assistants or health engagement tools
- You get
- Users receive a personalized 7-day workout plan in Telegram-compatible HTML after sending a full-body photo or message, powered by Gemini AI analysis
Constraints
Prerequisites: Telegram Bot Token with messaging and file permissions; Google Gemini API access with image and language model capabilities; n8n instance (cloud or self-hosted); basic knowledge of LangChain and n8n AI nodes. Boundaries: after importing the template, you must manually configure node parameters (prompts, credentials, routing rules) in the n8n UI; workflow.json contains empty parameter objects and does not include verbatim prompts.
What they did
Template author parthpansuriya built a Telegram fitness bot workflow in n8n. When users send a full-body photo or text message to the Telegram bot, the workflow routes via a Switch node: the text path uses a LangChain AI Agent (connected to Google Gemini Chat Model and Simple Memory) to ask fitness questions and generate a 7-day workout plan; the photo path downloads the image, adjusts MIME type, analyzes body characteristics via Google Gemini vision model, then generates a plan through another AI Agent. Both paths finally format the output via Code nodes into Telegram HTML and send it back to the user.
How it went
The author claims this template supports virtual fitness coaching, AI-powered personal training assistants, and health engagement bot scenarios, generating personalized 7-day workout plans delivered in Telegram HTML format based on user input (author_report, unverified).
Worth knowing
1. Node prompts not disclosed: all nodes in workflow.json have empty parameter objects; AI Agent system prompts, Code node scripts, and Switch routing rules must be manually configured after import. 2. Credential requirements: Telegram Bot Token must include file download permissions for the photo path; Gemini API needs image and language model access. 3. Message splitting: the author mentions plans are split as needed to fit Telegram message size limits, but the specific splitting logic is not shown in the source. 4. Extension suggestions: the author suggests modifying LangChain prompts for coaching tone, adding PDF export, Cron reminders, and streak tracking—these are extension directions from the template description, not core workflow components. 5. Not tested by this site: reproduction=not_tested; actual results may vary based on prompt writing, credential configuration, and model version.
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
- After import, connect your own credentials on auth-required nodes; author secrets are not included.
Configuration to replace
- Source template is n8n public workflow #6697 (~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-25
Steps
Import template and configure credentials
Import template ID 6697 into n8n. Add credentials: 1) Telegram Bot credential (enter Bot Token, ensure messaging and file permissions are enabled); 2) Google Gemini API credential (enter API Key, enable image and language model access). Save and test both connections.
Configure Telegram trigger and routing
Open the 'Receive a Message' Telegram Trigger node, select the saved Telegram credential, and set it to trigger on incoming messages. Open the 'Text Vs Photo' Switch node and configure routing rules: path 1 (text) connects to the 'Workout Guide' AI Agent; path 2 (photo) connects to the 'Get a Image' Telegram node. Verify connections match those in workflow.json.
Configure text path: AI Agent generates workout plan
Open the 'Workout Guide' AI Agent node (type: @n8n/n8n-nodes-langchain.agent, version 2.1). In the Language Model dropdown, select the 'Google Gemini Chat Model1' node (lmChatGoogleGemini); in the Memory dropdown, select the 'Simple Memory' node (memoryBufferWindow). In the Agent's System Prompt, configure a fitness coaching role prompt (source does not provide verbatim text; write your own based on coaching tone). Once configured, this node will ask fitness questions (age, goals, activity level) based on user text input and generate a 7-day workout plan.
Execution prompt · Editorial suggestion。n8n AI Agent node System Prompt field; adjust based on actual coaching tone
Source does not provide the verbatim system prompt for this node. Configure the n8n AI Agent node's System Prompt field yourself, for example setting the role as a professional fitness coach, requesting the user's age, fitness goals, and current activity level, then generating a 7-day personalized workout plan in Telegram-compatible HTML.
Configure photo path: download, analyze, and generate plan
Open the 'Get a Image' Telegram node, select the same Telegram credential, and configure it to download images sent by users. The subsequent 'Fetch Image Path' HTTP Request node retrieves the image URL; the 'Change Mime Type' Code node adjusts the MIME type for Gemini vision input; the 'Analyze image' Google Gemini node (googleGemini) analyzes body type, posture, and muscle tone. Finally, the 'Workout Guide thorugh Image' AI Agent node (connected to Google Gemini Chat Model and Simple Memory) generates a workout plan based on the analysis.
Execution prompt · Editorial suggestion。n8n Code node code field; test with actual input format
Source does not provide the verbatim code for the 'Change Mime Type' Code node. Write JavaScript in the n8n Code node to adjust the input image's MIME type to a format accepted by the Gemini vision API (e.g., image/jpeg or image/png), and output the adjusted binary data or URL.
Execution prompt · Editorial suggestion。Google Gemini node prompt field; test image input compatibility
Source does not provide the verbatim prompt for the 'Analyze image' node. Configure the Google Gemini node with a vision analysis instruction asking the model to analyze body type, posture, and muscle tone from the input image, and output structured observations for the downstream AI Agent.
Format output and send back via Telegram
Text path: the 'Clean up Workout plane and Make User freindly And Visually appealing' Code node formats the AI Agent output into Telegram-compatible HTML, splitting long messages if needed to fit Telegram message size limits; then the 'Send A Workout Planes' Telegram node delivers it to the user. Photo path: the 'Clean up Workout plane and Make User freindly And Visually appealing1' Code node performs the same cleanup, and the 'Send A Workout Planes1' Telegram node sends the result.
Execution prompt · Editorial suggestion。n8n Code node code field; test split logic with sample data
Source does not provide the verbatim code for the cleanup Code nodes. Write JavaScript in the n8n Code node to convert the AI-generated workout plan text into Telegram HTML format (supporting <b>, <i>, <code> tags), and split into multiple messages according to Telegram's message length limit (4096 characters).
Prompt you can copy
Setup guidance · Editorial suggestion。Hand to setup assistant; confirm input credentials and permissions before configuring nodes step by step
This block is the prompt. Ads are never placed here.
You are assisting with reproducing n8n template 6697: Telegram Fitness Bot. First confirm you have a Telegram Bot Token (with messaging and file permissions) and a Google Gemini API Key, then import the template, configure credentials, set routing rules, and write fitness coaching system prompts in the AI Agent nodes. Note: the template does not provide verbatim node prompts or code; you must write and test them yourself.
Before starting, ensure your Telegram Bot has file download permissions enabled and your Gemini API Key has access to both image and language models.
Source
Telegram fitness bot: Custom workout plans from photo/text using Gemini AI · parthpansuriya · n8n.io · 2025-07-30
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.