{
  "name": "Smartlead to HubSpot performance analytics",
  "nodes": [
    {
      "id": "8a4ba8b8-b76e-4572-becd-e7f8fbea2651",
      "name": "EXTRACT CAMPAIGN DATA",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        500,
        960
      ]
    },
    {
      "id": "90011ed6-180d-4170-8932-ac3aa7d0e5df",
      "name": "FETCH ALL CAMPAIGNS",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -20,
        940
      ]
    },
    {
      "id": "c41afcf1-9256-47fa-ad99-3e1af880e53d",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        200,
        940
      ]
    },
    {
      "id": "606bfc18-1d70-4d64-ac70-ae6f42bf0dbb",
      "name": "UPDATE CAMPAIGN",
      "type": "n8n-nodes-base.postgres",
      "position": [
        720,
        1220
      ]
    },
    {
      "id": "b9f61fd6-9327-428e-9e78-4ca0779476ea",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1220,
        980
      ]
    },
    {
      "id": "b8c1082d-a12f-4e56-af8c-73641b45da67",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        720,
        960
      ]
    },
    {
      "id": "f6550deb-0479-475e-b3ba-9507a4ac8911",
      "name": "Loop Over Items1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        180,
        160
      ]
    },
    {
      "id": "a183df85-17a2-4886-adc9-68b5ab5fa8b0",
      "name": "HubSpot",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        420,
        180
      ]
    },
    {
      "id": "da7e2980-6f82-4867-a460-306095234f5f",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        640,
        180
      ]
    },
    {
      "id": "9247f4c5-05dd-48a4-8bf9-c67a8936570c",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1340,
        980
      ]
    },
    {
      "id": "16623c02-5fb6-40cd-835b-2557eddbbf85",
      "name": "UPSERT CAMPAIGN ACTIVITY",
      "type": "n8n-nodes-base.postgres",
      "position": [
        980,
        960
      ]
    },
    {
      "id": "be550807-7ec6-45bc-b522-ae958200e90e",
      "name": "HUBSPOT TABLE",
      "type": "n8n-nodes-base.postgres",
      "position": [
        900,
        160
      ]
    },
    {
      "id": "328b900e-8c21-4578-b6a4-8c17fbccca26",
      "name": "SEARCH",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -40,
        160
      ]
    },
    {
      "id": "c403ef52-894d-476a-aaba-6527c7cb2184",
      "name": "Postgres1",
      "type": "n8n-nodes-base.postgres",
      "position": [
        640,
        380
      ]
    },
    {
      "id": "671f168b-a720-42e6-964d-a7f2871d2d6e",
      "name": "UPDATE HUBSPOT ACTIVITY TABLE",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1120,
        160
      ]
    },
    {
      "id": "6ebe6482-0f31-465a-8532-abaf3822ad72",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -140,
        -60
      ],
      "parameters": {
        "width": 1531.405758029468,
        "height": 669.051063941859,
        "content": "## HUBSPOT LIFECYCLESTAGE (LEAD STATUS)"
      }
    },
    {
      "id": "31ea75c2-a228-4390-b125-8f2ac0b96a07",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -140,
        760
      ],
      "parameters": {
        "width": 1831,
        "height": 669,
        "content": "## SMARTLEAD CAMPAIGN DATA"
      }
    },
    {
      "id": "8d7e4883-74e2-4758-b2d9-504eb7301cbd",
      "name": "SET SMARTLEAD API KEY",
      "type": "n8n-nodes-base.set",
      "position": [
        -1040,
        980
      ]
    },
    {
      "id": "1742845b-2ce5-4184-a7b0-6f5606714fcb",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1100,
        780
      ],
      "parameters": {
        "width": null,
        "height": 400,
        "content": "## Search for your smartlead API key [here](https://app.smartlead.ai/app/settings/profile)"
      }
    },
    {
      "id": "e10205a7-3859-4a31-85ba-59c5cc0b69f7",
      "name": "Postgres",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -40,
        1700
      ]
    },
    {
      "id": "19a80be4-f81f-44f7-8108-a20f6af8e315",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1300,
        1340
      ],
      "parameters": {
        "width": 740,
        "height": 400,
        "content": "## POSTGRES INSTALATION [Guide](https://github.com/wukimidaire/postgres_table_templates)\n\n## Follow this step by step guide, focus on the next 3 table creations for this flow:\n## - ce_campaign_activit"
      }
    },
    {
      "id": "7bc235d2-65c8-41fd-b429-26b2422cbfa8",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        1580
      ],
      "parameters": {
        "width": 1060,
        "height": 1313.3157639300548,
        "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\n## Campaign Analytics Report Documentation\n\nOverview\n\nThis report provides a high-level summary of campaign performance, designed to help stakeholders quickly assess the outc"
      }
    },
    {
      "id": "0af663c4-faa9-49ae-a5d3-3bcb6ea7888a",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        180,
        1700
      ]
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "HUBSPOT TABLE",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Postgres1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "UPSERT CAMPAIGN ACTIVITY",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SEARCH": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HubSpot": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres1": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HUBSPOT TABLE": {
      "main": [
        [
          {
            "node": "UPDATE HUBSPOT ACTIVITY TABLE",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        null,
        [
          {
            "node": "EXTRACT CAMPAIGN DATA",
            "type": "main",
            "index": 0
          },
          {
            "node": "UPDATE CAMPAIGN",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UPDATE CAMPAIGN": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Loop Over Items1": {
      "main": [
        null,
        [
          {
            "node": "HubSpot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "SET SMARTLEAD API KEY",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FETCH ALL CAMPAIGNS": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "EXTRACT CAMPAIGN DATA": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SET SMARTLEAD API KEY": {
      "main": [
        [
          {
            "node": "FETCH ALL CAMPAIGNS",
            "type": "main",
            "index": 0
          },
          {
            "node": "Postgres",
            "type": "main",
            "index": 0
          },
          {
            "node": "SEARCH",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UPSERT CAMPAIGN ACTIVITY": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "UPDATE HUBSPOT ACTIVITY TABLE": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}