{
  "name": "Extract local business contacts with Google Sheets, SerpAPI, Apify & GPT-4o",
  "nodes": [
    {
      "id": "0377cde7-39de-4a27-9f57-2ac62ecae89c",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -2520,
        400
      ]
    },
    {
      "id": "ac9d9f3b-db6c-4491-a1ce-ebfff9652ea3",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -700,
        780
      ]
    },
    {
      "id": "a05ec908-7476-49ec-9b32-3355cec11dce",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -580,
        780
      ]
    },
    {
      "id": "f6bbdf13-a0c1-4d9e-9157-c1a55a06e16b",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1160,
        260
      ]
    },
    {
      "id": "2003373e-cb00-4c74-b0bf-7ddb677ddb96",
      "name": "Execute Workflow",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        -640,
        200
      ]
    },
    {
      "id": "17c39dd5-5c44-4b95-ad50-591224d5517c",
      "name": "Extract Search Terms",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2300,
        400
      ]
    },
    {
      "id": "4222fa4d-d0e0-4e91-90bf-dead1424ed2c",
      "name": "Keep Unprocessed Rows",
      "type": "n8n-nodes-base.filter",
      "position": [
        -2080,
        400
      ]
    },
    {
      "id": "4de8ae34-2fea-4169-ada9-80cad9ee2e87",
      "name": "Filter to first row",
      "type": "n8n-nodes-base.code",
      "position": [
        -1860,
        400
      ]
    },
    {
      "id": "af38c3a1-1414-4dcf-932d-e4a1db059a91",
      "name": "Mark Row as Completed",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1640,
        300
      ]
    },
    {
      "id": "e0087b09-f158-4ce8-bb74-ce45b5d9dfa6",
      "name": "Search Google Maps",
      "type": "n8n-nodes-serpapi.serpApi",
      "position": [
        -1640,
        500
      ]
    },
    {
      "id": "fc558eef-8092-42f7-ab51-41c7002cb50b",
      "name": "Format output as table",
      "type": "n8n-nodes-base.code",
      "position": [
        -1420,
        500
      ]
    },
    {
      "id": "2d3fa5a3-f338-4eb8-be95-c915ce3f189a",
      "name": "Save Emails to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -940,
        0
      ]
    },
    {
      "id": "947fad74-dd81-4993-947e-a1e9264c1056",
      "name": "Scrape Web Page",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -940,
        400
      ]
    },
    {
      "id": "eaab5179-b3a7-4c94-b2b9-0db29509573f",
      "name": "Extract Email - AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -720,
        560
      ]
    },
    {
      "id": "4a9f36d4-fd8b-409c-a1af-6be7248ed671",
      "name": "Reduce to 1 row",
      "type": "n8n-nodes-base.summarize",
      "position": [
        -940,
        200
      ]
    },
    {
      "id": "0fa2b9a4-3e33-4830-86a5-5466f4b9ab1a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2380,
        20
      ],
      "parameters": {
        "width": 980,
        "height": null,
        "content": "## n8n Workflow: Local Business Contact Finder with Email Extraction\n\n** Feel free to contact me if you need help implementing (rbreen@ynteractive.com) **"
      }
    },
    {
      "id": "72de7718-1d85-47e4-ab0b-5e559323f6d4",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3360,
        -80
      ],
      "parameters": {
        "width": 780,
        "height": 1160,
        "content": "## How to Implement This n8n Workflow\n\nFollow the steps below to get this business contact finder workflow up and running in your own environment:\n\n1. Copy the Google Sheet\nMake a copy of the search i"
      }
    },
    {
      "id": "c771ab3b-428f-46d9-be51-6ea1ce2a3659",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2560,
        -80
      ],
      "parameters": {
        "width": 2260,
        "height": 1160,
        "content": ""
      }
    }
  ],
  "connections": {
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Save Emails to Sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Reduce to 1 row",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Scrape Web Page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reduce to 1 row": {
      "main": [
        [
          {
            "node": "Execute Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Web Page": {
      "main": [
        [
          {
            "node": "Extract Email - AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Extract Email - AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Search Google Maps": {
      "main": [
        [
          {
            "node": "Format output as table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter to first row": {
      "main": [
        [
          {
            "node": "Mark Row as Completed",
            "type": "main",
            "index": 0
          },
          {
            "node": "Search Google Maps",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Search Terms": {
      "main": [
        [
          {
            "node": "Keep Unprocessed Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep Unprocessed Rows": {
      "main": [
        [
          {
            "node": "Filter to first row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format output as table": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Email - AI Agent": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Extract Email - AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Extract Search Terms",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}