ClaudeLife adminHealthAI score · PendingAI-assisted edit · no obvious prompt-injection riskn8n.io

Build a Fitness & Nutrition Coach Bot on Telegram with Claude

Telegram message (including voice) → n8n transcription and normalization → Claude Agent calling Google Sheets/Calendar for logging and planning → Telegram reply

Some experienceStepsWorkflowPromptTip
Who
Individuals or small teams who want an automated fitness and nutrition coach inside Telegram
You get
Chat or voice-message an AI coach to log workouts, meals, weight and weekly plans, and optionally schedule sessions into Google Calendar
You need
n8n · telegram

Constraints

Prerequisites: n8n instance; Telegram BotFather token; Anthropic API key; OpenAI API key; Google account with Sheets + Calendar OAuth2. Cost: pay-per-use for each API; Google APIs have free tiers. Boundaries: default French prompt and UI, changeable in the Configuration node; voice transcription limited to OpenAI Whisper-supported languages; all user data lives in one Google Sheets workbook, separated by id_telegram.

What they did

Template author drfiras built an n8n workflow that turns a Telegram bot into a fitness and nutrition coach. It uses OpenAI Whisper for voice transcription, a Claude Agent with session memory to interpret requests, and Google Sheets as the database for profiles, workout history, nutrition logs and weekly plans, with Google Calendar for scheduling sessions.

How it went

The author reports (author_report) that the template can receive Telegram text or voice messages, transcribe audio, let the Claude Agent call the appropriate tools per its system prompt rules, and send the coaching reply back to Telegram. Published on n8n.io; no independent performance or accuracy benchmarks provided.

Worth knowing

The default system prompt is in French and the coaching style is fixed to growth mindset; changing language requires updating both the Configuration node and the prompt variable. Transcription quality depends on the OpenAI Whisper language setting. All user data lives in a single Sheets workbook, isolated by id_telegram, with no multi-tenant access controls. The Google Sheets documentId in the template is empty (cachedResultName is a placeholder), so you must manually select the real spreadsheet in every node after import. Calendar event creation relies on the Agent generating correct ISO 8601 timestamps, which carries a risk of formatting errors. This site has not tested the workflow (reproduction=not_tested).

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

  • Receive Telegram message node: connect Telegram API credentials.
  • Download voice message node: connect Telegram API credentials.
  • Transcribe voice with OpenAI node: connect OpenAI API credentials.
  • Read user profile node: connect Google Sheets OAuth2 credentials.
  • Update user profile node: connect Google Sheets OAuth2 credentials.
  • Log workout session node: connect Google Sheets OAuth2 credentials.
  • Read workout history node: connect Google Sheets OAuth2 credentials.
  • Log meal in nutrition journal node: connect Google Sheets OAuth2 credentials.
  • Read today meals node: connect Google Sheets OAuth2 credentials.
  • Save weekly nutrition plan node: connect Google Sheets OAuth2 credentials.
  • Save weekly training plan node: connect Google Sheets OAuth2 credentials.
  • Read weekly training plan node: connect Google Sheets OAuth2 credentials.
  • Create workout event in Calendar node: connect Google Calendar OAuth2 credentials.
  • Send coach reply on Telegram node: connect Telegram API credentials.

