{
  "updatedAt": "2026-03-31T22:54:26.017Z",
  "createdAt": "2026-03-31T01:40:44.032Z",
  "id": "ogSjA37fEtOn4xDw",
  "name": "NC 5-Day Text Challenge (SMS via GHL)",
  "description": null,
  "active": false,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "nc-5day-challenge",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "webhook-trigger",
      "name": "Challenge Signup Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        220,
        300
      ],
      "webhookId": "nc-5day-challenge"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "phone",
              "name": "phone",
              "value": "={{ $json.body?.phone || $json.phone || \"\" }}",
              "type": "string"
            },
            {
              "id": "firstName",
              "name": "firstName",
              "value": "={{ $json.body?.firstName || $json.body?.first_name || $json.firstName || $json.first_name || \"there\" }}",
              "type": "string"
            },
            {
              "id": "email",
              "name": "email",
              "value": "={{ $json.body?.email || $json.email || \"\" }}",
              "type": "string"
            },
            {
              "id": "contactId",
              "name": "contactId",
              "value": "={{ $json.body?.contactId || $json.body?.contact_id || $json.contactId || $json.contact_id || \"\" }}",
              "type": "string"
            },
            {
              "id": "locationId",
              "name": "locationId",
              "value": "VMK8SyHTd8uCMgcJ7I2A",
              "type": "string"
            },
            {
              "id": "signupTime",
              "name": "signupTime",
              "value": "={{ new Date().toISOString() }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "extract-data",
      "name": "Extract Contact Data",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        440,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const GHL_KEY = \"pit-b68fa048-e2a1-4206-a68a-b3e6d3d7091b\";\nconst phone = $input.first().json.phone;\nconst firstName = $input.first().json.firstName;\nconst email = $input.first().json.email;\nconst locationId = $input.first().json.locationId;\nlet contactId = $input.first().json.contactId;\nlet conversationId = \"\";\n\nif (!contactId) {\n  try {\n    const search = await this.helpers.httpRequest({\n      method: \"GET\",\n      url: \"https://services.leadconnectorhq.com/contacts/search/duplicate\",\n      qs: { locationId, number: phone },\n      headers: { \"Authorization\": \"Bearer \" + GHL_KEY, \"Version\": \"2021-07-28\" },\n      json: true\n    });\n    if (search.contact && search.contact.id) {\n      contactId = search.contact.id;\n    }\n  } catch(e) {}\n}\n\nif (!contactId) {\n  try {\n    const create = await this.helpers.httpRequest({\n      method: \"POST\",\n      url: \"https://services.leadconnectorhq.com/contacts/\",\n      headers: { \"Authorization\": \"Bearer \" + GHL_KEY, \"Version\": \"2021-07-28\", \"Content-Type\": \"application/json\" },\n      body: { locationId, firstName, phone, email: email || undefined, tags: [\"challenge-active\"] },\n      json: true\n    });\n    contactId = create.contact.id;\n  } catch(e) {}\n}\n\n// Add challenge-active tag\nif (contactId) {\n  try {\n    await this.helpers.httpRequest({\n      method: \"PUT\",\n      url: \"https://services.leadconnectorhq.com/contacts/\" + contactId,\n      headers: { \"Authorization\": \"Bearer \" + GHL_KEY, \"Version\": \"2021-07-28\", \"Content-Type\": \"application/json\" },\n      body: { tags: [\"challenge-active\"] },\n      json: true\n    });\n  } catch(e) {}\n}\n\n// Get or create conversation ID -- REQUIRED for reliable SMS sending\nif (contactId) {\n  try {\n    const convSearch = await this.helpers.httpRequest({\n      method: \"GET\",\n      url: \"https://services.leadconnectorhq.com/conversations/search\",\n      qs: { contactId },\n      headers: { \"Authorization\": \"Bearer \" + GHL_KEY, \"Version\": \"2021-04-15\" },\n      json: true\n    });\n    if (convSearch.conversations && convSearch.conversations.length > 0) {\n      conversationId = convSearch.conversations[0].id;\n    }\n  } catch(e) {}\n  \n  // If no conversation exists, create one by sending the first message\n  // The API will create the conversation automatically when we include contactId\n  // We just pass empty string and the SMS node will handle it\n}\n\nreturn [{ json: { contactId, conversationId, phone, firstName, email, locationId, signupTime: new Date().toISOString() } }];"
      },
      "id": "lookup-contact",
      "name": "Lookup/Create GHL Contact",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        660,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const contactId = $input.first().json.contactId;\nconst conversationId = $input.first().json.conversationId || \"\";\nconst firstName = $input.first().json.firstName || \"there\";\n\nconst msg = \"Hey \" + firstName + \"! Nurse Charles here. You are signed up for my 5-day challenge. Every morning at 8 AM, I will text you a video and one thing to do that day. On Day 5, you get a personalized plan built from your answers. All you have to do is text back ONE word when I ask. Talk soon!\";\n\nawait this.helpers.httpRequest({\n  method: \"POST\",\n  url: \"https://services.leadconnectorhq.com/conversations/messages\",\n  headers: {\n    \"Authorization\": \"Bearer pit-b68fa048-e2a1-4206-a68a-b3e6d3d7091b\",\n    \"Version\": \"2021-04-15\",\n    \"Content-Type\": \"application/json\"\n  },\n  body: { type: \"SMS\", contactId, conversationId, message: msg },\n  json: true\n});\n\nconst items = $input.all();\nitems[0].json.signupTime = new Date().toISOString();\nreturn items;"
      },
      "id": "sms-day0",
      "name": "SMS Day 0: Confirmation",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        880,
        300
      ]
    },
    {
      "parameters": {
        "amount": 1,
        "unit": "days"
      },
      "id": "wait-day1",
      "name": "Wait until Day 1 8am ET",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1100,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const contactId = $input.first().json.contactId;\nconst locationId = $input.first().json.locationId;\n\nconst message = `Day 1/5 -- Nurse Charles.\\n\\nA 21-year-old came into my ER turning gray. Not pale. Gray. His friends thought it was an asthma attack. It wasn't.\\n\\nWatch today's video (3 min): https://youtu.be/hjaIXk8RQiA\\n\\nYour lungs start healing in 20 minutes after your last hit. The clock starts when you decide.\\n\\nShare this number with someone who needs it: text READY to 470-672-7008`;\n\nawait this.helpers.httpRequest({\n  method: 'POST',\n  url: 'https://services.leadconnectorhq.com/conversations/messages',\n  headers: {\n    'Authorization': `Bearer ${\"pit-b68fa048-e2a1-4206-a68a-b3e6d3d7091b\"}`,\n    'Version': '2021-04-15',\n    'Content-Type': 'application/json'\n  },\n  body: { type: 'SMS', contactId, conversationId: $input.first().json.conversationId || '', message },\n  json: true\n});\n\nreturn $input.all();"
      },
      "id": "sms-day1",
      "name": "SMS Day 1: ER Story",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1320,
        300
      ]
    },
    {
      "parameters": {
        "amount": 1,
        "unit": "days"
      },
      "id": "wait-day2",
      "name": "Wait until Day 2 8am ET",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1540,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const contactId = $input.first().json.contactId;\n\nconst message = `Day 2/5 -- Nurse Charles.\\n\\nYour vape makes you feel calm. That's a lie. You're not calming down -- you're fixing a problem the nicotine CREATED.\\n\\nWatch today's video (4 min): https://youtu.be/tozCo5sl0A0\\n\\nWhich layer hits you hardest?\\n\\nReply: CHEMICAL, HABIT, or EMOTIONAL`;\n\nawait this.helpers.httpRequest({\n  method: 'POST',\n  url: 'https://services.leadconnectorhq.com/conversations/messages',\n  headers: {\n    'Authorization': `Bearer ${\"pit-b68fa048-e2a1-4206-a68a-b3e6d3d7091b\"}`,\n    'Version': '2021-04-15',\n    'Content-Type': 'application/json'\n  },\n  body: { type: 'SMS', contactId, conversationId: $input.first().json.conversationId || '', message },\n  json: true\n});\n\nreturn $input.all();"
      },
      "id": "sms-day2",
      "name": "SMS Day 2: Brain Science",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1760,
        300
      ]
    },
    {
      "parameters": {
        "amount": 1,
        "unit": "days"
      },
      "id": "wait-day3",
      "name": "Wait until Day 3 8am ET",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1980,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const contactId = $input.first().json.contactId;\n\nconst message = `Day 3/5 -- Nurse Charles.\\n\\nYou can't beat something you don't see coming. Today we map your triggers -- the moments your brain reaches for nicotine before you even decide to.\\n\\nWatch today's video (4 min): https://youtu.be/OX2xhkQswkU\\n\\nWhat's your #1 trigger?\\n\\nReply: STRESS, PARTIES, BOREDOM, MORNINGS, or DRINKING`;\n\nawait this.helpers.httpRequest({\n  method: 'POST',\n  url: 'https://services.leadconnectorhq.com/conversations/messages',\n  headers: {\n    'Authorization': `Bearer ${\"pit-b68fa048-e2a1-4206-a68a-b3e6d3d7091b\"}`,\n    'Version': '2021-04-15',\n    'Content-Type': 'application/json'\n  },\n  body: { type: 'SMS', contactId, conversationId: $input.first().json.conversationId || '', message },\n  json: true\n});\n\nreturn $input.all();"
      },
      "id": "sms-day3",
      "name": "SMS Day 3: Triggers",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2200,
        300
      ]
    },
    {
      "parameters": {
        "amount": 1,
        "unit": "days"
      },
      "id": "wait-day4",
      "name": "Wait until Day 4 8am ET",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        2420,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const contactId = $input.first().json.contactId;\n\nconst message = `Day 4/5 -- Nurse Charles.\\n\\nIn 37 years, thousands of patients told me they wanted to quit. The ones who actually did it all followed the same 5 steps. I've never shared all 5 publicly until now.\\n\\nWatch today's video (5 min): VIDEO_LINK_DAY4_PENDING\\n\\nWhen's your quit date? Pick a day 3-7 days from now.\\n\\nReply with your date (example: APRIL 10)`;\n\nawait this.helpers.httpRequest({\n  method: 'POST',\n  url: 'https://services.leadconnectorhq.com/conversations/messages',\n  headers: {\n    'Authorization': `Bearer ${\"pit-b68fa048-e2a1-4206-a68a-b3e6d3d7091b\"}`,\n    'Version': '2021-04-15',\n    'Content-Type': 'application/json'\n  },\n  body: { type: 'SMS', contactId, conversationId: $input.first().json.conversationId || '', message },\n  json: true\n});\n\nreturn $input.all();"
      },
      "id": "sms-day4",
      "name": "SMS Day 4: The Protocol",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2640,
        300
      ]
    },
    {
      "parameters": {
        "amount": 1,
        "unit": "days"
      },
      "id": "wait-day5",
      "name": "Wait until Day 5 8am ET",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        2860,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// Day 5: Build personalized quit plan from GHL contact custom fields\nconst contactId = $input.first().json.contactId;\nconst firstName = $input.first().json.firstName;\n\n// Fetch contact to get custom fields and tags\nconst contact = await this.helpers.httpRequest({\n  method: 'GET',\n  url: `https://services.leadconnectorhq.com/contacts/${contactId}`,\n  headers: {\n    'Authorization': `Bearer ${\"pit-b68fa048-e2a1-4206-a68a-b3e6d3d7091b\"}`,\n    'Version': '2021-07-28'\n  },\n  json: true\n});\n\nconst tags = contact.contact?.tags || [];\nconst customFields = contact.contact?.customFields || [];\n\n// Extract answers from tags (fallbacks if custom fields not set)\nlet nicotineType = 'nicotine';\nif (tags.includes('nicotine-vape')) nicotineType = 'Vape';\nelse if (tags.includes('nicotine-cigarette')) nicotineType = 'Cigarettes';\nelse if (tags.includes('nicotine-dip')) nicotineType = 'Dip';\n\nlet layer = 'habit';\nif (tags.includes('layer-chemical')) layer = 'Chemical';\nelse if (tags.includes('layer-habit')) layer = 'Habit';\nelse if (tags.includes('layer-emotional')) layer = 'Emotional';\n\nlet trigger = 'stress';\nif (tags.includes('trigger-stress')) trigger = 'Stress';\nelse if (tags.includes('trigger-parties')) trigger = 'Parties';\nelse if (tags.includes('trigger-boredom')) trigger = 'Boredom';\nelse if (tags.includes('trigger-mornings')) trigger = 'Mornings';\nelse if (tags.includes('trigger-drinking')) trigger = 'Drinking';\n\nlet quitDate = 'soon';\nif (tags.includes('quit-date-set')) {\n  // Try to find it in custom fields\n  const qdf = customFields.find(f => f.id === 'quit_date' || f.key === 'quit_date');\n  if (qdf) quitDate = qdf.value;\n}\n\n// Build nicotine-specific advice\nlet nicotineAdvice = '';\nswitch(nicotineType) {\n  case 'Vape': nicotineAdvice = 'Remove every vape and pod from your house and car today. Replace with gum, mints, or a stress ball.'; break;\n  case 'Cigarettes': nicotineAdvice = 'Throw out every pack, lighter, and ashtray today. Stock up on cinnamon toothpicks or gum.'; break;\n  case 'Dip': nicotineAdvice = 'Clear out every tin and replace with sunflower seeds or gum. Change your post-meal routine.'; break;\n  default: nicotineAdvice = 'Remove all nicotine products from your house and car today. Replace with gum or mints.'; break;\n}\n\n// Build layer-specific advice\nlet layerAdvice = '';\nswitch(layer) {\n  case 'Habit': layerAdvice = 'Your hands and mouth need a replacement. Keep something in your hands at all times -- water bottle, pen, stress ball.'; break;\n  case 'Chemical': layerAdvice = 'Physical withdrawal peaks at Day 3. Drink 80oz water daily, walk 20 min, sleep 8 hrs. Set a timer when cravings hit -- they last 3-5 minutes.'; break;\n  case 'Emotional': layerAdvice = 'You need new coping tools. When stress hits: 4-7-8 breathing (4 in, 7 hold, 8 out, 3 times). Call someone for 2 minutes. Journal for 5.'; break;\n}\n\n// Build trigger-specific advice\nlet triggerAdvice = '';\nswitch(trigger) {\n  case 'Parties': triggerAdvice = 'Hold your drink in your smoking hand. Tell one person at every event that you quit. Avoid parties for the first 2 weeks if possible.'; break;\n  case 'Stress': triggerAdvice = 'When stress hits, do 4-7-8 breathing before reaching for anything. A 2-minute phone call fires the same dopamine as nicotine.'; break;\n  case 'Boredom': triggerAdvice = 'Have something loaded on your phone -- podcast, playlist, game. Fill the gap before your hands fill it for you.'; break;\n  case 'Mornings': triggerAdvice = 'Move your body in the first 10 minutes of waking up. Pushups, walk, anything. Replace the morning nicotine with movement.'; break;\n  case 'Drinking': triggerAdvice = 'Cut alcohol for the first 2 weeks. Drinking reactivates cravings and lowers your defenses. This is the #1 relapse scenario.'; break;\n}\n\nconst planMessage = `Day 5/5 -- Your personalized quit plan, ${firstName}.\\n\\nBased on what you told me this week:\\n\\nYou use: ${nicotineType}\\nYour biggest layer: ${layer}\\nYour #1 trigger: ${trigger}\\nYour quit date: ${quitDate}\\n\\nYOUR PLAN:\\n\\n${nicotineAdvice}\\n\\n${layerAdvice}\\n\\n${triggerAdvice}\\n\\nYou've got the plan. Watch today's final video below.`;\n\n// Send the personalized plan\nawait this.helpers.httpRequest({\n  method: 'POST',\n  url: 'https://services.leadconnectorhq.com/conversations/messages',\n  headers: {\n    'Authorization': `Bearer ${\"pit-b68fa048-e2a1-4206-a68a-b3e6d3d7091b\"}`,\n    'Version': '2021-04-15',\n    'Content-Type': 'application/json'\n  },\n  body: { type: 'SMS', contactId, conversationId: $input.first().json.conversationId || '', message: planMessage },\n  json: true\n});\n\nreturn [{ json: { ...($input.first().json), nicotineType, layer, trigger, quitDate } }];"
      },
      "id": "sms-day5-plan",
      "name": "SMS Day 5: Personalized Plan",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        3080,
        300
      ]
    },
    {
      "parameters": {
        "amount": 5,
        "unit": "minutes"
      },
      "id": "wait-5min",
      "name": "Wait 5 Min",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        3300,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const contactId = $input.first().json.contactId;\n\nconst message = `Your Day 5 video -- what happens to your body when you quit:\\n\\nhttps://youtu.be/eqESi-9Hc9o\\n\\n20 min: heart rate normalizes\\n48 hrs: all nicotine gone\\n72 hrs: breathing gets easier\\n2 weeks: lung function up 30%\\n6 months: anxiety LOWER than when you were using\\n\\nThe clock starts when you decide. -NC`;\n\nawait this.helpers.httpRequest({\n  method: 'POST',\n  url: 'https://services.leadconnectorhq.com/conversations/messages',\n  headers: {\n    'Authorization': `Bearer ${\"pit-b68fa048-e2a1-4206-a68a-b3e6d3d7091b\"}`,\n    'Version': '2021-04-15',\n    'Content-Type': 'application/json'\n  },\n  body: { type: 'SMS', contactId, conversationId: $input.first().json.conversationId || '', message },\n  json: true\n});\n\nreturn $input.all();"
      },
      "id": "sms-day5-video",
      "name": "SMS Day 5: Video",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        3520,
        300
      ]
    },
    {
      "parameters": {
        "amount": 3,
        "unit": "hours"
      },
      "id": "wait-3hr",
      "name": "Wait 3 Hours",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        3740,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const contactId = $input.first().json.contactId;\nconst firstName = $input.first().json.firstName;\nconst nicotineType = $input.first().json.nicotineType || 'nicotine';\n\nconst message = `${firstName} -- you showed up for 5 days. That takes guts.\\n\\nI built the Smoke-Free Toolkit for people who want to keep going. The full guide, your personalized plan as a PDF, 3 bonus craving videos, and a trigger replacement wallet card. Protocols specific to ${nicotineType} users.\\n\\nText TOOLKIT for the link ($27)\\nText KIT for the Quit Kit ($47) -- everything in the Toolkit PLUS my 45-min masterclass, 30 days of text check-ins from me, the Relapse Prevention Playbook, and 3 private audio messages\\n\\nThe Quit Kit is what I'd recommend. 30 days of check-ins from me plus a masterclass that goes way deeper than the challenge.\\n\\nEither way -- you earned your plan. It's yours. -NC`;\n\nawait this.helpers.httpRequest({\n  method: 'POST',\n  url: 'https://services.leadconnectorhq.com/conversations/messages',\n  headers: {\n    'Authorization': `Bearer ${\"pit-b68fa048-e2a1-4206-a68a-b3e6d3d7091b\"}`,\n    'Version': '2021-04-15',\n    'Content-Type': 'application/json'\n  },\n  body: { type: 'SMS', contactId, conversationId: $input.first().json.conversationId || '', message },\n  json: true\n});\n\nreturn $input.all();"
      },
      "id": "sms-day5-offer",
      "name": "SMS Day 5: The Offer",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        3960,
        300
      ]
    },
    {
      "parameters": {
        "amount": 6,
        "unit": "hours"
      },
      "id": "wait-6hr",
      "name": "Wait 6 Hours",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        4180,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const contactId = $input.first().json.contactId;\nconst firstName = $input.first().json.firstName;\nconst quitDate = $input.first().json.quitDate || 'soon';\n\nconst message = `Last thing from me on this challenge, ${firstName}.\\n\\nYour quit date is ${quitDate}. That's coming up.\\n\\nYour plan is ready. The Toolkit has everything you need to execute it.\\n\\nText TOOLKIT ($27) or KIT ($47) for the link.\\n\\nOr just keep your plan -- you earned it. I'm proud of you either way.\\n\\nText READY to this number anytime you need help. I'm here. -NC`;\n\nawait this.helpers.httpRequest({\n  method: 'POST',\n  url: 'https://services.leadconnectorhq.com/conversations/messages',\n  headers: {\n    'Authorization': `Bearer ${\"pit-b68fa048-e2a1-4206-a68a-b3e6d3d7091b\"}`,\n    'Version': '2021-04-15',\n    'Content-Type': 'application/json'\n  },\n  body: { type: 'SMS', contactId, conversationId: $input.first().json.conversationId || '', message },\n  json: true\n});\n\n// Tag as challenge complete\nawait this.helpers.httpRequest({\n  method: 'PUT',\n  url: `https://services.leadconnectorhq.com/contacts/${contactId}`,\n  headers: {\n    'Authorization': `Bearer ${\"pit-b68fa048-e2a1-4206-a68a-b3e6d3d7091b\"}`,\n    'Version': '2021-07-28',\n    'Content-Type': 'application/json'\n  },\n  body: { tags: ['challenge-complete'] },\n  json: true\n});\n\nreturn $input.all();"
      },
      "id": "sms-day5-nudge",
      "name": "SMS Day 5: Last Nudge",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        4400,
        300
      ]
    },
    {
      "parameters": {
        "amount": 2,
        "unit": "days"
      },
      "id": "wait-day7",
      "name": "Wait until Day 7 8am ET",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        4620,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const contactId = $input.first().json.contactId;\nconst firstName = $input.first().json.firstName;\nconst quitDate = $input.first().json.quitDate || 'your quit date';\n\nconst message = `Hey ${firstName} -- Nurse Charles. Quick check-in. How are you doing since the challenge?\\n\\nYour quit date was ${quitDate}. Did you start?\\n\\nReply YES or NOT YET. No judgment either way.`;\n\nawait this.helpers.httpRequest({\n  method: 'POST',\n  url: 'https://services.leadconnectorhq.com/conversations/messages',\n  headers: {\n    'Authorization': `Bearer ${\"pit-b68fa048-e2a1-4206-a68a-b3e6d3d7091b\"}`,\n    'Version': '2021-04-15',\n    'Content-Type': 'application/json'\n  },\n  body: { type: 'SMS', contactId, conversationId: $input.first().json.conversationId || '', message },\n  json: true\n});\n\nreturn $input.all();"
      },
      "id": "sms-day7",
      "name": "SMS Day 7: Check-in",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        4840,
        300
      ]
    },
    {
      "parameters": {
        "amount": 1,
        "unit": "days"
      },
      "id": "wait-day14",
      "name": "Wait until Day 14 8am ET",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        5060,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const contactId = $input.first().json.contactId;\nconst firstName = $input.first().json.firstName;\nconst quitDate = $input.first().json.quitDate || 'your quit date';\n\nconst message = `${firstName} -- checking in. Your quit date was ${quitDate}.\\n\\nIf you started: you're past the worst of it. The cravings get weaker every day.\\n\\nIf you haven't yet: that's okay. Text me a new date when you're ready.\\n\\nEither way -- I'm in your corner. -NC`;\n\nawait this.helpers.httpRequest({\n  method: 'POST',\n  url: 'https://services.leadconnectorhq.com/conversations/messages',\n  headers: {\n    'Authorization': `Bearer ${\"pit-b68fa048-e2a1-4206-a68a-b3e6d3d7091b\"}`,\n    'Version': '2021-04-15',\n    'Content-Type': 'application/json'\n  },\n  body: { type: 'SMS', contactId, conversationId: $input.first().json.conversationId || '', message },\n  json: true\n});\n\nreturn $input.all();"
      },
      "id": "sms-day14",
      "name": "SMS Day 14: Final Check-in",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        5280,
        300
      ]
    }
  ],
  "connections": {
    "Challenge Signup Webhook": {
      "main": [
        [
          {
            "node": "Extract Contact Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Contact Data": {
      "main": [
        [
          {
            "node": "Lookup/Create GHL Contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lookup/Create GHL Contact": {
      "main": [
        [
          {
            "node": "SMS Day 0: Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SMS Day 0: Confirmation": {
      "main": [
        [
          {
            "node": "Wait until Day 1 8am ET",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait until Day 1 8am ET": {
      "main": [
        [
          {
            "node": "SMS Day 1: ER Story",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SMS Day 1: ER Story": {
      "main": [
        [
          {
            "node": "Wait until Day 2 8am ET",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait until Day 2 8am ET": {
      "main": [
        [
          {
            "node": "SMS Day 2: Brain Science",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SMS Day 2: Brain Science": {
      "main": [
        [
          {
            "node": "Wait until Day 3 8am ET",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait until Day 3 8am ET": {
      "main": [
        [
          {
            "node": "SMS Day 3: Triggers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SMS Day 3: Triggers": {
      "main": [
        [
          {
            "node": "Wait until Day 4 8am ET",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait until Day 4 8am ET": {
      "main": [
        [
          {
            "node": "SMS Day 4: The Protocol",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SMS Day 4: The Protocol": {
      "main": [
        [
          {
            "node": "Wait until Day 5 8am ET",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait until Day 5 8am ET": {
      "main": [
        [
          {
            "node": "SMS Day 5: Personalized Plan",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SMS Day 5: Personalized Plan": {
      "main": [
        [
          {
            "node": "Wait 5 Min",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 5 Min": {
      "main": [
        [
          {
            "node": "SMS Day 5: Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SMS Day 5: Video": {
      "main": [
        [
          {
            "node": "Wait 3 Hours",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 3 Hours": {
      "main": [
        [
          {
            "node": "SMS Day 5: The Offer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SMS Day 5: The Offer": {
      "main": [
        [
          {
            "node": "Wait 6 Hours",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 6 Hours": {
      "main": [
        [
          {
            "node": "SMS Day 5: Last Nudge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SMS Day 5: Last Nudge": {
      "main": [
        [
          {
            "node": "Wait until Day 7 8am ET",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait until Day 7 8am ET": {
      "main": [
        [
          {
            "node": "SMS Day 7: Check-in",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SMS Day 7: Check-in": {
      "main": [
        [
          {
            "node": "Wait until Day 14 8am ET",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait until Day 14 8am ET": {
      "main": [
        [
          {
            "node": "SMS Day 14: Final Check-in",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SMS Day 14: Final Check-in": {
      "main": [
        []
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "callerPolicy": "workflowsFromSameOwner",
    "availableInMCP": false
  },
  "staticData": null,
  "meta": null,
  "pinData": null,
  "versionId": "12355ab2-dee1-4951-a90d-2af8b4801235",
  "activeVersionId": null,
  "versionCounter": 22,
  "triggerCount": 1,
  "shared": [
    {
      "updatedAt": "2026-03-31T01:40:44.035Z",
      "createdAt": "2026-03-31T01:40:44.035Z",
      "role": "workflow:owner",
      "workflowId": "ogSjA37fEtOn4xDw",
      "projectId": "91dLj8Hg37i136qG",
      "project": {
        "updatedAt": "2026-03-22T06:53:28.112Z",
        "createdAt": "2026-02-12T18:32:53.056Z",
        "id": "91dLj8Hg37i136qG",
        "name": "Bryce Folsom <bfolsom@emersonnorth.com>",
        "type": "personal",
        "icon": null,
        "description": null,
        "creatorId": "17d3676f-3e74-4586-8363-5c1f4d237ed7"
      }
    }
  ],
  "tags": [],
  "activeVersion": null
}