{
  "id": "DEeKjmJ4zMiVgKym",
  "name": "Landscaping Lead Follow-Up and Booking Automation with GoHighLevel",
  "tags": [],
  "nodes": [
    {
      "id": "45d3d7b1-914c-4186-afcf-1ebb58fab95c",
      "name": "GoHighLevel New Lead Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1920,
        96
      ],
      "parameters": {
        "path": "gohighlevel-lead-webhook",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2.1
    },
    {
      "id": "a9c9359d-34f0-452b-b59e-8f85ec1b5b35",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -1696,
        96
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "ghlApiUrl",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__GoHighLevel API Base URL__>"
            },
            {
              "id": "id-2",
              "name": "ghlApiKey",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__GoHighLevel API Key__>"
            },
            {
              "id": "id-3",
              "name": "slackChannel",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Slack Channel ID for notifications__>"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "a512f367-18bb-404f-b5ce-e2dd273edb0c",
      "name": "Normalize Lead Information",
      "type": "n8n-nodes-base.set",
      "position": [
        -1472,
        96
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "leadName",
              "type": "string",
              "value": "={{ $json.body.contact.name || $json.body.contact.firstName + ' ' + $json.body.contact.lastName }}"
            },
            {
              "id": "id-2",
              "name": "leadPhone",
              "type": "string",
              "value": "={{ $json.body.contact.phone }}"
            },
            {
              "id": "id-3",
              "name": "leadEmail",
              "type": "string",
              "value": "={{ $json.body.contact.email }}"
            },
            {
              "id": "id-4",
              "name": "serviceType",
              "type": "string",
              "value": "={{ $json.body.contact.customFields?.serviceType || 'General Landscaping' }}"
            },
            {
              "id": "id-5",
              "name": "leadId",
              "type": "string",
              "value": "={{ $json.body.contact.id }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "665ef1b8-8f3a-4569-8dbb-d333cd636b4b",
      "name": "Generate Personalized Follow-Up Message",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -1216,
        96
      ],
      "parameters": {
        "options": {},
        "responses": {
          "values": [
            {
              "content": "=Generate a personalized follow-up message for a landscaping lead. Lead Name: {{ $json.leadName }}, Service Type: {{ $json.serviceType }}. Make it friendly, professional, and mention we will reach out soon to discuss their {{ $json.serviceType }} needs."
            }
          ]
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "cc782975-f21b-479f-bbf4-6d27c98c8a59",
      "name": "Send SMS via GoHighLevel",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -896,
        96
      ],
      "parameters": {
        "url": "={{ $('Workflow Configuration').first().json.ghlApiUrl }}/conversations/messages",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"type\": \"SMS\",\n  \"contactId\": \"{{ $json.leadId }}\",\n  \"message\": \"{{ $('Generate Personalized Follow-Up Message').first().json.message }}\"\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{ 'Bearer ' + $('Workflow Configuration').first().json.ghlApiKey }}"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "58d345a4-da92-462c-8e08-97649671d14f",
      "name": "Send Email via GoHighLevel",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -672,
        96
      ],
      "parameters": {
        "url": "={{ $('Workflow Configuration').first().json.ghlApiUrl }}/conversations/messages",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"type\": \"Email\",\n  \"contactId\": \"{{ $json.leadId }}\",\n  \"subject\": \"Welcome to Our Landscaping Services!\",\n  \"html\": \"{{ $('Generate Personalized Follow-Up Message').first().json.message }}\"\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{ 'Bearer ' + $('Workflow Configuration').first().json.ghlApiKey }}"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "7023f1ee-b759-4a4e-b11d-618178d6de01",
      "name": "Check Email Open Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -448,
        96
      ],
      "parameters": {
        "url": "={{ $('Workflow Configuration').first().json.ghlApiUrl }}/conversations/{{ $json.json.conversationId }}/messages",
        "options": {
          "timeout": 30000
        },
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{ 'Bearer ' + $('Workflow Configuration').first().json.ghlApiKey }}"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "48adab5f-00db-4270-b0e3-a6b1cab19318",
      "name": "Email Opened?",
      "type": "n8n-nodes-base.if",
      "position": [
        -224,
        96
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": false,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "id-1",
              "operator": {
                "type": "boolean",
                "operation": "equals"
              },
              "leftValue": "={{ $json.json.messages && $json.json.messages.some(m => m.status === 'opened') }}",
              "rightValue": "true"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "8dc5363f-3283-480e-884c-bcf93a8be53f",
      "name": "Schedule Follow-Up in Calendar",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        0,
        0
      ],
      "parameters": {
        "end": "={{ $now.plus({ days: 2, hours: 1 }).toISO() }}",
        "start": "={{ $now.plus({ days: 2 }).toISO() }}",
        "calendar": {
          "__rl": true,
          "mode": "id",
          "value": "<__PLACEHOLDER_VALUE__Google Calendar ID__>"
        },
        "additionalFields": {
          "summary": "={{ 'Follow-up call with ' + $('Normalize Lead Information').first().json.leadName }}",
          "description": "={{ 'Lead interested in ' + $('Normalize Lead Information').first().json.serviceType + '. Phone: ' + $('Normalize Lead Information').first().json.leadPhone }}"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "5cbfbe31-b226-42af-bf47-c62e91fb5882",
      "name": "Send Reminder SMS",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        0,
        192
      ],
      "parameters": {
        "url": "={{ $('Workflow Configuration').first().json.ghlApiUrl }}/conversations/messages",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"type\": \"SMS\",\n  \"contactId\": \"{{ $('Normalize Lead Information').first().json.leadId }}\",\n  \"message\": \"Hi {{ $('Normalize Lead Information').first().json.leadName }}, we sent you an email about your {{ $('Normalize Lead Information').first().json.serviceType }} inquiry. Please check your inbox or reply here!\"\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{ 'Bearer ' + $('Workflow Configuration').first().json.ghlApiKey }}"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "a1806ba3-1710-49bd-a8c2-3f59b52ee6b3",
      "name": "Log Lead Activity to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        448,
        96
      ],
      "parameters": {
        "columns": {
          "value": {
            "Email": "={{ $('Normalize Lead Information').first().json.leadEmail }}",
            "Phone": "={{ $('Normalize Lead Information').first().json.leadPhone }}",
            "Status": "={{ $('Email Opened?').item.json.emailOpened ? 'Follow-up Scheduled' : 'Reminder Sent' }}",
            "Lead ID": "={{ $('Normalize Lead Information').first().json.leadId }}",
            "Lead Name": "={{ $('Normalize Lead Information').first().json.leadName }}",
            "Timestamp": "={{ $now.toISO() }}",
            "Email Opened": "={{ $('Email Opened?').item.json.emailOpened ? 'Yes' : 'No' }}",
            "Service Type": "={{ $('Normalize Lead Information').first().json.serviceType }}"
          },
          "schema": [
            {
              "id": "Lead ID",
              "required": false,
              "displayName": "Lead ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Lead Name",
              "required": false,
              "displayName": "Lead Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone",
              "required": false,
              "displayName": "Phone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Service Type",
              "required": false,
              "displayName": "Service Type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email Opened",
              "required": false,
              "displayName": "Email Opened",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Timestamp",
              "required": false,
              "displayName": "Timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Lead ID"
          ]
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Lead Activity Log"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "<__PLACEHOLDER_VALUE__Google Sheets Document ID__>"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "11913c44-3288-4128-96d0-a015fa4cedbc",
      "name": "Notify Manager in Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        672,
        96
      ],
      "parameters": {
        "text": "=\ud83c\udf31 New Lead Alert!\n\n*Name:* {{ $('Normalize Lead Information').first().json.leadName }}\n*Service:* {{ $('Normalize Lead Information').first().json.serviceType }}\n*Phone:* {{ $('Normalize Lead Information').first().json.leadPhone }}\n*Email:* {{ $('Normalize Lead Information').first().json.leadEmail }}\n*Status:* {{ $json.Status }}\n\nMessages sent: SMS + Email",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').first().json.slackChannel }}"
        },
        "otherOptions": {}
      },
      "typeVersion": 2.4
    },
    {
      "id": "92b30d45-bd4a-48bc-a893-2a228d608f6b",
      "name": "Compile Lead Activity Report",
      "type": "n8n-nodes-base.merge",
      "position": [
        224,
        96
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.2
    },
    {
      "id": "939e46f1-d079-47bd-bdc7-84bfa608d9f3",
      "name": "Weekly Summary Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1936,
        528
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                1
              ],
              "triggerAtHour": 9
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "2c7f0958-6b8d-48d8-a647-94a35946438e",
      "name": "Fetch Weekly Lead Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1696,
        528
      ],
      "parameters": {
        "options": {
          "returnFirstMatch": false,
          "dataLocationOnSheet": {
            "values": {
              "range": "A:H",
              "rangeDefinition": "specifyRangeA1"
            }
          }
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Lead Activity Log"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "<__PLACEHOLDER_VALUE__Google Sheets Document ID__>"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "f885bd03-2687-4585-8e11-aa774027a4a5",
      "name": "Send Weekly Summary to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        -1472,
        528
      ],
      "parameters": {
        "text": "=\ud83d\udcca Weekly Lead Summary Report\n\n*Total Leads:* {{ $json.length }}\n*Emails Opened:* {{ $json.filter(l => l[\"Email Opened\"] === \"Yes\").length }}\n*Follow-ups Scheduled:* {{ $json.filter(l => l.Status === \"Follow-up Scheduled\").length }}\n*Reminders Sent:* {{ $json.filter(l => l.Status === \"Reminder Sent\").length }}\n\nKeep up the great work! \ud83d\ude80",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "<__PLACEHOLDER_VALUE__Slack Channel ID for weekly reports__>"
        },
        "otherOptions": {}
      },
      "typeVersion": 2.4
    },
    {
      "id": "da1d36dc-701a-4a58-ab59-f0a7d054b704",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2000,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 736,
        "height": 464,
        "content": "## Trigger & Config"
      },
      "typeVersion": 1
    },
    {
      "id": "83d8e58d-7bfe-4f43-a21e-d7657662e323",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 736,
        "height": 464,
        "content": "## AI routing and GHL "
      },
      "typeVersion": 1
    },
    {
      "id": "4df75bd2-5663-4416-bbba-2d54ec6d379f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -464,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 656,
        "height": 464,
        "content": "## Email & Schedule"
      },
      "typeVersion": 1
    },
    {
      "id": "d0ba4b26-d343-4f1e-89c3-cb2c78135919",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 672,
        "height": 464,
        "content": "## Notify & Log"
      },
      "typeVersion": 1
    },
    {
      "id": "0fe20ae2-655b-4b98-9132-ba35b650789b",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2000,
        400
      ],
      "parameters": {
        "color": 7,
        "width": 656,
        "height": 464,
        "content": "## Summary Reporting"
      },
      "typeVersion": 1
    },
    {
      "id": "9355df03-ec53-4bb8-930c-f95f99a15d68",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2352,
        -48
      ],
      "parameters": {
        "width": 288,
        "height": 608,
        "content": "## Main\nThis workflow automates lead follow-up and booking for landscaping companies. It takes a new GoHighLevel lead, generates personalized SMS and email messages via AI, logs activity in Google Sheets, notifies your Slack team, and schedules follow-ups for hot leads.\n\n## Setup\n1. Connect your GoHighLevel account for lead triggers, SMS, and emails.\n2. Set up Google Sheets to log lead info and follow-up actions.\n3. Connect Slack to notify your landscaping manager or team.\n4. Configure OpenAI node with your API key for personalized follow-ups.\n5. Customize message templates in the OpenAI node for your branding and services.\nFor help or setup assistance, contact Hyrum Hurst at hyrum@quartersmart.com\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "45dd960c-c38c-4a37-8236-2286ee9acd37",
  "connections": {
    "Email Opened?": {
      "main": [
        [
          {
            "node": "Schedule Follow-Up in Calendar",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Reminder SMS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Reminder SMS": {
      "main": [
        [
          {
            "node": "Compile Lead Activity Report",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Fetch Weekly Lead Data": {
      "main": [
        [
          {
            "node": "Send Weekly Summary to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Normalize Lead Information",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Email Open Status": {
      "main": [
        [
          {
            "node": "Email Opened?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Weekly Summary Schedule": {
      "main": [
        [
          {
            "node": "Fetch Weekly Lead Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send SMS via GoHighLevel": {
      "main": [
        [
          {
            "node": "Send Email via GoHighLevel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Lead Information": {
      "main": [
        [
          {
            "node": "Generate Personalized Follow-Up Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email via GoHighLevel": {
      "main": [
        [
          {
            "node": "Check Email Open Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compile Lead Activity Report": {
      "main": [
        [
          {
            "node": "Log Lead Activity to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GoHighLevel New Lead Trigger": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Follow-Up in Calendar": {
      "main": [
        [
          {
            "node": "Compile Lead Activity Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Lead Activity to Google Sheets": {
      "main": [
        [
          {
            "node": "Notify Manager in Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Personalized Follow-Up Message": {
      "main": [
        [
          {
            "node": "Send SMS via GoHighLevel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}