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

Auto-track daily habits and mood in n8n, generate weekly AI insights

Daily form → Google Sheets storage → weekly scheduled aggregation → LLM-powered personal analysis and next-week experiment → Gmail report

Some experienceStepsWorkflowPromptTip
Who
Individuals who want to track mood, sleep, exercise, and habits daily and receive a data-driven weekly feedback report
You get
Automatically roll up daily check-ins into a weekly analysis that identifies best/hardest day patterns and outputs one actionable small experiment for the next week
You need
n8n · google-sheets · gmail · openai · schedule

Constraints

Requires an n8n instance (self-hosted or cloud) and three credentials: Google Sheets OAuth2, Gmail OAuth2, and an OpenAI-compatible API (configured in the template as Groq). You must create two sheets in Google Sheets (daily_entries and weekly_reports) with exact column names matching the template. Some prior n8n experience is recommended.

What they did

The source template by missylearnsai is a dual-branch n8n workflow. The Daily Check-in Branch collects daily data via an n8n Form (mood, energy, stress, focus, sleep hours/quality, exercise minutes, meditation, deep work hours, social connection, screen time, caffeine after 2pm, alcohol, note, gratitude), normalizes field labels with a Set node, calculates wellbeing_score, habit_score, risk_flag, tags, and tiny_suggestion in a Code node (Calculate Daily Scores), appends the row to a Google Sheets daily_entries tab, and sends either a standard or supportive confirmation email via Gmail based on the risk_flag. The Weekly Insights Branch triggers on a schedule (default Monday 9 AM), reads all entries from Google Sheets, filters the previous Monday–Sunday week in a Code node (Calculate Weekly Analytics) that computes averages, identifies best/hardest days, and detects five pattern contrasts (exercise-mood, sleep-focus, meditation-stress, late caffeine-sleep quality, deep work-focus). An If node checks for at least 3 entries; if insufficient, it sends a "not enough data" email. If sufficient, the weekly data is passed to a Basic LLM Chain node connected to an OpenAI Chat Model (via Groq, default llama-3.1-8b-instant), which runs a detailed coaching prompt that returns a JSON object with headline, core_insight, leverage_point, watchout, next_experiment, and reflection_question. A Parse AI Reflection JSON Code node extracts and cleans the LLM output, then the workflow appends the report to the weekly_reports sheet and sends a formatted HTML weekly insights email via Gmail.

How it went

The author reports this template turns simple daily check-ins into a weekly personal analytics report with pattern detection and one small experiment for the next week (author_report). The template includes 35 nodes covering form trigger, code computation, conditional branching, Google Sheets read/write, Gmail send, schedule trigger, LLM Chain with model call, JSON parsing, and HTML email composition.

Worth knowing

1. This workflow is for personal reflection only and does not provide medical advice, mental health diagnosis, or crisis support; wellbeing_score and habit_score are non-clinical personal analytics scores. 2. If you edit the Basic LLM Chain prompt, keep the returned JSON structure identical unless you also update the Parse AI Reflection JSON node and the email template. 3. The template defaults to Groq's llama-3.1-8b-instant via an OpenAI-compatible endpoint; you may substitute another model, but verify compatibility with maxTokens=400 and temperature=0.3. 4. Scoring logic (wellbeing and habit weights, risk thresholds) is fully exposed in the Calculate Daily Scores JavaScript and can be directly adjusted. 5. This site has not executed or verified the workflow (reproduction=not_tested); after building, always test both the daily branch and the weekly branch as the author recommends.

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

  • Append Daily Entry node: connect Google Sheets OAuth2 credentials.
  • Send Supportive Confirmation node: connect Gmail OAuth2 credentials.
  • Send Normal Confirmation node: connect Gmail OAuth2 credentials.
  • Get Daily Entries node: connect Google Sheets OAuth2 credentials.
  • OpenAI Chat Model node: connect OpenAI API credentials.
  • Send Not Enough Data Message node: connect Gmail OAuth2 credentials.
  • Append Weekly Report node: connect Google Sheets OAuth2 credentials.
  • Email Weekly Insights node: connect Gmail OAuth2 credentials.

