Build an AI confidence coach for women with GPT-4o, Google Sheets and Gmail

## 📊 Description Most career advice is generic. This workflow builds a fully personalized AI coaching system that remembers every user, adapts to their career stage and goals, detects what kind of help they need, and gets more contextual with every conversation. It is not a simple chatbot — it is a structured coaching engine with user profiling, conversation memory, intent routing, and proactive weekly outreach. Built for women's communities, coaching platforms, HR teams, and edtech creators who want to deliver real personalized career support at scale without hiring a team of coaches. ## What This Workflow Does 💬 Opens a chat interface where users can start talking immediately — no signup required 🧮 Detects if the user is new or returning on every message using Google Sheets as a user database 📋 Walks new users through a 4-step onboarding — name, career stage, biggest challenge, and monthly goal 🗂️ Stores and updates every user profile in Google Sheets with full onboarding state tracking 🔍 Detects intent from every coaching message across 6 categories — salary negotiation, interview prep, career change, leadership, confidence building, and work-life balance 🤖 Routes each message to a topic-specific GPT-4o system prompt tailored to that coaching category 💬 Loads the last 5 conversations from history to give GPT-4o full context before generating a response ✅ Responds with personalized advice, one actionable step for today, and a follow-up question to keep momentum 📝 Logs every conversation to Google Sheets with timestamp, message, intent, and AI response 📧 Sends every fully onboarded user a personalized weekly check-in email every Sunday with a weekly challenge, progress acknowledgment, and motivational quote from a woman leader ## Key Benefits ✅ Full conversation memory — every session builds on the last ✅ Intent detection across 6 coaching categories — not one generic prompt ✅ User profiling — advice is always tailored to their stage, challenge, and goa

27 nodesschedule trigger0 views0 copiesProductivity
GoogleSheetsGmailChatTriggerChatOpenAiScheduleTriggerFilter

Workflow JSON

