AutomationFlowsEmail & Gmail › Daily Habit Rpg: Gamified Gmail Reminders with Quest System and Progress…

Daily Habit Rpg: Gamified Gmail Reminders with Quest System and Progress…

Original n8n title: Daily Habit Rpg: Gamified Gmail Reminders with Quest System and Progress Tracking

Byueharayuuki @ueharayuuki1012 on n8n.io

Who's it for This template is perfect for anyone struggling with habit consistency who wants a fun, engaging way to maintain daily routines. It's ideal for productivity enthusiasts, fitness beginners, remote workers, students, or anyone who loves gamification and RPG elements.…

Cron / scheduled trigger★★★★☆ complexity17 nodesHTTP RequestGmail
Email & Gmail Trigger: Cron / scheduled Nodes: 17 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #10688 — we link there as the canonical source.

This workflow follows the Gmail → HTTP Request recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "IOTjbF6hTawO9Afs",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Gamified daily habit tracker with email motivation",
  "tags": [
    {
      "id": "LDAaGuh1mOpA14OM",
      "name": "Gmail",
      "createdAt": "2025-11-10T11:24:42.777Z",
      "updatedAt": "2025-11-10T11:24:42.777Z"
    },
    {
      "id": "S4yDYaKvTcBGljPh",
      "name": "Productivity",
      "createdAt": "2025-11-10T11:24:42.804Z",
      "updatedAt": "2025-11-10T11:24:42.804Z"
    },
    {
      "id": "HfzIqZrjk1ypxBWH",
      "name": "Automation",
      "createdAt": "2025-11-10T11:24:42.743Z",
      "updatedAt": "2025-11-10T11:24:42.743Z"
    },
    {
      "id": "cfTY2dHVf99vPUYv",
      "name": "API Integration",
      "createdAt": "2025-11-10T11:31:11.489Z",
      "updatedAt": "2025-11-10T11:31:11.489Z"
    },
    {
      "id": "0VdnRdIJXdFkgYTa",
      "name": "Habit Tracking",
      "createdAt": "2025-11-10T11:31:11.923Z",
      "updatedAt": "2025-11-10T11:31:11.923Z"
    },
    {
      "id": "VPb1Zu8xwGofnDu2",
      "name": "Gamification",
      "createdAt": "2025-11-10T11:37:47.835Z",
      "updatedAt": "2025-11-10T11:37:47.835Z"
    },
    {
      "id": "FKG8Z1QdvvXJEfQg",
      "name": "RPG",
      "createdAt": "2025-11-10T11:37:47.774Z",
      "updatedAt": "2025-11-10T11:37:47.774Z"
    },
    {
      "id": "WdJtHfigw7NQl68Z",
      "name": "Airtable",
      "createdAt": "2025-11-10T11:37:47.810Z",
      "updatedAt": "2025-11-10T11:37:47.810Z"
    }
  ],
  "nodes": [
    {
      "id": "96f82310-1477-4793-9a50-0a7a34d89a73",
      "name": "\ud83d\udccb Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        720
      ],
      "parameters": {
        "width": 450,
        "height": 1092,
        "content": "# \ud83c\udfae Gamified Daily Habit Tracker\n\n## What it does\nTransform your daily habits into an RPG adventure! This workflow sends a beautifully formatted HTML email every morning that gamifies your routine with XP rewards, levels, and achievements.\n\n## Who's it for\n- Productivity enthusiasts looking for motivation\n- People struggling with habit consistency\n- Anyone who loves gamification and RPG elements\n- Individuals wanting to make routine tasks more engaging\n\n## How it works\n1. Runs automatically every morning at 6:00 AM (customizable)\n2. Generates daily \"quests\" based on the day of week\n3. Fetches a motivational quote from an API\n4. Calculates player stats (level, XP, streak)\n5. Sends a beautifully formatted HTML email with your daily adventure\n\n## Setup steps (5 minutes)\n1. Connect your Gmail account via OAuth2\n2. Update recipient email in \"Send Quest Email\" node\n3. Customize your habits in \"Generate Daily Quests\" node\n4. Adjust trigger time if needed\n5. Activate the workflow\n\n## Requirements\n- Gmail account with OAuth2\n- n8n instance (cloud or self-hosted)\n\n## How to customize\n- Edit habit lists in the Code nodes\n- Adjust difficulty and rewards\n- Modify email template design\n- Change motivational messages\n- Add or remove achievements\n\nCreated with \u2764\ufe0f for the n8n community"
      },
      "typeVersion": 1
    },
    {
      "id": "98196975-15f2-4ead-9146-89bc43877e24",
      "name": "Daily Morning Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -400,
        1248
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 24
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "17352aae-c538-49c2-894f-0b63cb693fc0",
      "name": "Step 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        912
      ],
      "parameters": {
        "color": 7,
        "width": 200,
        "height": 326,
        "content": "## \u23f0 Step 1: Schedule Trigger\n\nRuns every day at 6:00 AM\n\n**To customize:**\n- Double-click the node\n- Change `triggerAtHour` value\n- Save and activate"
      },
      "typeVersion": 1
    },
    {
      "id": "56b21455-24e2-4533-844a-cd5c254ab37b",
      "name": "Initialize Player Stats",
      "type": "n8n-nodes-base.code",
      "position": [
        -192,
        1248
      ],
      "parameters": {
        "jsCode": "// Initialize player stats (demo mode - random values)\n// In production, you could load this from a database\n\nconst today = new Date();\nconst weekday = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][today.getDay()];\n\n// Generate random stats for demonstration\nconst streak = Math.floor(Math.random() * 30) + 1;\nconst level = Math.floor(streak / 7) + 1;\nconst experience = Math.floor(Math.random() * 100);\nconst coins = level * 50 + Math.floor(Math.random() * 100);\n\n// Determine player class based on level\nlet playerClass = 'Novice Adventurer';\nif (level >= 20) playerClass = 'Legendary Sage';\nelse if (level >= 15) playerClass = 'Master Achiever';\nelse if (level >= 10) playerClass = 'Expert Habitmaster';\nelse if (level >= 5) playerClass = 'Skilled Practitioner';\nelse if (level >= 2) playerClass = 'Apprentice';\n\nreturn {\n  // Player stats\n  level: level,\n  experience: experience,\n  nextLevelXP: 100,\n  hp: 100,\n  maxHp: 100,\n  streak: streak,\n  coins: coins,\n  class: playerClass,\n  title: 'Habit Explorer',\n  \n  // Date information\n  date: today.toLocaleDateString('en-US', { \n    weekday: 'long', \n    year: 'numeric', \n    month: 'long', \n    day: 'numeric' \n  }),\n  weekday: weekday,\n  weekdayNumber: today.getDay(),\n  timestamp: today.toISOString()\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "ba2a9373-8291-457b-ae13-ddb2e9d14ad5",
      "name": "Step 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        944
      ],
      "parameters": {
        "color": 7,
        "width": 200,
        "height": 294,
        "content": "## \ud83c\udfb2 Step 2: Player Stats\n\nGenerates random player stats for demo.\n\n**In production:**\n- Connect to database\n- Load actual user progress\n- Track real achievements"
      },
      "typeVersion": 1
    },
    {
      "id": "203c212b-0e3f-4a8a-98f6-43f77a755f60",
      "name": "Generate Daily Quests",
      "type": "n8n-nodes-base.code",
      "position": [
        0,
        1248
      ],
      "parameters": {
        "jsCode": "const playerStats = $input.first().json;\nconst weekdayNum = playerStats.weekdayNumber;\n\n// Define daily quests with gamification elements\nconst questDatabase = {\n  daily: [\n    { name: 'Morning Meditation (5 min)', difficulty: 'Easy', xp: 10, coins: 5, emoji: '\ud83e\uddd8' },\n    { name: 'Hydration Challenge (2L water)', difficulty: 'Medium', xp: 15, coins: 8, emoji: '\ud83d\udca7' },\n    { name: 'Exercise Quest (30 min)', difficulty: 'Hard', xp: 25, coins: 15, emoji: '\ud83d\udcaa' },\n    { name: 'Knowledge Pursuit (Read 20 pages)', difficulty: 'Medium', xp: 20, coins: 10, emoji: '\ud83d\udcda' },\n    { name: 'Gratitude Journal', difficulty: 'Easy', xp: 10, coins: 5, emoji: '\u270d\ufe0f' }\n  ],\n  weekend: [\n    { name: 'Weekend Boss: Deep Cleaning', difficulty: 'Epic', xp: 50, coins: 30, emoji: '\ud83c\udfe0' },\n    { name: 'Financial Quest: Budget Review', difficulty: 'Hard', xp: 30, coins: 20, emoji: '\ud83d\udcb0' },\n    { name: 'Skill Learning: New Tutorial', difficulty: 'Epic', xp: 40, coins: 25, emoji: '\ud83c\udf93' }\n  ],\n  monday: [\n    { name: 'Weekly Goal Setting', difficulty: 'Medium', xp: 20, coins: 10, emoji: '\ud83c\udfaf' }\n  ]\n};\n\n// Select quests based on day of week\nlet todaysQuests = [...questDatabase.daily];\n\n// Add special quests for specific days\nif (weekdayNum === 0 || weekdayNum === 6) {\n  // Weekend\n  todaysQuests.push(questDatabase.weekend[0]);\n}\n\nif (weekdayNum === 1) {\n  // Monday\n  todaysQuests.push(questDatabase.monday[0]);\n}\n\n// Random bonus quest (20% chance)\nif (Math.random() < 0.2) {\n  todaysQuests.push({\n    name: 'Bonus: Early Bird Achievement',\n    difficulty: 'Bonus',\n    xp: 30,\n    coins: 20,\n    emoji: '\ud83c\udf05'\n  });\n}\n\n// Calculate total possible rewards\nconst totalPossibleXP = todaysQuests.reduce((sum, quest) => sum + quest.xp, 0);\nconst totalPossibleCoins = todaysQuests.reduce((sum, quest) => sum + quest.coins, 0);\n\nreturn {\n  ...playerStats,\n  todaysQuests: todaysQuests,\n  totalPossibleXP: totalPossibleXP,\n  totalPossibleCoins: totalPossibleCoins,\n  questCount: todaysQuests.length\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "fe4739d8-66fa-4cc0-bb57-7b6504cbc289",
      "name": "Step 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        896
      ],
      "parameters": {
        "color": 7,
        "width": 200,
        "height": 340,
        "content": "## \ud83d\udcdc Step 3: Quest Generation\n\n**Customizable habits:**\n- Weekday routines\n- Weekend special quests\n- Monday goal-setting\n- Random bonus quests\n\n**Edit the `questDatabase` object to add your own habits**"
      },
      "typeVersion": 1
    },
    {
      "id": "8edb1029-bbc7-4198-8854-eee469dee183",
      "name": "Fetch Daily Quote",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        192,
        1248
      ],
      "parameters": {
        "url": "https://api.quotable.io/random",
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        }
      },
      "typeVersion": 4.1,
      "continueOnFail": true
    },
    {
      "id": "3384083e-6928-4015-9fac-d4ac609a1726",
      "name": "Step 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        992
      ],
      "parameters": {
        "color": 7,
        "width": 200,
        "height": 246,
        "content": "## \ud83d\udcad Step 4: Daily Quote\n\nFetches motivational quote from free API\n\n**No API key required!**\n\nFalls back to default quote if API fails"
      },
      "typeVersion": 1
    },
    {
      "id": "4425309a-9372-4a54-b70d-7a3a26b1a716",
      "name": "Process Game Stats",
      "type": "n8n-nodes-base.code",
      "position": [
        400,
        1248
      ],
      "parameters": {
        "jsCode": "const data = $input.first().json;\nconst quoteResponse = $input.all()[0].json;\n\n// Process quote data\nlet todaysWisdom = {\n  text: 'Every adventure begins with a single step.',\n  author: 'Unknown'\n};\n\nif (quoteResponse && quoteResponse.content) {\n  todaysWisdom = {\n    text: quoteResponse.content,\n    author: quoteResponse.author || 'Unknown'\n  };\n}\n\n// Achievement checking\nconst achievements = [];\nif (data.streak === 7) {\n  achievements.push({ \n    name: 'Week Warrior',\n    description: '7 day streak!',\n    icon: '\ud83c\udfc5'\n  });\n}\nif (data.streak === 30) {\n  achievements.push({\n    name: 'Monthly Master',\n    description: '30 day streak!',\n    icon: '\ud83c\udfc6'\n  });\n}\nif (data.level === 10) {\n  achievements.push({\n    name: 'Double Digits',\n    description: 'Reached level 10!',\n    icon: '\ud83d\udc8e'\n  });\n}\n\n// Rank system based on level\nfunction getRank(level) {\n  if (level >= 50) return { rank: 'SSS', color: '#FFD700', title: 'Legendary Hero' };\n  if (level >= 40) return { rank: 'SS', color: '#FF6B6B', title: 'Unstoppable Force' };\n  if (level >= 30) return { rank: 'S', color: '#4ECDC4', title: 'Master' };\n  if (level >= 20) return { rank: 'A', color: '#95E77E', title: 'Expert' };\n  if (level >= 10) return { rank: 'B', color: '#68B0AB', title: 'Intermediate' };\n  if (level >= 5) return { rank: 'C', color: '#8B95C9', title: 'Apprentice' };\n  return { rank: 'D', color: '#B8B8B8', title: 'Beginner' };\n}\n\nconst rankInfo = getRank(data.level);\n\n// Progress calculations\nconst xpProgress = Math.round((data.experience / data.nextLevelXP) * 100);\nconst hpPercent = Math.round((data.hp / data.maxHp) * 100);\n\n// Daily motivational messages\nconst motivations = {\n  0: 'Sunday is for recharging. Prepare for the week ahead!',\n  1: 'Monday marks a fresh start. This week is yours!',\n  2: 'Tuesday momentum is building. Keep pushing!',\n  3: 'Wednesday - halfway there. You\\'ve got this!',\n  4: 'Thursday means the weekend is near. Final push!',\n  5: 'Friday! You\\'ve earned this. Celebrate your progress!',\n  6: 'Saturday is your time. Reflect and recharge.'\n};\n\nreturn {\n  ...data,\n  todaysWisdom: todaysWisdom,\n  achievements: achievements,\n  rankInfo: rankInfo,\n  xpProgress: xpProgress,\n  hpPercent: hpPercent,\n  motivation: motivations[data.weekdayNumber]\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "69262e55-3a6b-4c49-a31f-f0e67d853217",
      "name": "Step 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        1024
      ],
      "parameters": {
        "color": 7,
        "width": 200,
        "height": 214,
        "content": "## \ud83c\udfc6 Step 5: Achievements\n\nCalculates:\n- Player rank (D to SSS)\n- Achievement unlocks\n- XP progress\n- Daily motivation"
      },
      "typeVersion": 1
    },
    {
      "id": "556d383e-0f22-437b-a291-252f7f8a304c",
      "name": "Create Email Template",
      "type": "n8n-nodes-base.code",
      "position": [
        592,
        1248
      ],
      "parameters": {
        "jsCode": "const data = $input.first().json;\n\n// Create HTML email template\nconst emailHtml = `\n<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"UTF-8\">\n  <style>\n    body {\n      font-family: 'Arial', sans-serif;\n      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n      margin: 0;\n      padding: 20px;\n    }\n    \n    .game-container {\n      max-width: 650px;\n      margin: 0 auto;\n      background: linear-gradient(145deg, #1a1a2e, #0f0f1e);\n      border: 3px solid #ffd700;\n      border-radius: 15px;\n      padding: 0;\n      box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);\n      overflow: hidden;\n    }\n    \n    .header {\n      background: linear-gradient(90deg, #ff6b6b, #ffd93d);\n      padding: 25px;\n      text-align: center;\n      border-bottom: 3px solid #ffd700;\n    }\n    \n    .header h1 {\n      color: #1a1a2e;\n      font-size: 24px;\n      margin: 0;\n      text-shadow: 2px 2px 0px rgba(255,255,255,0.3);\n    }\n    \n    .date {\n      color: #1a1a2e;\n      font-size: 14px;\n      margin-top: 10px;\n      font-weight: bold;\n    }\n    \n    .player-stats {\n      background: rgba(26, 26, 46, 0.9);\n      padding: 20px;\n      margin: 20px;\n      border-radius: 10px;\n      border: 2px solid #4ecdc4;\n      color: #fff;\n    }\n    \n    .stat-row {\n      display: flex;\n      justify-content: space-between;\n      margin: 10px 0;\n      align-items: center;\n    }\n    \n    .stat-label {\n      color: #4ecdc4;\n      font-weight: bold;\n      font-size: 14px;\n    }\n    \n    .stat-value {\n      color: #ffd93d;\n      font-weight: 900;\n      font-size: 18px;\n    }\n    \n    .progress-bar {\n      background: #2a2a3e;\n      border-radius: 10px;\n      height: 20px;\n      overflow: hidden;\n      border: 1px solid #4ecdc4;\n      position: relative;\n      margin: 10px 0;\n    }\n    \n    .progress-fill {\n      background: linear-gradient(90deg, #4ecdc4, #44a3a0);\n      height: 100%;\n      transition: width 0.3s ease;\n    }\n    \n    .progress-text {\n      position: absolute;\n      width: 100%;\n      text-align: center;\n      color: white;\n      font-size: 12px;\n      font-weight: bold;\n      line-height: 20px;\n    }\n    \n    .rank-badge {\n      display: inline-block;\n      padding: 8px 15px;\n      background: ${data.rankInfo.color};\n      color: white;\n      border-radius: 20px;\n      font-weight: 900;\n      font-size: 20px;\n      box-shadow: 0 3px 10px rgba(0,0,0,0.3);\n    }\n    \n    .motivation-box {\n      background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);\n      color: white;\n      padding: 20px;\n      margin: 20px;\n      border-radius: 10px;\n      text-align: center;\n      font-size: 16px;\n      font-weight: bold;\n    }\n    \n    .wisdom-box {\n      background: linear-gradient(135deg, #667eea, #764ba2);\n      padding: 20px;\n      margin: 20px;\n      border-radius: 10px;\n      text-align: center;\n      color: white;\n    }\n    \n    .wisdom-text {\n      font-size: 16px;\n      font-style: italic;\n      margin-bottom: 10px;\n    }\n    \n    .wisdom-author {\n      font-size: 12px;\n      opacity: 0.8;\n    }\n    \n    .quest-section {\n      padding: 20px;\n    }\n    \n    .quest-title {\n      color: #ffd93d;\n      font-size: 20px;\n      margin-bottom: 15px;\n      text-align: center;\n      font-weight: bold;\n    }\n    \n    .quest-item {\n      background: rgba(78, 205, 196, 0.1);\n      border: 2px solid #4ecdc4;\n      border-radius: 10px;\n      padding: 15px;\n      margin: 10px 0;\n      color: white;\n    }\n    \n    .quest-header {\n      display: flex;\n      justify-content: space-between;\n      align-items: center;\n      margin-bottom: 8px;\n    }\n    \n    .quest-name {\n      font-size: 16px;\n      font-weight: bold;\n      display: flex;\n      align-items: center;\n    }\n    \n    .quest-emoji {\n      font-size: 24px;\n      margin-right: 10px;\n    }\n    \n    .quest-rewards {\n      display: flex;\n      gap: 15px;\n    }\n    \n    .reward {\n      padding: 3px 8px;\n      border-radius: 5px;\n      font-size: 12px;\n      font-weight: bold;\n    }\n    \n    .xp-reward {\n      background: #4ecdc4;\n      color: #1a1a2e;\n    }\n    \n    .coin-reward {\n      background: #ffd93d;\n      color: #1a1a2e;\n    }\n    \n    .difficulty {\n      font-size: 12px;\n      padding: 3px 8px;\n      border-radius: 5px;\n      font-weight: bold;\n    }\n    \n    .difficulty-Easy {\n      background: #68b88e;\n      color: white;\n    }\n    \n    .difficulty-Medium {\n      background: #f4a261;\n      color: white;\n    }\n    \n    .difficulty-Hard {\n      background: #e76f51;\n      color: white;\n    }\n    \n    .difficulty-Epic {\n      background: #8b5cf6;\n      color: white;\n    }\n    \n    .difficulty-Bonus {\n      background: linear-gradient(90deg, #ffd93d, #ffed4e);\n      color: #1a1a2e;\n    }\n    \n    .achievement-banner {\n      background: linear-gradient(135deg, #ffd700, #ffed4e);\n      color: #1a1a2e;\n      padding: 15px;\n      margin: 20px;\n      border-radius: 10px;\n      text-align: center;\n      font-weight: bold;\n    }\n    \n    .total-rewards {\n      background: rgba(255, 215, 0, 0.1);\n      border: 2px solid #ffd700;\n      padding: 15px;\n      margin: 20px;\n      border-radius: 10px;\n      text-align: center;\n      color: white;\n    }\n    \n    .reward-summary {\n      display: flex;\n      justify-content: center;\n      gap: 30px;\n      margin-top: 10px;\n    }\n    \n    .summary-value {\n      color: #ffd93d;\n      font-weight: 900;\n      font-size: 24px;\n    }\n    \n    .footer {\n      text-align: center;\n      padding: 20px;\n      color: #888;\n      font-size: 12px;\n      background: rgba(0,0,0,0.3);\n    }\n  </style>\n</head>\n<body>\n  <div class=\"game-container\">\n    <div class=\"header\">\n      <h1>\u2694\ufe0f HABIT QUEST RPG \u2694\ufe0f</h1>\n      <div class=\"date\">${data.date}</div>\n    </div>\n    \n    ${data.achievements && data.achievements.length > 0 ? \n      `<div class=\"achievement-banner\">\n        \ud83c\udf89 ACHIEVEMENT UNLOCKED! \ud83c\udf89<br>\n        ${data.achievements.map(a => `${a.icon} ${a.name}`).join(' \u2022 ')}\n      </div>` : ''}\n    \n    <div class=\"player-stats\">\n      <div class=\"stat-row\">\n        <span class=\"stat-label\">Player</span>\n        <span class=\"stat-value\">${data.title}</span>\n      </div>\n      \n      <div class=\"stat-row\">\n        <span class=\"stat-label\">Class</span>\n        <span class=\"stat-value\">${data.class}</span>\n      </div>\n      \n      <div class=\"stat-row\">\n        <span class=\"stat-label\">Rank</span>\n        <span class=\"rank-badge\">${data.rankInfo.rank}</span>\n      </div>\n      \n      <div class=\"stat-row\">\n        <span class=\"stat-label\">Level</span>\n        <span class=\"stat-value\">Lv.${data.level}</span>\n      </div>\n      \n      <div class=\"stat-row\">\n        <span class=\"stat-label\">Experience</span>\n        <span class=\"stat-value\">${data.experience} / ${data.nextLevelXP} XP</span>\n      </div>\n      \n      <div class=\"progress-bar\">\n        <div class=\"progress-fill\" style=\"width: ${data.xpProgress}%;\"></div>\n        <div class=\"progress-text\">${data.xpProgress}%</div>\n      </div>\n      \n      <div class=\"stat-row\" style=\"margin-top: 15px;\">\n        <span class=\"stat-label\">Streak</span>\n        <span class=\"stat-value\">\ud83d\udd25 ${data.streak} days</span>\n      </div>\n      \n      <div class=\"stat-row\">\n        <span class=\"stat-label\">Coins</span>\n        <span class=\"stat-value\">\ud83d\udcb0 ${data.coins}</span>\n      </div>\n    </div>\n    \n    <div class=\"motivation-box\">\n      \ud83d\udcaa ${data.motivation}\n    </div>\n    \n    <div class=\"wisdom-box\">\n      <div class=\"wisdom-text\">\"${data.todaysWisdom.text}\"</div>\n      <div class=\"wisdom-author\">- ${data.todaysWisdom.author}</div>\n    </div>\n    \n    <div class=\"quest-section\">\n      <div class=\"quest-title\">\ud83d\udcdc TODAY'S QUEST LIST \ud83d\udcdc</div>\n      \n      ${data.todaysQuests.map(quest => `\n        <div class=\"quest-item\">\n          <div class=\"quest-header\">\n            <div class=\"quest-name\">\n              <span class=\"quest-emoji\">${quest.emoji}</span>\n              <span>${quest.name}</span>\n            </div>\n            <span class=\"difficulty difficulty-${quest.difficulty}\">${quest.difficulty}</span>\n          </div>\n          <div class=\"quest-rewards\">\n            <span class=\"reward xp-reward\">+${quest.xp} XP</span>\n            <span class=\"reward coin-reward\">+${quest.coins} \ud83d\udcb0</span>\n          </div>\n        </div>\n      `).join('')}\n    </div>\n    \n    <div class=\"total-rewards\">\n      <div style=\"font-size: 16px; margin-bottom: 10px;\">\ud83c\udfaf TODAY'S MAXIMUM REWARDS \ud83c\udfaf</div>\n      <div class=\"reward-summary\">\n        <div class=\"summary-item\">\n          <span class=\"summary-value\">${data.totalPossibleXP}</span> XP\n        </div>\n        <div class=\"summary-item\">\n          <span class=\"summary-value\">${data.totalPossibleCoins}</span> \ud83d\udcb0\n        </div>\n      </div>\n    </div>\n    \n    <div class=\"footer\">\n      Powered by n8n Workflow Automation<br>\n      Your adventure continues... \ud83d\udde1\ufe0f\u2728\n    </div>\n  </div>\n</body>\n</html>\n`;\n\n// Create plain text version\nconst emailText = `\nHABIT QUEST RPG\n${data.date}\n\n=== PLAYER STATS ===\nPlayer: ${data.title}\nClass: ${data.class}\nRank: ${data.rankInfo.rank} - ${data.rankInfo.title}\nLevel: Lv.${data.level}\nExperience: ${data.experience}/${data.nextLevelXP} XP\nStreak: ${data.streak} days\nCoins: ${data.coins}\n\n${data.motivation}\n\n\"${data.todaysWisdom.text}\"\n- ${data.todaysWisdom.author}\n\n=== TODAY'S QUESTS ===\n${data.todaysQuests.map((quest, i) => \n  `${i+1}. ${quest.emoji} ${quest.name}\\n   [${quest.difficulty}] Rewards: +${quest.xp} XP, +${quest.coins} Coins`\n).join('\\n\\n')}\n\n=== MAXIMUM REWARDS ===\nTotal XP: ${data.totalPossibleXP}\nTotal Coins: ${data.totalPossibleCoins}\n\n${data.achievements && data.achievements.length > 0 ? \n  `=== ACHIEVEMENTS UNLOCKED ===\\n${data.achievements.map(a => `${a.icon} ${a.name}: ${a.description}`).join('\\n')}\\n` : ''}\n\n---\nPowered by n8n\nYour adventure continues...\n`;\n\nreturn {\n  subject: `[Habit Quest] Level ${data.level} ${data.rankInfo.title} - Day ${data.streak} \ud83c\udfae`,\n  htmlBody: emailHtml,\n  textBody: emailText,\n  playerData: data\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "f8e9dff5-1667-4a6e-a0f5-69098e348774",
      "name": "Step 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        976
      ],
      "parameters": {
        "color": 7,
        "width": 200,
        "height": 262,
        "content": "## \ud83d\udce7 Step 6: Email Template\n\nCreates beautiful HTML email with:\n- Player stats dashboard\n- Progress bars\n- Quest list\n- Achievements\n- Responsive design"
      },
      "typeVersion": 1
    },
    {
      "id": "4de3578b-c920-442b-9603-fe40ac5dcfc4",
      "name": "Send Quest Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        800,
        1248
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "={{ $json.htmlBody }}",
        "options": {},
        "subject": "={{ $json.subject }}"
      },
      "typeVersion": 2.1
    },
    {
      "id": "febfefec-9a85-42ed-9b95-f82703fb0a14",
      "name": "Step 7 - IMPORTANT",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        912
      ],
      "parameters": {
        "color": 7,
        "width": 200,
        "height": 324,
        "content": "## \u26a0\ufe0f Step 7: Gmail Setup\n\n**REQUIRED:**\n1. Click \"Create New\" in credentials\n2. Connect your Gmail via OAuth2\n3. Update recipient email address\n4. Test with \"Execute Workflow\"\n5. Activate when ready"
      },
      "typeVersion": 1
    },
    {
      "id": "1c8c98b6-a0cc-4829-8ce3-e4783a9428cc",
      "name": "Log Execution Stats",
      "type": "n8n-nodes-base.code",
      "position": [
        1008,
        1248
      ],
      "parameters": {
        "jsCode": "const emailResult = $input.first().json;\nconst now = new Date();\n\n// Log execution statistics\nconst stats = {\n  executionTime: now.toISOString(),\n  status: 'success',\n  playerLevel: emailResult.playerData?.level || 1,\n  questsSent: emailResult.playerData?.questCount || 5,\n  totalXP: emailResult.playerData?.totalPossibleXP || 0,\n  totalCoins: emailResult.playerData?.totalPossibleCoins || 0,\n  nextExecution: new Date(now.getTime() + 24 * 60 * 60 * 1000).toISOString(),\n  message: `Quest email sent successfully - Level ${emailResult.playerData?.level || 1} player`\n};\n\nconsole.log('Execution Stats:', stats);\n\nreturn stats;"
      },
      "typeVersion": 2
    },
    {
      "id": "488f5c40-c3f4-4cef-909e-c2a590df0c53",
      "name": "Step 8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        1008
      ],
      "parameters": {
        "color": 7,
        "width": 200,
        "height": 230,
        "content": "## \u2705 Step 8: Logging\n\nTracks execution stats.\n\n**Optional:** Connect to database or Google Sheets to store progress history"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "f016746f-f603-4ce3-9b87-acbacc7d6c84",
  "connections": {
    "Send Quest Email": {
      "main": [
        [
          {
            "node": "Log Execution Stats",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Daily Quote": {
      "main": [
        [
          {
            "node": "Process Game Stats",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Game Stats": {
      "main": [
        [
          {
            "node": "Create Email Template",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Email Template": {
      "main": [
        [
          {
            "node": "Send Quest Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Morning Trigger": {
      "main": [
        [
          {
            "node": "Initialize Player Stats",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Daily Quests": {
      "main": [
        [
          {
            "node": "Fetch Daily Quote",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initialize Player Stats": {
      "main": [
        [
          {
            "node": "Generate Daily Quests",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Who's it for This template is perfect for anyone struggling with habit consistency who wants a fun, engaging way to maintain daily routines. It's ideal for productivity enthusiasts, fitness beginners, remote workers, students, or anyone who loves gamification and RPG elements.…

Source: https://n8n.io/workflows/10688/ — original creator credit. Request a take-down →

More Email & Gmail workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Email & Gmail

This workflow is an automated invoice payment tracking and reminder system for the Polish accounting service iFirma.pl. It monitors unpaid and overdue invoices, then automatically sends escalating rem

HTTP Request, Stop And Error, Slack +1
Email & Gmail

Automatically extract structured information from emails using AI-powered document analysis. This workflow processes emails from specified domains, classifies them by type, and extracts structured dat

Gmail, HTTP Request, AWS S3 +1
Email & Gmail

What This Flow Does

Gmail, Google Sheets, HTTP Request +1
Email & Gmail

This n8n template allows you to automatically monitor your company's budget by comparing live Bexio accounting data against targets defined in Google Sheets, sending automated weekly email reports. It

Google Sheets, HTTP Request, Gmail
Email & Gmail

Klaviyo List Decay Detection

HTTP Request, Postgres, Error Trigger +1