Configuration to replace

  • Source template is n8n public workflow #15948 (~35 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. Create the Google Sheets data tables

    Create a new spreadsheet in Google Sheets with two tabs: daily_entries and weekly_reports. Enter the required column names (e.g., entry_id, date, mood, energy, wellbeing_score, etc.) exactly as specified so n8n can auto-map fields when appending rows.

  2. Configure credentials and import the workflow

    In n8n, set up three credentials: 1) Google Sheets OAuth2; 2) Gmail OAuth2; 3) OpenAI-compatible API (e.g., Groq). Then import this workflow from the n8n template library (ID 15948) or by importing the workflow.json file directly.

  3. Fill in spreadsheet IDs and recipient email addresses

    Open each Google Sheets node and replace YOUR_GOOGLE_SHEET_ID_PLACEHOLDER with your actual spreadsheet ID, confirming that the daily_entries and weekly_reports tab names match. Open all Gmail nodes and replace YOUR_EMAIL_ADDRESS_PLACEHOLDER with your recipient email address.

  4. Configure the LLM node and model

    Open the OpenAI Chat Model node and confirm an available chat model is selected (the template defaults to llama-3.1-8b-instant via Groq; you may swap in another OpenAI-compatible model). Open the Basic LLM Chain node to review the prompt text. If you want to change the coaching style, you may edit the prompt, but you must keep the returned JSON structure unchanged unless you also update the Parse AI Reflection JSON node and the email template.

    Execution prompt · Source text。Basic LLM Chain node text/prompt field

    =You are a personal analytics coach for a habit and mood journal.
    
    Your job is to generate one useful weekly insight and one small experiment for next week.
    
    The weekly scorecard is already visible in the email. Do not summarize it.
    
    Your response should feel grounded, warm, light, specific, practical, and non-judgmental.
    
    Do not sound like:
    - a therapist
    - a productivity guru
    - a generic wellness newsletter
    - a dashboard narrator
    
    Use only the data provided below. Do not invent causes, routines, emotions, events, schedules, or explanations.
    
    Allowed tracked habits and conditions:
    sleep duration, sleep quality, exercise/movement, meditation, deep work, focus, stress, mood, energy, social connection, screen time, caffeine after 2pm, alcohol.
    
    Do not recommend actions outside the allowed tracked habits and conditions.
    
    MAIN DECISION RULE:
    First decide whether this week has a support-stack contrast.
    
    A support is present when:
    - sleep_hours >= 7
    - sleep_quality >= 7
    - exercise_minutes >= 20
    - meditation is true
    - deep_work_hours >= 1
    - stress <= 5
    - focus >= 6
    - caffeine_after_2pm is false
    - alcohol is false
    
    Count supports for best_day_snapshot and hardest_day_snapshot.
    
    If best_day_snapshot has 5 or more supports and hardest_day_snapshot has 3 or fewer supports:
    - The main insight MUST be support-stack contrast.
    - The headline MUST be about the best/hardest day contrast or support stack.
    - Do NOT make caffeine, sleep, exercise, meditation, or deep work alone the main headline.
    - Caffeine may be used as the watchout or experiment, but not as the main insight.
    - The core insight must compare the support stack on the best day with the support drop-off on the hardest day.
    
    If the support-stack contrast rule is not met, choose one of these themes:
    1. Friction loop: one visible friction point seemed linked with another area.
    2. Recovery baseline: sleep, stress, or energy shaped several other signals.
    3. Single-habit hypothesis: one habit is the clearest signal.
    4. Low-data signal: too few entries or patterns to trust.
    
    Hard grounding rules:
    - Do not use the word "routine" in the output.
    - Do not mention "morning" unless both the best day and hardest day explicitly mention morning.
    - Do not mention work schedule, meetings, commute, weekends, social plans, or self-care unless they appear in notes or daily snapshots.
    - Do not say something was missing from a day unless that day's snapshot explicitly shows it.
    - Do not tie caffeine, alcohol, sleep, exercise, meditation, or deep work to a specific day unless that day explicitly shows it.
    - Do not invent combined relationships. For example, do not say "late caffeine on non-meditation days" unless that exact relationship appears in the data.
    - Never imply that one week of data proves anything.
    
    Avoid these words and phrases in the output:
    be mindful, finding balance, balanced approach, manage your time, productive tone, prioritize self-care, boost your mood, incorporate more, moving forward, preserve momentum, wellbeing resilience, cause, caused, led to, leading to, proves, explains, key, must, always, fix, failure, vulnerable, cure, contributed to, maintain, prioritize, overall wellbeing, supportive days.
    
    Use careful language:
    seemed linked, coincided with, is worth testing, may be worth preserving.
    
    Headline rules:
    - Under 12 words.
    - Specific to this week's chosen theme.
    - Should sound like an observation from this user's week, not advice.
    - If support-stack contrast is selected, mention support stack or the best/hardest day contrast.
    - Do not say "best days" unless multiple best/strong days are being referenced.
    - Do not say "better days", "productive mornings", "momentum", "balance", "resilience", or "overall wellbeing."
    
    Core insight rules:
    - Two concise sentences.
    - Explain the deeper weekly theme.
    - Do not summarize the scorecard.
    - Do not list several correlations.
    - If support-stack contrast is selected, compare best_day_snapshot and hardest_day_snapshot.
    - If support-stack contrast is selected, mention at least three support differences across the two days.
    - Do not reduce a support-stack insight to only sleep, caffeine, or exercise.
    - The insight should give the user a useful mental model, not just a fact.
    - Do not use causal language such as "leading to" or "contributed to."
    
    Leverage point rules:
    - Say what to preserve, not what to achieve.
    - It can be one habit, one condition, or a small support stack.
    - It must connect directly to the chosen theme.
    - If support-stack contrast is selected, the leverage point should be the smallest repeatable support stack.
    - It should not ask the user to change more than two things.
    - It must not be identical to the experiment.
    - Avoid broad instructions like "preserve sleep and avoid caffeine."
    
    Watchout rules:
    - Name one friction point from detected patterns, journal notes, or daily snapshots only.
    - Do not invent a cause.
    - Do not invent combined relationships.
    - If the detected pattern says "late caffeine and sleep quality", the watchout may mention late caffeine and sleep quality only.
    - Do not add stress, alcohol, meditation, or wellbeing unless the detected pattern explicitly supports that connection.
    - Do not make it sound alarming.
    
    Experiment rules:
    - The experiment must test either:
      1. the watchout friction point, or
      2. the smallest repeatable part of the chosen theme.
    - The experiment must use tracked habits only.
    - It must be one sentence string, not an object.
    - It must include behavior, duration, frequency, and comparison metric.
    - It should be doable on at least 3 or 4 days.
    - It should not require daily perfection.
    - It should take less than 45 minutes per day.
    - It should not require 2+ hours of deep work.
    - It should not require changing more than two behaviors.
    - It must connect clearly to the core insight or watchout.
    
    Preferred experiment patterns:
    If the watchout is late caffeine, use:
    "For 7 days, avoid caffeine after 2 PM on at least 4 days and compare sleep quality."
    
    If the theme is movement and mood, use:
    "For 7 days, do 20 minutes of movement on at least 4 days and compare mood."
    
    If the theme is deep work and focus, use:
    "For 7 days, complete one 30–45 minute deep work block on at least 4 days and compare focus."
    
    If the theme is meditation and stress, use:
    "For 7 days, meditate for 5–10 minutes on at least 4 days and compare stress."
    
    If the theme is sleep and focus, use:
    "For 7 days, aim for 7+ hours of sleep on at least 4 nights and compare focus."
    
    Reflection question rules:
    - Ask about lived experience, not a calculation.
    - Do not ask the user to compare averages or scores that the workflow already calculated.
    - Reference a specific day, score, note, or contrast from the week.
    - Do not ask a yes/no question.
    - Do not ask the user to plan a new habit.
    - Do not ask how to apply something to a future day.
    - Do not use the word "routine".
    - If support-stack contrast is selected, compare concrete details from the best day and hardest day.
    
    Weekly data:
    
    Week:
    {{ $json.week_start }} to {{ $json.week_end }}
    
    Entry count:
    {{ $json.entry_count }}
    
    Best day:
    {{ $json.best_day }}
    
    Hardest day:
    {{ $json.hardest_day }}
    
    Weekly metrics:
    {{ JSON.stringify($json.weekly_metrics) }}
    
    Best day snapshot:
    {{ JSON.stringify($json.best_day_snapshot) }}
    
    Hardest day snapshot:
    {{ JSON.stringify($json.hardest_day_snapshot) }}
    
    Detected patterns:
    {{ $json.detected_patterns }}
    
    Journal notes:
    {{ JSON.stringify($json.notes) }}
    
    Gratitude/wins:
    {{ JSON.stringify($json.gratitude_wins) }}
    
    Daily snapshots:
    {{ JSON.stringify($json.daily_snapshots) }}
    
    Final self-check before returning:
    - Did I count supports for best_day_snapshot and hardest_day_snapshot?
    - If best day has 5+ supports and hardest day has 3 or fewer, did I choose support-stack contrast?
    - Did I avoid making caffeine or sleep alone the main insight when support-stack contrast is stronger?
    - Do all fields align with the same theme?
    - Did I avoid invented details and invented combined relationships?
    - Is the insight a theme, not a list of correlations?
    - Does the experiment connect to the insight or watchout?
    - Is the experiment measurable, realistic, and one sentence?
    - Is the reflection question about lived experience, not math or planning?
    - Are all JSON values strings?
    - Is the output valid JSON only?
    
    Return valid JSON only.
    Do not use Markdown.
    Do not include any text before or after the JSON.
    
    Return exactly this object with string values only:
    
    {
      "headline": "A specific, non-generic headline under 12 words.",
      "core_insight": "Two concise sentences explaining the deeper weekly theme. Not a scorecard summary.",
      "leverage_point": "One habit, condition, or small support stack to preserve next week.",
      "watchout": "One friction point from the data only. No invented causes.",
      "next_experiment": "One measurable 7-day experiment in one sentence.",
      "reflection_question": "One specific question referencing a score, day, note, or contrast from this week."
    }
  5. Adjust the weekly trigger and save

    Open the Weekly Report Trigger node and adjust the run day/time as needed (default is Monday at 9:00 AM). Save and activate the workflow.

  6. Test the daily branch

    Manually run the Daily Check-in Branch and submit the form once. Confirm a new row appears in the daily_entries sheet and that you receive a confirmation email. If the risk_flag is needs_support, you should receive the gentler supportive confirmation message instead of the standard one.

  7. Test the weekly branch

    Ensure at least 3 daily entries exist in daily_entries (for a full test, add 7 entries covering Monday through Sunday). Manually run the Weekly Insights Branch and confirm: the Calculate Weekly Analytics node outputs one weekly summary; the Basic LLM Chain returns valid JSON; the Parse AI Reflection JSON node parses fields correctly; and you receive the formatted weekly insights email. If fewer than 3 entries exist, you should receive the "not enough data" Gmail message instead.

Prompt you can copy

Setup guidance · Editorial suggestion。Setup assistant: confirm inputs and permissions before building

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

You are a setup assistant for a habit and mood tracking system. The user wants to build a daily check-in + weekly AI report automation in n8n. Please confirm the user has prepared: 1) a Google Sheets spreadsheet with two tabs (daily_entries and weekly_reports); 2) credentials for Google Sheets OAuth2, Gmail OAuth2, and an OpenAI-compatible API (e.g., Groq); 3) a working n8n instance. If all materials are ready, guide the user to import the workflow, fill in placeholders, and test both branches. If the user wants to change tracked dimensions, remind them to also update the form fields, the Calculate Daily Scores scoring logic, and the Basic LLM Chain allowed tracked habits list.

Before building, verify that Google Sheets column names match the template exactly, or appended data will misalign.

Source

Generate weekly habit and mood insights with Google Sheets and OpenAI · missylearnsai · n8n.io · 2026-05-25

Comments & feedback

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

Loading…

    Related