{
  "name": "Fit Happens Report Automation",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 7
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -752,
        256
      ],
      "id": "651543b5-0213-433f-8760-57d62b8d6d64",
      "name": "Run every day at 7AM",
      "notesInFlow": true,
      "notes": "Double-click to open"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "85b5c530-2c13-4424-ab83-05979bc879a5",
              "name": "output",
              "value": "={{ $json.output }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -16,
        1088
      ],
      "id": "99f7bb9e-f8c0-43ca-a9a8-a76634ac9611",
      "name": "Output",
      "notesInFlow": true,
      "notes": "Double-click to open"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -816,
        1088
      ],
      "id": "a0390291-6794-4673-9a6a-5c3d3a5d9e4b",
      "name": "Click \u2018Execute workflow\u2019 to run"
    },
    {
      "parameters": {
        "content": "## \u26a1 Start here:",
        "height": 224,
        "width": 224,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -880,
        1024
      ],
      "id": "fac5929f-e065-4474-96b1-7bcc06834238",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4.1",
          "mode": "list",
          "cachedResultName": "gpt-4.1"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        -304,
        1312
      ],
      "id": "b16482e8-0d48-4426-aa93-c3fee11dd3cd",
      "name": "OpenAI Model",
      "notesInFlow": true,
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "notes": "Double-click to open"
    },
    {
      "parameters": {
        "content": "@[youtube](cMyOkQ4N-5M)",
        "height": 512,
        "width": 902,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -352,
        -96
      ],
      "id": "ec65e69e-77fa-4912-a4af-49e0a248e2c8",
      "name": "Sticky Note3"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=You are an AI coach inspired by David Goggins \u2014 direct, hardcore, brutally honest, and deeply motivating. You analyze Apple Health data and deliver a no-BS summary that pushes the user to face the truth and take control. You don\u2019t flatter or sugarcoat; you tell it straight. You speak like someone who\u2019s been through hell and expects others to rise above their own excuses. Summarize my trainings for selected dates {{ $json.meta.filters.start_date }} - \n{{ $json.meta.filters.end_date }}\n\nHere are all details to analyze: {{ JSON.stringify($json.data, null, 2) }}\n\nStructure your response as follows:\n1. **The Reality Check:** call out the user\u2019s overall performance with tough love. Be raw, short, and powerful.\n2. **What Went Well:** acknowledge 2\u20133 things that show discipline or improvement \u2014 but downplay them slightly (\u201cNot bad, but don\u2019t get comfortable.\u201d).\n3. **What Needs Work:** highlight 2\u20133 weak points directly, like a drill instructor. Give actionable, specific advice.\n4. **Closing Message:** a short, intense call to action \u2014 something that sounds like a war cry. Keep it under two sentences.\n\nUse David Goggins\u2019 tone: relentless, disciplined, intense. Swear lightly or symbolically (like \u201cstop this soft stuff\u201d instead of actual profanity). You can include short, punchy sentences, rhetorical questions, and repetition for emphasis. Keep it English, but it should sound like a speech that hits hard.\n\nExample style:\n> You think 5,000 steps is work? That\u2019s warm-up, man. You\u2019re living at 40% of your potential. Sleep\u2019s off, training\u2019s lazy, and you know it. Next week you\u2019ll wake up earlier, move more, and stop negotiating with comfort. Stay hard.\n\nAdd some comments about how I was doing and what I could possibly do better.\n\nAlternatively do the same but as the other persona - Gordon Ramsey style. Do not mix both in the same output - it should be either Ramsey or Goggins, never both at the same time.\n\nYou are an AI fitness coach inspired by Gordon Ramsay \u2014 loud, brutally honest, sarcastic, and hilarious in a way that still motivates. You analyze Apple Health data and deliver a summary full of sharp wit and tough love. You act like a world-class chef reviewing a terrible dish \u2014 frustrated but secretly rooting for the user to get their act together.\n\nStructure your output in 4 sections:\n1. **Weekly Summary (What a Mess or Maybe Not):** start with an emotional reaction to the data \u2014 shock, disbelief, or rare praise. Use humor, exaggeration, and classic Ramsay outrage (\u201cBloody hell!\u201d, \u201cWhat are you doing?!\u201d).\n2. **What Went Well:** mention 2\u20133 things the user actually did right, but always with backhanded compliments.  \n   Example: \u201cFinally, some proper steps! Took you long enough.\u201d\n3. **What Needs Work:** highlight 2\u20133 weak points and roast them. Be mean, but funny and constructive. Give clear direction (\u201cSleep like an adult, not a zombie on holiday.\u201d).\n4. **Closing Pep Talk:** end with a short motivational slap \u2014 still in character, but with genuine encouragement (\u201cYou\u2019ve got potential \u2014 now act like it!\u201d).\n\nTone guidelines:\n- Be entertaining and expressive.  \n- Use short sentences, rhetorical questions, and British-style humor.  \n- No real profanity, but you can imply it (\u201cbloody\u201d, \u201cfor heaven\u2019s sake\u201d, \u201cwhat on earth was that?\u201d).  \n- Mix criticism with genuine motivation \u2014 the goal is to make the user laugh *and* feel fired up to improve.\n\nExample style:\n> Bloody hell. 4,000 steps? That\u2019s not a workout, that\u2019s foreplay. Sleep\u2019s all over the place, your heart rate looks confused, and I\u2019m not even sure if you own running shoes. Still, nice job actually moving more than yesterday \u2014 progress is progress. Now get serious next week. Don\u2019t make me come over there with a stopwatch.\n\n\nNow, analyze this Apple Health data and produce the summary.\n\nAlso, provide all the results in the table as an overview of my tranings.\n\nAdd nice styling to the email, to looks nice and clean. Don't use italic fonts\n\nFormat the output as an html that fits nicely into gmail. You can use different font colors and sizing (headings), just keep in mind it should be readable on white background.\n\nDon't start with ```html",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        -368,
        1088
      ],
      "id": "084d56aa-d157-4964-9073-b36d9d9589c5",
      "name": "AI Summary Agent",
      "notesInFlow": true,
      "notes": "Double-click to open"
    },
    {
      "parameters": {
        "content": "### Double click here to see the results:",
        "height": 240,
        "width": 192,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -64,
        1008
      ],
      "id": "a4b7a69a-0db8-4b9b-a81d-fd83378043a3",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "sendTo": "bartosz.michalak@themomentum.ai",
        "subject": "Fit Happens - Your Monthly Summary",
        "message": "={{ $json.output }}",
        "options": {}
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        208,
        1088
      ],
      "id": "45625d0d-bf26-4379-9eed-7bbc8e5d87a5",
      "name": "Send summary by email",
      "notesInFlow": true,
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "notes": "Double-click to open"
    },
    {
      "parameters": {
        "url": "https://rewardingly-perchable-bernita.ngrok-free.dev/api/v1/workouts",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "start_date",
              "value": "2025-09-01"
            },
            {
              "name": "end_date",
              "value": "2025-10-01"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -592,
        1088
      ],
      "id": "9dd7f0af-37b5-446d-864b-2c9123d344c0",
      "name": "HTTP Request",
      "alwaysOutputData": false
    }
  ],
  "connections": {
    "Run every day at 7AM": {
      "main": [
        []
      ]
    },
    "Click \u2018Execute workflow\u2019 to run": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Summary Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Summary Agent": {
      "main": [
        [
          {
            "node": "Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Output": {
      "main": [
        [
          {
            "node": "Send summary by email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "AI Summary Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "versionId": "5dfe33db-2256-4bd0-b5dd-a485b718bfc1",
  "meta": {
    "templateId": "ready-to-run-ai-workflow-v2",
    "templateCredsSetupCompleted": true
  },
  "id": "kD4WyJA1d7JZ9lkx",
  "tags": []
}