{"id":"DFI2pCsnqDd3LSy2","meta":{"instanceId":"8443f10082278c46aa5cf3acf8ff0f70061a2c58bce76efac814b16290845177","templateCredsSetupCompleted":true},"name":"Personalized AI Confidence Coach for Women With Memory, Intent Detection, and Weekly Check-ins","tags":[],"nodes":[{"id":"7c861863-1621-4b15-be8c-7391a8741e94","name":"Extract User & Message","type":"n8n-nodes-base.code","position":[192,-96],"parameters":{"jsCode":"const message = $input.first().json.chatInput || '';\nconst sessionId = $input.first().json.sessionId || 'anonymous';\n\nreturn [{\n  json: {\n    user_id: sessionId,\n    message: message.trim(),\n    timestamp: new Date().toISOString()\n  }\n}];"},"typeVersion":2},{"id":"41c70952-4a42-4130-a22b-b10651462fc5","name":"Read All Users","type":"n8n-nodes-base.googleSheets","position":[384,-96],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI/edit#gid=0","cachedResultName":"User Profiles"},"documentId":{"__rl":true,"mode":"list","value":"1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI/edit?usp=drivesdk","cachedResultName":"Content Automation — Video & Blog Publishing Pipeline"}},"credentials":{"googleSheetsOAuth2Api":{"id":"ajCmdXdhjJqZW6RE","name":"automations"}},"typeVersion":4.7,"alwaysOutputData":true},{"id":"50e5348a-4ea9-4f08-87b9-517d06830e96","name":"Read Conversation History","type":"n8n-nodes-base.googleSheets","position":[1152,176],"parameters":{"options":{},"filtersUI":{"values":[{"lookupValue":"={{ $json.user_id }}","lookupColumn":"user_id"}]},"sheetName":{"__rl":true,"mode":"list","value":824897704,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI/edit#gid=824897704","cachedResultName":"Conversation Log"},"documentId":{"__rl":true,"mode":"list","value":"1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI/edit?usp=drivesdk","cachedResultName":"Content Automation — Video & Blog Publishing Pipeline"}},"credentials":{"googleSheetsOAuth2Api":{"id":"ajCmdXdhjJqZW6RE","name":"automations"}},"typeVersion":4.7,"alwaysOutputData":true},{"id":"62d2d166-3d7e-40ee-9898-d379e745903f","name":"Build Coaching Prompt","type":"n8n-nodes-base.code","position":[1360,176],"parameters":{"jsCode":"const userData = $('Check User & Route').first().json;\nconst message = userData.message;\nconst userId = userData.user_id;\n\n// Get last 5 messages for context\nconst history = $input.all().slice(-5);\n\nlet conversationHistory = '';\nhistory.forEach(h => {\n  const userMsg = h.json.user_message;\n  const botMsg = h.json.bot_response;\n  // Only include rows that have actual content\n  if (userMsg && botMsg && userMsg !== 'undefined' && botMsg !== 'undefined') {\n    conversationHistory += `User: ${userMsg}\\nCoach: ${botMsg}\\n\\n`;\n  }\n});\n\n// Detect intent\nconst intentKeywords = {\n  salary: ['salary', 'raise', 'pay', 'negotiate', 'compensation', 'money', 'increment'],\n  interview: ['interview', 'job', 'hired', 'application', 'resume', 'cv', 'hiring'],\n  career_change: ['change', 'pivot', 'switch', 'new career', 'different field', 'quit'],\n  leadership: ['leadership', 'boss', 'manager', 'team', 'assertive', 'authority', 'speak up'],\n  confidence: ['confidence', 'scared', 'nervous', 'afraid', 'doubt', 'imposter', 'worthy'],\n  balance: ['balance', 'burnout', 'stress', 'overwhelm', 'tired', 'boundaries', 'overworked']\n};\n\nlet detectedIntent = 'general';\nconst msgLower = message.toLowerCase();\n\nfor (const [intent, keywords] of Object.entries(intentKeywords)) {\n  if (keywords.some(k => msgLower.includes(k))) {\n    detectedIntent = intent;\n    break;\n  }\n}\n\n// Topic specific system prompts\nconst systemPrompts = {\n  salary: `You are an expert salary negotiation coach for women. You help women confidently negotiate raises and compensation. Be specific, tactical, and encouraging. Give exact scripts and phrases they can use.`,\n  interview: `You are an expert interview coach for women. You help women prepare for job interviews, craft compelling answers, and present themselves confidently. Give specific tips and practice questions.`,\n  career_change: `You are an expert career transition coach for women. You help women navigate career pivots with clarity and confidence. Be practical about steps, timelines, and skill gaps.`,\n  leadership: `You are an expert leadership coach for women. You help women develop their leadership presence, handle difficult workplace dynamics, and build authority. Be direct and empowering.`,\n  confidence: `You are an expert confidence coach for women. You help women overcome imposter syndrome, self-doubt, and fear. Be warm, encouraging, and give concrete mindset tools.`,\n  balance: `You are an expert work-life balance coach for women. You help women set boundaries, manage burnout, and create sustainable careers. Be compassionate and practical.`,\n  general: `You are an expert career coach for women. You help women grow their careers, build confidence, and achieve their professional goals. Be encouraging, practical, and specific.`\n};\n\nconst prompt = `${systemPrompts[detectedIntent]}\n\nUser Profile:\n- Name: ${userData.name}\n- Career Stage: ${userData.career_stage}\n- Biggest Challenge: ${userData.challenge}\n- This Month's Goal: ${userData.goal}\n\nRecent Conversation:\n${conversationHistory || 'This is the first coaching message.'}\n\nUser's Message: ${message}\n\nRespond in this JSON format:\n{\n  \"main_advice\": \"2-3 paragraph personalized coaching response\",\n  \"actionable_step\": \"One specific action they can take today\",\n  \"follow_up_question\": \"One question to keep them moving forward\",\n  \"intent_detected\": \"${detectedIntent}\"\n}\n\nRules:\n- Always address them by name\n- Reference their specific goal and challenge\n- Be direct and confident not vague\n- Give real tactical advice not generic tips\n- End with the follow up question to continue the conversation`;\n\nreturn [{\n  json: {\n    ...userData,\n    prompt,\n    intent: detectedIntent\n  }\n}];"},"typeVersion":2},{"id":"69c59e2f-bf1b-4ec1-b88d-09bd51dc345e","name":"Parse Coaching Response","type":"n8n-nodes-base.code","position":[1920,176],"parameters":{"jsCode":"const response = items[0].json.output[0].content[0].text;\nconst cleaned = response.replace(/```json|```/g, '').trim();\nconst parsed = JSON.parse(cleaned);\n\nconst userData = $('Check User & Route').first().json;\n\nconst formattedResponse = `${parsed.main_advice}\\n\\n✅ *Your Action for Today:*\\n${parsed.actionable_step}\\n\\n💭 ${parsed.follow_up_question}`;\n\nreturn [{\n  json: {\n    ...userData,\n    coaching_response: formattedResponse,\n    main_advice: parsed.main_advice,\n    actionable_step: parsed.actionable_step,\n    follow_up_question: parsed.follow_up_question,\n    intent: parsed.intent_detected\n  }\n}];"},"typeVersion":2},{"id":"ba9a69ad-8fa1-47d5-a102-c4a4c632e48f","name":"Read All Onboarded Users","type":"n8n-nodes-base.googleSheets","position":[272,672],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI/edit#gid=0","cachedResultName":"User Profiles"},"documentId":{"__rl":true,"mode":"list","value":"1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI/edit?usp=drivesdk","cachedResultName":"Content Automation — Video & Blog Publishing Pipeline"}},"credentials":{"googleSheetsOAuth2Api":{"id":"ajCmdXdhjJqZW6RE","name":"automations"}},"executeOnce":true,"typeVersion":4.7,"alwaysOutputData":false},{"id":"4616d2db-6b27-4f87-b76a-a11f0e66a16d","name":"Read Conversation Log","type":"n8n-nodes-base.googleSheets","position":[736,672],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":824897704,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI/edit#gid=824897704","cachedResultName":"Conversation Log"},"documentId":{"__rl":true,"mode":"list","value":"1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI/edit?usp=drivesdk","cachedResultName":"Content Automation — Video & Blog Publishing Pipeline"}},"credentials":{"googleSheetsOAuth2Api":{"id":"ajCmdXdhjJqZW6RE","name":"automations"}},"executeOnce":true,"typeVersion":4.7,"alwaysOutputData":false},{"id":"11d9ae4e-f6e0-4a99-aacc-97becbf475d8","name":"Parse Weekly Message","type":"n8n-nodes-base.code","position":[1536,672],"parameters":{"jsCode":"const response = items[0].json.output[0].content[0].text;\nconst cleaned = response.replace(/```json|```/g, '').trim();\nconst parsed = JSON.parse(cleaned);\n\nconst userData = $('Build Checkin Prompt').item.json;\n\nconst emailBody = `\n<!DOCTYPE html>\n<html>\n<head>\n  <style>\n    body { font-family: Arial, sans-serif; background: #f9f4ff; margin: 0; padding: 0; }\n    .container { max-width: 600px; margin: 30px auto; background: #ffffff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }\n    .header { background: linear-gradient(135deg, #7b2ff7, #f107a3); padding: 30px; text-align: center; color: white; }\n    .header h1 { margin: 0; font-size: 22px; }\n    .body { padding: 30px; color: #333; }\n    .challenge-box { background: #f3eaff; border-left: 4px solid #7b2ff7; padding: 16px 20px; border-radius: 8px; margin: 20px 0; }\n    .quote-box { background: #fff0fb; border-left: 4px solid #f107a3; padding: 14px 18px; border-radius: 8px; margin: 20px 0; font-style: italic; }\n    .footer { background: #f9f4ff; padding: 16px; text-align: center; font-size: 12px; color: #999; }\n  </style>\n</head>\n<body>\n  <div class=\"container\">\n    <div class=\"header\">\n      <h1>💜 Your Weekly Check-in</h1>\n    </div>\n    <div class=\"body\">\n      <p>${parsed.greeting}</p>\n      <p>${parsed.progress_acknowledgment}</p>\n      <div class=\"challenge-box\">\n        <strong>🎯 This Week's Challenge:</strong><br/><br/>\n        ${parsed.weekly_challenge}\n      </div>\n      <div class=\"quote-box\">\n        💬 ${parsed.motivational_quote}\n      </div>\n      <p>${parsed.closing}</p>\n    </div>\n    <div class=\"footer\">You're receiving this because you're part of the AI Confidence Coach community.<br/>Reply to this email anytime — we're here for you. 💜</div>\n  </div>\n</body>\n</html>`;\n\nreturn [{\n  json: {\n    ...userData,\n    email_subject: parsed.subject,\n    email_body: emailBody\n  }\n}];"},"typeVersion":2},{"id":"daac8898-af05-4f60-b006-a4a9fec3406f","name":"Send Weekly Checkin Email","type":"n8n-nodes-base.gmail","position":[1952,672],"webhookId":"a6cb82ff-8533-4aad-bf91-39b82c8d395b","parameters":{"sendTo":"={{ $json.email }}","message":"={{ $json.email_body }}","options":{},"subject":"={{ $json.email_subject }}"},"credentials":{"gmailOAuth2":{"id":"gEIaWCTvGfYjMSb3","name":"Gmail credentials"}},"typeVersion":2.2},{"id":"acd994e9-c799-456f-8cdb-a320f4faacba","name":"Chat Trigger","type":"@n8n/n8n-nodes-langchain.chatTrigger","position":[-16,-96],"webhookId":"3a112871-2812-4479-8ae6-2badd358400b","parameters":{"public":true,"options":{"responseMode":"responseNodes"},"initialMessages":"Hi there! 👋\nMy name is Nathan. How can I assist you today?\n\nStart by entering your name "},"typeVersion":1.4},{"id":"37d2ae25-ae99-4225-ac19-4b18635ee0e8","name":"Check User & Route","type":"n8n-nodes-base.code","position":[640,-96],"parameters":{"jsCode":"const userId = $('Extract User & Message').first().json.user_id;\nconst message = $('Extract User & Message').first().json.message;\n\n// Lookup maps for numbered responses\nconst careerStageMap = {\n  '1': 'Student or Fresh Graduate',\n  '2': 'Early Career (1-3 years)',\n  '3': 'Mid Career (4-8 years)',\n  '4': 'Senior or Leadership',\n  '5': 'Career Changer'\n};\n\nconst challengeMap = {\n  '1': 'Salary negotiation',\n  '2': 'Interview confidence',\n  '3': 'Career change or pivot',\n  '4': 'Leadership and assertiveness',\n  '5': 'Work-life balance',\n  '6': 'Building my network'\n};\n\n// Read all users from sheet\nconst allUsers = $input.all();\n\n// Find this specific user\nconst existingUser = allUsers.find(u => String(u.json.user_id) === String(userId));\n\n// Brand new user\nif (!existingUser) {\n  return [{\n    json: {\n      user_id: userId,\n      message,\n      onboarding_step: 0,\n      is_new: true,\n      name: '',\n      career_stage: '',\n      challenge: '',\n      goal: '',\n      response: `👋 Welcome to your AI Confidence Coach!\\n\\nI'm here to help you navigate salary negotiations, interview prep, career changes, and building unshakeable confidence at work.\\n\\nLet's start with a quick setup so I can give you the most relevant advice.\\n\\n*What's your name?*`\n    }\n  }];\n}\n\nconst user = existingUser.json;\nconst step = Number(user.onboarding_step) || 0;\n\n// Step 1 — Got name, ask career stage\nif (step === 1) {\n  return [{\n    json: {\n      user_id: userId,\n      message,\n      onboarding_step: 1,\n      is_new: false,\n      name: message,\n      career_stage: '',\n      challenge: user.challenge || '',\n      goal: user.goal || '',\n      response: `Nice to meet you, ${message}! 🌟\\n\\nWhat best describes your current career stage?\\n\\n1️⃣ Student or Fresh Graduate\\n2️⃣ Early Career (1-3 years)\\n3️⃣ Mid Career (4-8 years)\\n4️⃣ Senior or Leadership\\n5️⃣ Career Changer\\n\\nJust type the number or your answer.`\n    }\n  }];\n}\n\n// Step 2 — Got career stage, ask biggest challenge\nif (step === 2) {\n  return [{\n    json: {\n      user_id: userId,\n      message,\n      onboarding_step: 2,\n      is_new: false,\n      name: user.name || '',\n      career_stage: careerStageMap[message.trim()] || message,\n      challenge: '',\n      goal: user.goal || '',\n      response: `Got it! 💪\\n\\nWhat's your biggest challenge right now?\\n\\n1️⃣ Salary negotiation\\n2️⃣ Interview confidence\\n3️⃣ Career change or pivot\\n4️⃣ Leadership and assertiveness\\n5️⃣ Work-life balance\\n6️⃣ Building my network\\n\\nType the number or describe it in your own words.`\n    }\n  }];\n}\n\n// Step 3 — Got challenge, ask goal\nif (step === 3) {\n  return [{\n    json: {\n      user_id: userId,\n      message,\n      onboarding_step: 3,\n      is_new: false,\n      name: user.name || '',\n      career_stage: user.career_stage || '',\n      challenge: challengeMap[message.trim()] || message,\n      goal: '',\n      response: `Love the honesty! 🙌\\n\\nLast question — what's your main goal for this month?\\n\\nFor example: \"Get a raise\", \"Land a new job\", \"Feel more confident in meetings\", \"Start my own business\"\\n\\nTell me in your own words.`\n    }\n  }];\n}\n\n// Step 4 — Onboarding complete\nif (step === 4) {\n  const careerLabel = user.career_stage || '';\n  const challengeLabel = user.challenge || '';\n  return [{\n    json: {\n      user_id: userId,\n      message,\n      onboarding_step: 4,\n      is_new: false,\n      is_complete: true,\n      name: user.name || '',\n      career_stage: careerLabel,\n      challenge: challengeLabel,\n      goal: message,\n      response: `You're all set, ${user.name}! 🎉\\n\\nHere's what I know about you:\\n📍 Career Stage: ${careerLabel}\\n🎯 Biggest Challenge: ${challengeLabel}\\n🌟 This Month's Goal: ${message}\\n\\nI'm ready to coach you. Ask me anything — salary negotiation, interview tips, how to handle a difficult boss, career pivots, or just a confidence boost when you need one.\\n\\n*What would you like help with today?*`\n    }\n  }];\n}\n\n// Step 5+ — Onboarding done, ready for coaching\nreturn [{\n  json: {\n    user_id: userId,\n    message,\n    onboarding_step: step,\n    is_new: false,\n    is_onboarding_complete: true,\n    name: user.name || '',\n    career_stage: user.career_stage || '',\n    challenge: user.challenge || '',\n    goal: user.goal || '',\n    response: null\n  }\n}];"},"typeVersion":2},{"id":"513ea9f1-8506-4f77-b973-8ad10ab91ee9","name":"IF Onboarding or Coaching","type":"n8n-nodes-base.if","position":[832,-96],"parameters":{"options":{},"conditions":{"options":{"version":3,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"de01633b-6653-4f0e-99cc-9ce024243277","operator":{"type":"number","operation":"lt"},"leftValue":"={{ $json.onboarding_step }}","rightValue":5}]}},"typeVersion":2.3},{"id":"62c3a4d3-cc32-419b-94bb-0e269e174e1d","name":"Save Onboarding Progress","type":"n8n-nodes-base.googleSheets","position":[1136,-112],"parameters":{"columns":{"value":{"goal":"={{ $json.goal || '' }}","name":"={{ $json.name || '' }}","user_id":"={{ $json.user_id }}","challenge":"={{ $json.challenge || '' }}","joined_date":"={{ $json.is_new ? new Date().toISOString().split('T')[0] : '' }} ","last_active":"={{ new Date().toISOString().split('T')[0] }}","career_stage":"={{ $json.career_stage || '' }}","onboarding_step":"={{ Number($json.onboarding_step) + 1 }}"},"schema":[{"id":"user_id","type":"string","display":true,"removed":false,"required":false,"displayName":"user_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"career_stage","type":"string","display":true,"required":false,"displayName":"career_stage","defaultMatch":false,"canBeUsedToMatch":true},{"id":"challenge","type":"string","display":true,"required":false,"displayName":"challenge","defaultMatch":false,"canBeUsedToMatch":true},{"id":"goal","type":"string","display":true,"required":false,"displayName":"goal","defaultMatch":false,"canBeUsedToMatch":true},{"id":"joined_date","type":"string","display":true,"required":false,"displayName":"joined_date","defaultMatch":false,"canBeUsedToMatch":true},{"id":"last_active","type":"string","display":true,"required":false,"displayName":"last_active","defaultMatch":false,"canBeUsedToMatch":true},{"id":"onboarding_step","type":"string","display":true,"required":false,"displayName":"onboarding_step","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["user_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"appendOrUpdate","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI/edit#gid=0","cachedResultName":"User Profiles"},"documentId":{"__rl":true,"mode":"list","value":"1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI/edit?usp=drivesdk","cachedResultName":"Content Automation — Video & Blog Publishing Pipeline"}},"credentials":{"googleSheetsOAuth2Api":{"id":"ajCmdXdhjJqZW6RE","name":"automations"}},"typeVersion":4.7},{"id":"edd514a5-7e5f-4985-b70b-12db6c0b8d84","name":"Respond — Onboarding","type":"@n8n/n8n-nodes-langchain.chat","position":[1344,-112],"parameters":{"message":"={{ $('Check User & Route').item.json.response }}","options":{},"waitUserReply":false},"typeVersion":1},{"id":"7ceb6cc9-467e-4c19-8f05-a6afc7ec177b","name":"Confidence Coach","type":"@n8n/n8n-nodes-langchain.openAi","position":[1568,176],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"gpt-4o","cachedResultName":"GPT-4O"},"options":{},"responses":{"values":[{"content":"={{ $json.prompt }}"}]},"builtInTools":{}},"credentials":{"openAiApi":{"id":"5Kzt6hGSZ1JHZqWN","name":"OpenAi account 2"}},"typeVersion":2.1},{"id":"f43a4952-aeea-48ef-aff6-fc047f25e09d","name":"Log to Conversation Log","type":"n8n-nodes-base.googleSheets","position":[2144,176],"parameters":{"columns":{"value":{"intent":"={{ $json.intent }}","user_id":"={{ $json.user_id }}","timestamp":"={{ new Date().toISOString() }}","bot_response":"={{ $json.main_advice }}","user_message":"={{ $json.message }}"},"schema":[{"id":"user_id","type":"string","display":true,"removed":false,"required":false,"displayName":"user_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"timestamp","type":"string","display":true,"required":false,"displayName":"timestamp","defaultMatch":false,"canBeUsedToMatch":true},{"id":"user_message","type":"string","display":true,"required":false,"displayName":"user_message","defaultMatch":false,"canBeUsedToMatch":true},{"id":"intent","type":"string","display":true,"required":false,"displayName":"intent","defaultMatch":false,"canBeUsedToMatch":true},{"id":"bot_response","type":"string","display":true,"required":false,"displayName":"bot_response","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["user_id"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":824897704,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI/edit#gid=824897704","cachedResultName":"Conversation Log"},"documentId":{"__rl":true,"mode":"list","value":"1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI/edit?usp=drivesdk","cachedResultName":"Content Automation — Video & Blog Publishing Pipeline"}},"credentials":{"googleSheetsOAuth2Api":{"id":"ajCmdXdhjJqZW6RE","name":"automations"}},"typeVersion":4.7},{"id":"81a42ce0-e9f6-4ab3-9adb-6203d895480a","name":"Respond — Coaching","type":"@n8n/n8n-nodes-langchain.chat","position":[2352,176],"parameters":{"message":"={{ $('Parse Coaching Response').item.json.coaching_response }}","options":{},"waitUserReply":false},"typeVersion":1},{"id":"a916cbd1-a8ea-48a8-81b1-e6f6dbc418bb","name":"Weekly Sunday 10AM Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[32,672],"parameters":{"rule":{"interval":[{"field":"weeks","triggerAtHour":10}]}},"typeVersion":1.3},{"id":"22792215-70c4-4eab-8e15-255cdb38db97","name":"Filter Onboarded Users","type":"n8n-nodes-base.filter","position":[480,672],"parameters":{"options":{},"conditions":{"options":{"version":3,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"5ae99084-a356-44be-a071-106ec0bc53af","operator":{"type":"number","operation":"gte"},"leftValue":"={{ $json.onboarding_step }}","rightValue":5}]}},"typeVersion":2.3},{"id":"34450691-d162-4af9-9149-ed8c832993cf","name":"Build Checkin Prompt","type":"n8n-nodes-base.code","position":[944,672],"parameters":{"jsCode":"const users = $('Filter Onboarded Users').all();\nconst convLog = $('Read Conversation Log').all();\n\nreturn users.map(user => {\n  const u = user.json;\n\n  // Get last interaction for this user\n  const userConvs = convLog\n    .filter(c => String(c.json.user_id) === String(u.user_id))\n    .slice(-3);\n\n  let lastTopics = 'general career growth';\n  if (userConvs.length > 0) {\n    const intents = userConvs.map(c => c.json.intent).filter(Boolean);\n    lastTopics = intents.length > 0 ? intents.join(', ') : 'general career growth';\n  }\n\n  const prompt = `You are a warm and inspiring women's career coach sending a weekly check-in message.\n\nUser Profile:\n- Name: ${u.name}\n- Career Stage: ${u.career_stage}\n- Biggest Challenge: ${u.challenge}\n- This Month's Goal: ${u.goal}\n- Recent Topics Discussed: ${lastTopics}\n\nWrite a personalized weekly check-in message. Respond ONLY in this JSON format:\n{\n  \"subject\": \"email subject line with their name\",\n  \"greeting\": \"warm personalized opening\",\n  \"progress_acknowledgment\": \"acknowledge their journey and what they've been working on\",\n  \"weekly_challenge\": \"one specific challenge or task for this week related to their goal\",\n  \"motivational_quote\": \"an inspiring quote from a woman leader relevant to their situation\",\n  \"closing\": \"warm encouraging closing\"\n}\n\nRules:\n- Use their name throughout\n- Reference their specific goal and challenge\n- Weekly challenge must be concrete and achievable in one week\n- Keep the tone warm, sisterly, and empowering\n- Quote must be from a real woman leader`;\n\n  return {\n    json: {\n      user_id: u.user_id,\n      name: u.name,\n      email: u.email || '',\n      career_stage: u.career_stage,\n      challenge: u.challenge,\n      goal: u.goal,\n      last_topics: lastTopics,\n      prompt\n    }\n  };\n});"},"typeVersion":2},{"id":"79b85b7c-fbf5-4da1-bc59-5276dc55761f","name":"Weekly Coach","type":"@n8n/n8n-nodes-langchain.openAi","position":[1200,672],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"gpt-4o","cachedResultName":"GPT-4O"},"options":{},"responses":{"values":[{"content":"={{ $json.prompt }}"}]},"builtInTools":{}},"credentials":{"openAiApi":{"id":"5Kzt6hGSZ1JHZqWN","name":"OpenAi account 2"}},"typeVersion":2.1},{"id":"0ccbf9c6-fa7c-4acb-96fd-ec5d72883d77","name":"Filter Users With Email","type":"n8n-nodes-base.filter","position":[1744,672],"parameters":{"options":{},"conditions":{"options":{"version":3,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"685759a9-720f-4b75-a73c-81ff32d82714","operator":{"type":"string","operation":"notEmpty","singleValue":true},"leftValue":"={{ $json.email }}","rightValue":""}]}},"typeVersion":2.3},{"id":"f1de0a7b-d100-46dd-b538-2cb8cd52bd82","name":"Log to Weekly Checkins","type":"n8n-nodes-base.googleSheets","position":[2192,672],"parameters":{"columns":{"value":{"date":"={{ new Date().toISOString().split('T')[0] }}","name":"={{ $('Filter Users With Email').item.json.name }}","email":"={{ $('Filter Users With Email').item.json.email }}","user_id":"={{ $('Filter Users With Email').item.json.user_id }}","message_sent":"={{ $('Filter Users With Email').item.json.email_subject }}"},"schema":[{"id":"user_id","type":"string","display":true,"required":false,"displayName":"user_id","defaultMatch":false,"canBeUsedToMatch":true},{"id":"name","type":"string","display":true,"required":false,"displayName":"name","defaultMatch":false,"canBeUsedToMatch":true},{"id":"email","type":"string","display":true,"required":false,"displayName":"email","defaultMatch":false,"canBeUsedToMatch":true},{"id":"date","type":"string","display":true,"required":false,"displayName":"date","defaultMatch":false,"canBeUsedToMatch":true},{"id":"message_sent","type":"string","display":true,"required":false,"displayName":"message_sent","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":1843996826,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI/edit#gid=1843996826","cachedResultName":"Weekly Checkins"},"documentId":{"__rl":true,"mode":"list","value":"1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1yE5kqA1bo52CrYcvKFHFuCTBYmcI1vaMPuFKKP28sEI/edit?usp=drivesdk","cachedResultName":"Content Automation — Video & Blog Publishing Pipeline"}},"credentials":{"googleSheetsOAuth2Api":{"id":"ajCmdXdhjJqZW6RE","name":"automations"}},"typeVersion":4.7},{"id":"80a9d180-232e-428e-95b6-ef9f7849c531","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-768,-784],"parameters":{"width":384,"height":704,"content":"## Workflow Overview\n\nEvery woman deserves a career coach but not everyone \ncan afford one. This workflow gives every user a \npersonal AI coach available 24/7 — trained to help \nwith salary negotiation, interview prep, career \nchanges, leadership challenges, and confidence \nbuilding.\n\n### HOW IT WORKS\n\nUsers open the chat and complete a quick 4-step \nonboarding — name, career stage, biggest challenge, \nand monthly goal. From that point every response is \npersonalized to their profile. GPT-4o detects the \nintent behind every message and routes it to a \ntopic-specific coaching prompt. Conversation history \nis stored so every session builds on the last. Every \nSunday users get a personalized check-in email with \na weekly challenge and motivational quote.\n\n### SETUP STEPS\n\n1. Create the Google Sheet with 3 sheets — User \n   Profiles, Conversation Log, Weekly Checkins\n2. Connect Google Sheets, OpenAI, and Gmail credentials\n3. Activate the Chat Trigger and copy the chat URL\n4. Share the chat URL with your users"},"typeVersion":1},{"id":"c9b82b78-5edd-49af-b732-28c9fab3da6f","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-64,-240],"parameters":{"color":7,"width":1600,"height":368,"content":"Runs on every chat message. Reads all users from Google Sheets and detects if the user is new or returning. New users go through a 4-step onboarding collecting name, career stage, challenge, and goal. All responses saved and updated in User Profiles."},"typeVersion":1},{"id":"c87cda65-8c41-4be7-abc9-459947364a8d","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[1008,160],"parameters":{"color":7,"width":1616,"height":272,"content":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTriggers when onboarding is complete (step 5+). Detects intent from the user's message across 6 categories — salary, interview, career change, leadership, confidence, and balance. Loads last 5 conversations for context, sends to GPT-4o with a topic-specific prompt, and responds with advice, an action step, and a follow-up question."},"typeVersion":1},{"id":"74c4803b-b80d-4100-a21d-381611812826","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-48,512],"parameters":{"color":7,"width":2464,"height":384,"content":"Runs every Sunday at 10AM. Reads all fully onboarded users, pulls their recent conversation topics, and sends each one a personalized HTML email with a weekly challenge, progress acknowledgment, and a motivational quote from a woman leader in their field. Every send is logged to the Weekly Checkins sheet."},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"e6eba1c3-cc70-4a1b-869f-97e193de1cb1","connections":{"Chat Trigger":{"main":[[{"node":"Extract User & Message","type":"main","index":0}]]},"Weekly Coach":{"main":[[{"node":"Parse Weekly Message","type":"main","index":0}]]},"Read All Users":{"main":[[{"node":"Check User & Route","type":"main","index":0}]]},"Confidence Coach":{"main":[[{"node":"Parse Coaching Response","type":"main","index":0}]]},"Check User & Route":{"main":[[{"node":"IF Onboarding or Coaching","type":"main","index":0}]]},"Build Checkin Prompt":{"main":[[{"node":"Weekly Coach","type":"main","index":0}]]},"Parse Weekly Message":{"main":[[{"node":"Filter Users With Email","type":"main","index":0}]]},"Build Coaching Prompt":{"main":[[{"node":"Confidence Coach","type":"main","index":0}]]},"Read Conversation Log":{"main":[[{"node":"Build Checkin Prompt","type":"main","index":0}]]},"Extract User & Message":{"main":[[{"node":"Read All Users","type":"main","index":0}]]},"Filter Onboarded Users":{"main":[[{"node":"Read Conversation Log","type":"main","index":0}]]},"Filter Users With Email":{"main":[[{"node":"Send Weekly Checkin Email","type":"main","index":0}]]},"Log to Conversation Log":{"main":[[{"node":"Respond — Coaching","type":"main","index":0}]]},"Parse Coaching Response":{"main":[[{"node":"Log to Conversation Log","type":"main","index":0}]]},"Read All Onboarded Users":{"main":[[{"node":"Filter Onboarded Users","type":"main","index":0}]]},"Save Onboarding Progress":{"main":[[{"node":"Respond — Onboarding","type":"main","index":0}]]},"IF Onboarding or Coaching":{"main":[[{"node":"Save Onboarding Progress","type":"main","index":0}],[{"node":"Read Conversation History","type":"main","index":0}]]},"Read Conversation History":{"main":[[{"node":"Build Coaching Prompt","type":"main","index":0}]]},"Send Weekly Checkin Email":{"main":[[{"node":"Log to Weekly Checkins","type":"main","index":0}]]},"Weekly Sunday 10AM Trigger":{"main":[[{"node":"Read All Onboarded Users","type":"main","index":0}]]}}}

How to Import This Workflow

  1. 1Copy the workflow JSON above using the Copy Workflow JSON button.
  2. 2Open your n8n instance and go to Workflows.
  3. 3Click Import from JSON and paste the copied workflow.

Don't have an n8n instance? Start your free trial at n8nautomation.cloud

Ready to automate with n8n?

Get affordable managed n8n hosting with 24/7 support.