{
  "name": "Onboard new SEO client with Local Falcon setup",
  "nodes": [
    {
      "parameters": {
        "content": "## Onboard New SEO Client with Local Falcon Setup\n\n**Who is this for:** SEO agencies who want to automate new client onboarding by automatically searching for their business, saving the location, creating a tracking campaign, and adding Falcon Guard protection.\n\n**What this workflow does:**\n1. Receives new client info via webhook (from your CRM or intake form)\n2. Searches for the business location on Google\n3. Saves the location to your Local Falcon account\n4. Creates a weekly tracking campaign with configured keywords\n5. Adds the location to Falcon Guard for GBP protection\n6. Sends confirmation to Slack with all setup details\n\n**How to set up:**\n1. Add your Local Falcon API credentials (get your key at https://www.localfalcon.com/api/credentials)\n2. Connect Slack for notifications\n3. Activate the workflow and copy the webhook URL\n4. Integrate the webhook with your CRM or intake form\n\n**Requirements:**\n- Local Falcon account with API access and credits\n- Client business name and approximate location\n- Keywords to track for the client\n\n**How to customize:**\n- Add HubSpot/Pipedrive integration to create deals\n- Include baseline scan for initial audit\n- Send welcome email to client\n- Create tasks in project management tool",
        "height": 580,
        "width": 460,
        "color": 5
      },
      "id": "sticky-main",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        60,
        -220
      ]
    },
    {
      "parameters": {
        "content": "### Webhook Payload Format\n\n```json\nPOST /webhook/new-seo-client\n{\n  \"client_name\": \"Joe's Pizza\",\n  \"business_name\": \"Joe's Pizza NYC\",\n  \"city\": \"New York, NY\",\n  \"keywords\": [\"pizza near me\", \"best pizza nyc\"],\n  \"grid_size\": 7,\n  \"radius\": 1,\n  \"frequency\": \"weekly\",\n  \"enable_falcon_guard\": true\n}\n```",
        "height": 280,
        "width": 340
      },
      "id": "sticky-format",
      "name": "Sticky Note Format",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        540,
        -220
      ]
    },
    {
      "parameters": {
        "content": "### Step 1: Receive\nWebhook receives new client data.",
        "height": 80,
        "width": 180
      },
      "id": "sticky-step1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        10,
        780
      ]
    },
    {
      "parameters": {
        "content": "### Step 2: Search\nFinds business location.",
        "height": 80,
        "width": 180
      },
      "id": "sticky-step2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        250,
        780
      ]
    },
    {
      "parameters": {
        "content": "### Step 3: Save\nAdds location to account.",
        "height": 80,
        "width": 180
      },
      "id": "sticky-step3",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        490,
        780
      ]
    },
    {
      "parameters": {
        "content": "### Step 4: Campaign\nCreates tracking campaign.",
        "height": 80,
        "width": 180
      },
      "id": "sticky-step4",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        730,
        780
      ]
    },
    {
      "parameters": {
        "content": "### Step 5: Protect\nEnables Falcon Guard.",
        "height": 80,
        "width": 180
      },
      "id": "sticky-step5",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        970,
        780
      ]
    },
    {
      "parameters": {
        "content": "### Step 6: Notify\nSends Slack confirmation.",
        "height": 80,
        "width": 180
      },
      "id": "sticky-step6",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1210,
        780
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "new-seo-client",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook",
      "name": "Receive New Client",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        100,
        560
      ]
    },
    {
      "parameters": {
        "resource": "location",
        "operation": "search",
        "platform": "google",
        "name": "={{ $json.body.business_name }}",
        "proximity": "={{ $json.body.city }}"
      },
      "id": "search-location",
      "name": "Search for Business",
      "type": "@local-falcon/n8n-nodes-localfalcon.localFalcon",
      "typeVersion": 1,
      "position": [
        340,
        560
      ],
      "credentials": {
        "localFalconApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "location",
        "operation": "save",
        "platform": "google",
        "placeId": "={{ $json.locations[0].place_id }}"
      },
      "id": "save-location",
      "name": "Save Location",
      "type": "@local-falcon/n8n-nodes-localfalcon.localFalcon",
      "typeVersion": 1,
      "position": [
        580,
        560
      ],
      "credentials": {
        "localFalconApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Get original webhook data and search results\nconst webhook = $('Receive New Client').first().json.body;\nconst location = $('Search for Business').first().json.locations[0];\nconst keywords = webhook.keywords || ['local services'];\n\n// Create a campaign request for each keyword\nreturn keywords.map((keyword, index) => ({\n  json: {\n    campaign_name: `${webhook.client_name} - ${keyword}`,\n    place_id: location.place_id,\n    keyword: keyword,\n    lat: location.lat || location.latitude,\n    lng: location.lng || location.longitude,\n    grid_size: webhook.grid_size || 7,\n    radius: webhook.radius || 1,\n    frequency: webhook.frequency || 'weekly',\n    location_name: location.name,\n    client_name: webhook.client_name,\n    enable_falcon_guard: webhook.enable_falcon_guard !== false\n  }\n}));"
      },
      "id": "prepare-campaigns",
      "name": "Prepare Campaign Data",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        820,
        560
      ]
    },
    {
      "parameters": {
        "resource": "campaign",
        "operation": "create",
        "campaignName": "={{ $json.campaign_name }}",
        "platform": "google",
        "placeId": "={{ $json.place_id }}",
        "keyword": "={{ $json.keyword }}",
        "lat": "={{ $json.lat }}",
        "lng": "={{ $json.lng }}",
        "gridSize": "={{ $json.grid_size }}",
        "radius": "={{ $json.radius }}",
        "measurement": "mi",
        "frequency": "={{ $json.frequency }}",
        "startDate": "={{ $now.format('MM/dd/yyyy') }}"
      },
      "id": "create-campaign",
      "name": "Create Campaign",
      "type": "@local-falcon/n8n-nodes-localfalcon.localFalcon",
      "typeVersion": 1,
      "position": [
        820,
        420
      ],
      "credentials": {
        "localFalconApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "falconGuard",
        "operation": "addLocation",
        "placeId": "={{ $('Prepare Campaign Data').first().json.place_id }}"
      },
      "id": "add-guard",
      "name": "Add Falcon Guard",
      "type": "@local-falcon/n8n-nodes-localfalcon.localFalcon",
      "typeVersion": 1,
      "position": [
        1060,
        560
      ],
      "credentials": {
        "localFalconApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "#client-onboarding"
        },
        "text": "=:white_check_mark: *New Client Onboarded Successfully*\n\n*Client:* {{ $('Prepare Campaign Data').first().json.client_name }}\n*Location:* {{ $('Prepare Campaign Data').first().json.location_name }}\n*Place ID:* `{{ $('Prepare Campaign Data').first().json.place_id }}`\n\n*Campaigns Created:* {{ $('Prepare Campaign Data').all().length }}\n*Falcon Guard:* {{ $('Prepare Campaign Data').first().json.enable_falcon_guard ? 'Enabled' : 'Disabled' }}\n\n_Setup completed at {{ $now.format('MMM d, yyyy h:mm a') }}_",
        "otherOptions": {}
      },
      "id": "notify-slack",
      "name": "Notify Team on Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.2,
      "position": [
        1300,
        560
      ],
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={\n  \"success\": true,\n  \"message\": \"Client onboarded successfully\",\n  \"location\": {\n    \"name\": \"{{ $('Prepare Campaign Data').first().json.location_name }}\",\n    \"place_id\": \"{{ $('Prepare Campaign Data').first().json.place_id }}\"\n  },\n  \"campaigns_created\": {{ $('Prepare Campaign Data').all().length }},\n  \"falcon_guard_enabled\": {{ $('Prepare Campaign Data').first().json.enable_falcon_guard }}\n}",
        "options": {}
      },
      "id": "respond",
      "name": "Return Success",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        1300,
        420
      ]
    }
  ],
  "connections": {
    "Receive New Client": {
      "main": [
        [
          {
            "node": "Search for Business",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search for Business": {
      "main": [
        [
          {
            "node": "Save Location",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Location": {
      "main": [
        [
          {
            "node": "Prepare Campaign Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Campaign Data": {
      "main": [
        [
          {
            "node": "Create Campaign",
            "type": "main",
            "index": 0
          },
          {
            "node": "Add Falcon Guard",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Campaign": {
      "main": [
        [
          {
            "node": "Return Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Falcon Guard": {
      "main": [
        [
          {
            "node": "Notify Team on Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "templateCredsSetupCompleted": true
  }
}