Configuration to replace

  • Source template is n8n public workflow #16969 (~26 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

  1. Receive and route messages

    In n8n, configure a Telegram Trigger node with updates: message and a telegramApi credential from BotFather. Add a Configuration Set node with coach_language, transcription_language, date_format, and memory_context_length. Add an If node that checks whether $json.message.voice.file_unique_id is not empty to branch voice notes from text.

  2. Transcribe voice and normalize fields

    For voice messages: use a Telegram node to download the audio file (file_id from the trigger message), then an OpenAI node to transcribe it (resource: audio, operation: transcribe, language referencing Configuration.transcription_language). Then a Set node (Normalize user message) standardizes four fields: user_message (text or transcript), chat_id, current_date (formatted per date_format), and weekday (French weekday name). Text messages flow directly to normalization.

  3. Run the AI coach agent

    Add an AI Agent node (type: @n8n/n8n-nodes-langchain.agent), promptType: define, text referencing $json.user_message. Connect Claude Chat Model (lmChatAnthropic, model: claude-sonnet-4-6) to ai_languageModel; connect Session memory (memoryBufferWindow, sessionKey set to chat_id, contextWindowLength referencing Configuration) to ai_memory. Paste the following systemMessage in full into the agent.

    Execution prompt · Source text。AI fitness coach agent node's systemMessage field (promptType: define)

    =# RÔLE
    Tu es un coach sportif personnel et expert en nutrition. Tu accompagnes l'utilisateur vers ses objectifs de forme avec un suivi rigoureux, personnalisé et bienveillant. Tu t'exprimes TOUJOURS en {{ $('Configuration').item.json.coach_language === 'French' ? 'français' : $('Configuration').item.json.coach_language }}, sur un ton motivant, professionnel et exigeant.
    
    # POSTURE : ÉTAT D'ESPRIT DE DÉVELOPPEMENT
    Tu adoptes en permanence une mentalité de développement (growth mindset). Cette posture PRIME sur le ton motivant : tu restes exigeant et honnête, jamais flatteur.
    - Quand l'utilisateur rate une séance ou stagne, ne le rassure pas à vide. Extrais la leçon concrète et donne la prochaine action précise. Un échec est une donnée, pas un verdict.
    - Reformule tout « je n'y arrive pas » en « pas ENCORE », et montre le chemin.
    - Félicite le PROCESSUS : effort, régularité, méthode. Ne félicite JAMAIS un talent supposé.
    - Quand l'utilisateur se dévalorise, consulte Read workout history pour lui rappeler des preuves concrètes de sa progression, puis recentre-le sur la prochaine action.
    
    # TES OUTILS
    - Read user profile : lire le profil (poids, objectif, niveau, blessures).
    - Update user profile : modifier une donnée du profil (usage strict, voir règle de sécurité).
    - Log workout session : enregistrer une séance réalisée.
    - Read workout history : consulter l'historique des séances.
    - Log meal in nutrition journal : enregistrer un repas consommé.
    - Read today meals : lire les repas du jour pour un bilan.
    - Save weekly nutrition plan : créer/mettre à jour le plan de repas et la liste de courses.
    - Save weekly training plan : créer/mettre à jour le programme de la semaine.
    - Read weekly training plan : consulter le programme de la semaine.
    - Create workout event in Calendar : planifier une séance dans l'agenda.
    
    # CONNAISSANCE DE L'UTILISATEUR
    - Avant tout conseil personnalisé, consulte Read user profile.
    - Tiens TOUJOURS compte des blessures : adapte les exercices pour ne jamais les aggraver.
    
    # ENREGISTREMENT DES DONNÉES
    - Séance terminée rapportée (exercice, charge, répétitions) : utilise Log workout session.
    - REPAS, RÈGLE DE QUANTITÉ : AVANT d'estimer les macros, vérifie que la quantité est exploitable (grammes ou portions concrètes). Si elle est absente ou trop vague, DEMANDE la quantité et N'ENREGISTRE RIEN tant que tu ne l'as pas. Une fois la quantité connue, estime calories et macros puis utilise Log meal in nutrition journal. Dans ta confirmation, indique la quantité retenue comme base de calcul.
    - Confirme tout enregistrement de manière brève et valorisante (processus, pas talent).
    
    # PLANS DE LA SEMAINE
    - Plan de repas demandé : rédige-le et enregistre-le avec Save weekly nutrition plan.
    - Programme d'entraînement demandé : rédige-le et enregistre-le avec Save weekly training plan.
    - Ces plans REMPLACENT le précédent. Après enregistrement, confirme simplement.
    
    # MODIFICATION DU PROFIL (RÈGLE DE SÉCURITÉ STRICTE)
    - N'utilise Update user profile QUE si l'utilisateur demande EXPLICITEMENT de modifier une donnée.
    - Ne modifie QUE le champ demandé. JAMAIS de ta propre initiative.
    
    # MISE EN FORME DES PLANS
    - Texte simple (jamais de HTML ni de Markdown), très aéré : une ligne vide entre sections et jours, titres en MAJUSCULES avec un emoji, un élément par ligne commençant par « • », liste de courses groupée par catégorie.
    
    # MESSAGES VOCAUX
    - Les messages peuvent venir de transcriptions audio : ignore les fautes propres à l'oral, concentre-toi sur l'intention.
    
    # STYLE DE RÉPONSE
    - Réponses claires, aérées, adaptées à Telegram. Termine souvent par une question ouverte.
    
    Date actuelle : {{ $json.current_date }}
    Jour de la semaine : {{ $json.weekday }}
  4. Manage records in Google Sheets and Calendar

    Connect the following tool nodes as ai_tool inputs to the AI Agent: Read user profile (profil sheet, filter by id_telegram), Update user profile (update, only explicitly requested fields), Log workout session (append to historique), Read workout history (filter historique by id_telegram), Log meal in nutrition journal (append to nutrition, requires quantity), Read today meals (filter nutrition by id_telegram + date), Save weekly nutrition plan (appendOrUpdate plan_nutrition), Save weekly training plan (appendOrUpdate plan_sport), Read weekly training plan (filter plan_sport by id_telegram), Create workout event in Calendar (Google Calendar Tool, needs ISO start/end). All Sheets nodes share the same documentId (cachedResultName: AI fitness coach data); you must create the 5 tabs with correct columns beforehand and select the real spreadsheet in every node after import.

  5. Send the coach reply

    Add a Telegram node (resource: message, operation: sendMessage), set chatId to the normalized chat_id, text to the AI Agent output $json.output, and appendAttribution to false. Use the same telegramApi credential.

Prompt you can copy

Setup guidance · Editorial suggestion。Hand to a setup assistant; confirm inputs and permissions first

This block is the prompt. Ads are never placed here.

You are building an n8n workflow: a Telegram fitness-coach bot. Before starting, confirm you have: 1) a Telegram BotFather token; 2) an Anthropic API key; 3) an OpenAI API key; 4) Google OAuth2 for Sheets and Calendar; 5) a Google Sheets workbook with the 5 required tabs and columns. Then import the workflow.json or rebuild the nodes manually, checking that Configuration variables, the AI Agent systemMessage, and every Sheets/Calendar tool target the correct documents.

Create the 5 Google Sheets tabs and verify column names before importing; if you change the language from French, update both Configuration.coach_language and the prompt language variable.

Source

Coach fitness and nutrition on Telegram with Claude, Google Sheets and Calendar · drfiras · n8n.io · 2026-07-10

Comments & feedback

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

Loading…

    Related