{
  "updatedAt": "2026-03-31T02:10:38.506Z",
  "createdAt": "2026-03-31T02:10:38.506Z",
  "id": "qHU7uiBnWPStuxtQ",
  "name": "NC Nurture - Intake",
  "description": null,
  "active": false,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "nc-nurture-9",
        "responseMode": "onReceived",
        "responseData": "allEntries",
        "options": {}
      },
      "id": "webhook-trigger",
      "name": "GHL Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "webhookId": "nc-nurture-9"
    },
    {
      "parameters": {
        "jsCode": "const body = $input.first().json.body || $input.first().json;\nconst email = body.email || '';\nconst firstName = body.first_name || body.firstName || 'there';\nconst contactId = body.contactId || body.contact_id || '';\nconst startDate = new Date().toISOString();\n\nreturn [{ json: { email, firstName, contactId, startDate } }];"
      },
      "id": "extract-contact",
      "name": "Extract Contact Data",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        250,
        0
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": false,
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "leftValue": "={{ $json.email }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              }
            }
          ],
          "combinator": "and"
        }
      },
      "id": "email-check",
      "name": "Has Email?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        500,
        0
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1E_YylKUoOY1xFerCdDfZhwJgs7tYeigwlKmyGGtGzDY",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Sheet1",
          "mode": "list",
          "cachedResultName": "Sheet1"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "contactId": "={{ $json.contactId }}",
            "email": "={{ $json.email }}",
            "firstName": "={{ $json.firstName }}",
            "startDate": "={{ $json.startDate }}",
            "lastEmailSent": "0",
            "status": "active"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "contactId",
              "displayName": "contactId",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "email",
              "displayName": "email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "firstName",
              "displayName": "firstName",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "startDate",
              "displayName": "startDate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "lastEmailSent",
              "displayName": "lastEmailSent",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "displayName": "status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ]
        },
        "options": {}
      },
      "id": "append-sheet",
      "name": "Add to Tracker",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        750,
        0
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "OhjizsinSISmx4Gl",
          "name": "Google Sheets OAuth2 API"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "function hdr(subtitle){\n  subtitle = subtitle || 'Real Talk from the ER &bull; 37+ Years Strong';\n  return '<div style=\"background:linear-gradient(135deg,#0B0F1A,#151C2E);padding:30px 40px;text-align:center;border-bottom:2px solid rgba(96,247,250,0.15)\"><h1 style=\"color:#60f7fa;font-family:Bebas Neue,Arial,sans-serif;font-size:28px;margin:0;font-weight:600;letter-spacing:0.05em\">NURSE CHARLES</h1><p style=\"color:#5a9ea3;font-size:14px;margin:5px 0 0\">'+subtitle+'</p></div>';\n}\nfunction ftr(){\n  return '<div style=\"background:#080c16;padding:25px 40px;text-align:center;border-top:1px solid rgba(96,247,250,0.08)\"><div style=\"margin:0 0 15px\"><a href=\"https://www.tiktok.com/@nursecharlesmedia\" style=\"color:#5a9ea3;text-decoration:none;margin:0 12px;font-size:14px\">TikTok</a><a href=\"https://www.instagram.com/nursecharlesmedia\" style=\"color:#5a9ea3;text-decoration:none;margin:0 12px;font-size:14px\">Instagram</a><a href=\"https://www.youtube.com/@NurseCharles\" style=\"color:#5a9ea3;text-decoration:none;margin:0 12px;font-size:14px\">YouTube</a></div><p style=\"color:#64748b;font-size:12px;margin:5px 0\">&copy; 2026 Nurse Charles Media. All rights reserved.</p><p style=\"color:#64748b;font-size:12px;margin:5px 0\"><a href=\"#\" style=\"color:#5a9ea3;text-decoration:underline\">Unsubscribe</a></p></div>';\n}\nfunction sig(signoff){\n  return '<div style=\"border-top:1px solid rgba(96,247,250,0.08);padding-top:20px;margin-top:10px\"><p style=\"margin:0 0 4px;font-size:15px;color:#e2e8f0\"><strong>'+signoff+'</strong></p><p style=\"margin:0 0 4px;font-size:15px;color:#e2e8f0\"><strong>Nurse Charles</strong></p><p style=\"color:#64748b;font-size:14px;margin:0\">ER Nurse &bull; Educator &bull; Advocate</p></div>';\n}\nfunction wrap(content,ctaText,ctaUrl,subtitle){\n  var cta=ctaText?'<div style=\"text-align:center;margin:30px 0\"><a href=\"'+ctaUrl+'\" style=\"display:inline-block;background:linear-gradient(135deg,#43797d,#5a9ea3);color:#fff;text-decoration:none;padding:14px 32px;border-radius:6px;font-weight:600;font-size:16px\">'+ctaText+'</a></div>':'';\n  return '<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\"></head><body style=\"margin:0;padding:0;background-color:#080c16;font-family:Helvetica Neue,Arial,sans-serif\"><div style=\"max-width:600px;margin:0 auto;background:#0B0F1A\">'+hdr(subtitle)+'<div style=\"padding:35px 40px;color:#e2e8f0;line-height:1.7;font-size:16px\">'+content+cta+'</div>'+ftr()+'</div></body></html>';\n}\nfunction box(inner){\n  return '<div style=\"background:rgba(96,247,250,0.06);border-left:3px solid #60f7fa;padding:18px 22px;margin:22px 0;border-radius:0 6px 6px 0\">'+inner+'</div>';\n}\nfunction tipCard(num,title,text){\n  return '<div style=\"background:rgba(96,247,250,0.06);border-radius:8px;padding:20px 24px;margin:18px 0\"><p style=\"color:#60f7fa;font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:2px;margin:0 0 6px\">Lesson '+num+'</p><h3 style=\"color:#fff;font-size:17px;margin:0 0 8px\">'+title+'</h3><p style=\"margin:0;font-size:15px;color:#e2e8f0\">'+text+'</p></div>';\n}\nfunction stepBlock(num,title,text){\n  return '<div style=\"margin:22px 0;padding:18px 22px;border-radius:8px;background:rgba(96,247,250,0.06)\"><span style=\"display:inline-block;background:linear-gradient(135deg,#43797d,#5a9ea3);color:#fff;width:30px;height:30px;border-radius:50%;text-align:center;line-height:30px;font-weight:700;font-size:14px;margin-right:10px\">'+num+'</span><h3 style=\"display:inline;color:#fff;font-size:17px\">'+title+'</h3><p style=\"margin:10px 0 0;font-size:15px;color:#e2e8f0\">'+text+'</p></div>';\n}\nfunction checkItem(text){\n  return '<li style=\"padding:10px 0 10px 35px;position:relative;border-bottom:1px solid rgba(96,247,250,0.08);font-size:15px;color:#e2e8f0;list-style:none\"><span style=\"position:absolute;left:8px;color:#60f7fa;font-weight:700;font-size:18px\">&#10003;</span>'+text+'</li>';\n}\nconst fn = $input.first().json.firstName || 'there';\nreturn [{json:{emailHtml:wrap('<h2 style=\"color:#fff;font-size:20px;margin-top:0\">Welcome &#8212; I\\'m glad you\\'re here.</h2>'+\n'<p>Hey '+fn+',</p>'+\n'<p>I\\'m Charles &#8212; but most people just call me Nurse Charles. If you found me on TikTok or Instagram, you already know I don\\'t sugarcoat things. I\\'ve spent <strong>37+ years</strong> in emergency rooms across this country, and I\\'ve seen just about everything.</p>'+\n'<p>Gunshot wounds at 3 AM. Parents holding a child who can\\'t breathe. Teenagers who swore they\\'d \\\"only vaped a few times.\\\" Nurses on the edge of burnout who just need someone to tell them <em>it\\'s okay to feel this way.</em></p>'+\nbox('<p style=\"margin:0;font-size:15px;color:#e2e8f0\"><strong>Here\\'s what I want you to know:</strong> I didn\\'t build a following of 150,000+ people by being flashy. I built it by being <em>honest.</em> The same way I talk to patients &#8212; direct, caring, no BS &#8212; that\\'s exactly how I\\'ll show up in your inbox.</p>')+\n'<p>Over the next few weeks, I\\'m going to share things with you that I don\\'t always get to say in a 60-second video:</p>'+\n'<ul><li style=\"color:#e2e8f0\">Stories from the ER that changed how I see healthcare</li><li style=\"color:#e2e8f0\">Practical nursing tips from nearly four decades on the floor</li><li style=\"color:#e2e8f0\">The truth about vaping that the industry doesn\\'t want you to hear</li><li style=\"color:#e2e8f0\">Resources I\\'ve built to help nurses, parents, and communities</li></ul>'+\n'<p>This isn\\'t a sales pitch. This is a conversation. And it starts right here.</p>'+\n'<p>Hit reply and tell me &#8212; what brought you into my world? I read every message.</p>'+\nsig('Stay safe out there,'),'Visit NurseCharlesMedia.com','https://nursecharlesmedia.com')}}];"
      },
      "id": "build-email-01",
      "name": "Build Email 01",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1000,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.resend.com/emails",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"from\": \"Nurse Charles <charles@mail.nursecharlesmedia.com>\",\n  \"to\": [\"{{ $('Extract Contact Data').item.json.email }}\"],\n  \"subject\": \"The ER nurse TikTok didn't tell you about (until now)\",\n  \"html\": {{ JSON.stringify($json.emailHtml) }}\n}"
      },
      "id": "send-email-01",
      "name": "Send Email 01",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1250,
        0
      ],
      "credentials": {
        "httpHeaderAuth": {
          "id": "83bayJB4JKjeXtVy",
          "name": "Resend API Key"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1E_YylKUoOY1xFerCdDfZhwJgs7tYeigwlKmyGGtGzDY",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Sheet1",
          "mode": "list",
          "cachedResultName": "Sheet1"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "contactId": "={{ $('Extract Contact Data').item.json.contactId }}",
            "lastEmailSent": "1"
          },
          "matchingColumns": [
            "contactId"
          ],
          "schema": [
            {
              "id": "contactId",
              "displayName": "contactId",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "lastEmailSent",
              "displayName": "lastEmailSent",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ]
        },
        "options": {}
      },
      "id": "update-sheet-01",
      "name": "Update Tracker (Email 1 Sent)",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1500,
        0
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "OhjizsinSISmx4Gl",
          "name": "Google Sheets OAuth2 API"
        }
      }
    }
  ],
  "connections": {
    "GHL Webhook": {
      "main": [
        [
          {
            "node": "Extract Contact Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Contact Data": {
      "main": [
        [
          {
            "node": "Has Email?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has Email?": {
      "main": [
        [
          {
            "node": "Add to Tracker",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Add to Tracker": {
      "main": [
        [
          {
            "node": "Build Email 01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Email 01": {
      "main": [
        [
          {
            "node": "Send Email 01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email 01": {
      "main": [
        [
          {
            "node": "Update Tracker (Email 1 Sent)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "callerPolicy": "workflowsFromSameOwner",
    "availableInMCP": false
  },
  "staticData": null,
  "meta": null,
  "pinData": null,
  "versionId": "0ed3e587-3e87-4095-b4b0-9f7e255cc7cc",
  "activeVersionId": null,
  "versionCounter": 5,
  "triggerCount": 1,
  "shared": [
    {
      "updatedAt": "2026-03-31T02:10:38.511Z",
      "createdAt": "2026-03-31T02:10:38.511Z",
      "role": "workflow:owner",
      "workflowId": "qHU7uiBnWPStuxtQ",
      "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
}