{
  "name": "Sync companies from Google Sheets to Salesforce with smart duplicate prevention",
  "nodes": [
    {
      "id": "29451054-fcd6-4054-b072-a87c716f6c67",
      "name": "On clicking 'execute'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -336,
        -320
      ]
    },
    {
      "id": "2c1ed019-85f1-4b0f-bcf5-ce59ff13ea49",
      "name": "Search Salesforce accounts",
      "type": "n8n-nodes-base.salesforce",
      "position": [
        112,
        -384
      ]
    },
    {
      "id": "7da1de2f-2b37-4e33-b8d4-d1dc59e94bbe",
      "name": "Account found?",
      "type": "n8n-nodes-base.if",
      "position": [
        1152,
        0
      ]
    },
    {
      "id": "80890a2a-f6d3-4efd-92b1-6465f98f512b",
      "name": "Remove duplicate companies",
      "type": "n8n-nodes-base.itemLists",
      "position": [
        1312,
        -448
      ]
    },
    {
      "id": "ea9afa15-77be-4d7a-a287-35d4c1c6e6c1",
      "name": "Set Account ID for existing accounts",
      "type": "n8n-nodes-base.renameKeys",
      "position": [
        1520,
        -16
      ]
    },
    {
      "id": "c10dea7c-96b0-4f3b-b859-af094ced51cc",
      "name": "Set new account name",
      "type": "n8n-nodes-base.set",
      "position": [
        1760,
        -448
      ]
    },
    {
      "id": "a4a2be2a-7bd9-4a70-b4d9-0df53834bdda",
      "name": "Create Salesforce account",
      "type": "n8n-nodes-base.salesforce",
      "position": [
        1536,
        -448
      ]
    },
    {
      "id": "89f49e6f-62be-403f-9a4c-cd56e28141f3",
      "name": "Create Salesforce contact",
      "type": "n8n-nodes-base.salesforce",
      "position": [
        1840,
        -16
      ]
    },
    {
      "id": "da75088c-17de-4885-a557-ac2edc84a829",
      "name": "Get row(s) in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -112,
        -320
      ]
    },
    {
      "id": "c6af3549-df84-4dcc-9db8-306648e614fe",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -816
      ],
      "parameters": {
        "width": 896,
        "height": 704,
        "content": "# 📊 Part 1: Data Input & Preparation\n\n## Extract company data from Google Sheets and prepare for Salesforce processing.\n\n### Modules:\n- Manual Trigger - Starts the workflow execution\n- Get row(s) in s"
      }
    },
    {
      "id": "9db710b0-ef7a-4263-8d5e-71c513951835",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        -816
      ],
      "parameters": {
        "width": 496,
        "height": 704,
        "content": "# 🔄 Part 2: Smart Routing & Duplicate Detection\n\n## Analyze search results and route companies to appropriate processing paths.\n\n### Logic Flow:\nCompanies are automatically sorted into two paths based"
      }
    },
    {
      "id": "b9d12003-62b6-427e-8cad-15690eb5593c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1024,
        -816
      ],
      "parameters": {
        "width": 1168,
        "height": 704,
        "content": "# 🆕 Part 3: New Company Processing\n\n## Create new Salesforce accounts for companies not found in the system.\n\n### Modules:\n- Keep new companies - Filters companies not in Salesforce\n- Remove duplicate"
      }
    },
    {
      "id": "5c83fdab-2720-4ec2-8b58-70573b61332d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1024,
        -96
      ],
      "parameters": {
        "width": 1168,
        "height": 848,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# ✅ Part 4: Existing Company Processing\n\n## Handle companies that already exist in Salesforce by updating contact information.\n\n### Modules:\n- Account found? - Identifies comp"
      }
    },
    {
      "id": "27f3269e-e2ff-4748-88fd-e2ff31fdece5",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -96
      ],
      "parameters": {
        "width": 1408,
        "height": 848,
        "content": "# 🎯 Salesforce-Google Sheets Company Sync (Smart Duplicate Prevention)\n## Made by: Xavier Tai\n\n## This workflow automatically syncs company data from Google Sheets to Salesforce with intelligent dupli"
      }
    },
    {
      "id": "f5516431-c30a-4724-8304-655f718015ff",
      "name": "Merge existing account data1",
      "type": "n8n-nodes-base.merge",
      "position": [
        336,
        -320
      ]
    },
    {
      "id": "877f4623-a915-4f7d-a5a9-22f2b595fb9d",
      "name": "Keep new companies",
      "type": "n8n-nodes-base.merge",
      "position": [
        1088,
        -448
      ]
    },
    {
      "id": "9e0815e5-7bc5-4254-8030-c0527c665569",
      "name": "Retrieve new company contacts",
      "type": "n8n-nodes-base.merge",
      "position": [
        1984,
        -448
      ]
    }
  ],
  "connections": {
    "Account found?": {
      "main": [
        [
          {
            "node": "Set Account ID for existing accounts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep new companies": {
      "main": [
        [
          {
            "node": "Remove duplicate companies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Search Salesforce accounts",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge existing account data1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Account found?",
            "type": "main",
            "index": 0
          },
          {
            "node": "Keep new companies",
            "type": "main",
            "index": 0
          },
          {
            "node": "Remove duplicate companies",
            "type": "main",
            "index": 0
          },
          {
            "node": "Retrieve new company contacts",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create Salesforce contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set new account name": {
      "main": [
        [
          {
            "node": "Retrieve new company contacts",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "On clicking 'execute'": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Salesforce account": {
      "main": [
        [
          {
            "node": "Set new account name",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove duplicate companies": {
      "main": [
        [
          {
            "node": "Create Salesforce account",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Salesforce accounts": {
      "main": [
        [
          {
            "node": "Merge existing account data1",
            "type": "main",
            "index": 1
          },
          {
            "node": "Keep new companies",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge existing account data1": {
      "main": [
        [
          {
            "node": "Account found?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve new company contacts": {
      "main": [
        [
          {
            "node": "Create Salesforce contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Account ID for existing accounts": {
      "main": [
        [
          {
            "node": "Create Salesforce contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}