{
  "name": "Enrich new leads in Pipedrive and send an alert to Slack for high-quality ones",
  "nodes": [
    {
      "id": "2b12fb75-ec81-4d2c-a8bb-12ff2bb7e935",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        680,
        2.662790697674268
      ],
      "parameters": {
        "width": 410.6749642132356,
        "height": 428.2515771212859,
        "content": "## Setup\n1. Go to Company Settings -> Data fields -> Organization and add `Domain` as a custom field\n2. Go to Company Settings -> Data fields -> Leads and add `Enriched at` as a custom date field\n2. A"
      }
    },
    {
      "id": "123ad2e5-f4f2-4411-bf03-5668124b8757",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1800,
        160
      ],
      "parameters": {
        "width": 223.7628185364029,
        "height": 276.3308728978709,
        "content": "Adjust condition to filter leads by your desired condition. e.g, revenue, number of employees, etc."
      }
    },
    {
      "id": "7725dc9e-5c93-475d-9522-f99b4fd1c81f",
      "name": "Enrich company",
      "type": "n8n-nodes-base.clearbit",
      "position": [
        1460,
        140
      ]
    },
    {
      "id": "f65855c3-d3d2-415b-bda2-e452d4d7e154",
      "name": "Get all leads",
      "type": "n8n-nodes-base.pipedrive",
      "position": [
        1120,
        280
      ]
    },
    {
      "id": "39767a37-bd6d-422e-bc38-bfdfcbbf05af",
      "name": "Add Organization ID to data",
      "type": "n8n-nodes-base.set",
      "position": [
        1640,
        140
      ]
    },
    {
      "id": "4263cd25-dcf3-4521-b716-0ce48d3b2c26",
      "name": "Keep leads that match the criteria",
      "type": "n8n-nodes-base.filter",
      "position": [
        2320,
        260
      ]
    },
    {
      "id": "98578544-b03d-44aa-a64f-285f8a7cc371",
      "name": "Trigger every 5 minutes",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        540,
        280
      ]
    },
    {
      "id": "69ace950-7f1e-469b-bfca-6c0c81f356b9",
      "name": "Setup",
      "type": "n8n-nodes-base.set",
      "position": [
        820,
        280
      ]
    },
    {
      "id": "63db576a-6bb7-4215-88f3-98e304081b3e",
      "name": "Send alert to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        2520,
        260
      ]
    },
    {
      "id": "9bef53b4-3732-4ce5-a72c-81c65a533196",
      "name": "Merge data",
      "type": "n8n-nodes-base.merge",
      "position": [
        1880,
        260
      ]
    },
    {
      "id": "9c8d106a-ffc6-4295-bc22-8ceddeb0061f",
      "name": "Get organization details",
      "type": "n8n-nodes-base.pipedrive",
      "position": [
        1280,
        140
      ]
    },
    {
      "id": "632477f4-77d1-4c87-a819-2f7022fa6f23",
      "name": "Get all organization keys",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        680,
        620
      ]
    },
    {
      "id": "f12c4e56-895d-4f34-8924-c99f5e5fefec",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        997,
        520
      ],
      "parameters": {
        "width": 187.68142318756514,
        "height": 276.3308728978709,
        "content": "Run me to find the Id of your custom domain field"
      }
    },
    {
      "id": "229db444-ac48-4557-b393-4dcdc69130fd",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1597,
        520
      ],
      "parameters": {
        "width": 187.68142318756514,
        "height": 276.3308728978709,
        "content": "Run me to find the Id of your enriched at domain field"
      }
    },
    {
      "id": "ea4b0c82-e52b-4a45-9d3f-7b28b8959574",
      "name": "Get all lead keys",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1260,
        620
      ]
    },
    {
      "id": "a74a2122-ddd5-4239-baa3-ebbc3de15e03",
      "name": "Split out lead field data",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1440,
        620
      ]
    },
    {
      "id": "84fded6b-bdeb-4863-b54c-01faf6cb64cc",
      "name": "Split out organization field",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        860,
        620
      ]
    },
    {
      "id": "9d9c502e-ccf2-40f9-ae91-7008532e5528",
      "name": "Show only custom lead fields",
      "type": "n8n-nodes-base.filter",
      "position": [
        1640,
        620
      ]
    },
    {
      "id": "a53f58ee-9649-42bc-bee4-b70eea6a0c63",
      "name": "Show only custom organization fields",
      "type": "n8n-nodes-base.filter",
      "position": [
        1040,
        620
      ]
    },
    {
      "id": "f9fa198a-860c-460f-ae82-172c71b5a838",
      "name": "Mark lead as enriched in Pipedrive",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2100,
        260
      ]
    }
  ],
  "connections": {
    "Setup": {
      "main": [
        [
          {
            "node": "Get all leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge data": {
      "main": [
        [
          {
            "node": "Mark lead as enriched in Pipedrive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all leads": {
      "main": [
        [
          {
            "node": "Get organization details",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Enrich company": {
      "main": [
        [
          {
            "node": "Add Organization ID to data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all lead keys": {
      "main": [
        [
          {
            "node": "Split out lead field data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger every 5 minutes": {
      "main": [
        [
          {
            "node": "Setup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get organization details": {
      "main": [
        [
          {
            "node": "Enrich company",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all organization keys": {
      "main": [
        [
          {
            "node": "Split out organization field",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split out lead field data": {
      "main": [
        [
          {
            "node": "Show only custom lead fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Organization ID to data": {
      "main": [
        [
          {
            "node": "Merge data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split out organization field": {
      "main": [
        [
          {
            "node": "Show only custom organization fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep leads that match the criteria": {
      "main": [
        [
          {
            "node": "Send alert to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark lead as enriched in Pipedrive": {
      "main": [
        [
          {
            "node": "Keep leads that match the criteria",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}