{
  "name": "DEMO: Create a new record in Google Sheets when something happens in Hubspot",
  "nodes": [
    {
      "parameters": {
        "eventsUi": {
          "eventValues": [
            {}
          ]
        },
        "additionalFields": {}
      },
      "id": "78395fdf-2e8b-4064-a102-c1c0335e0d94",
      "name": "HubSpot Trigger",
      "type": "n8n-nodes-base.hubspotTrigger",
      "typeVersion": 1,
      "position": [
        580,
        320
      ],
      "notesInFlow": true,
      "notes": "On Contact Created"
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json['identity-profiles'][0].identities[0].value }}",
              "operation": "contains",
              "value2": "@gmail"
            }
          ]
        }
      },
      "id": "3888d918-c140-47a1-8024-d50fddb3f8f0",
      "name": "IF",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        820,
        320
      ],
      "notesInFlow": true,
      "notes": "Is Gmail Email?"
    },
    {
      "parameters": {},
      "id": "416a8876-f496-499c-a089-aad243daabc6",
      "name": "Is Gmail, Don't Add to Sheet",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1140,
        240
      ]
    },
    {
      "parameters": {
        "content": "## Demo: Creating Google Sheets records when something happens in HubSpot\nThis workflow runs each time a new Contact is added in HubSpot. It filters out Contacts with Gmail email addresses then pushes the remaining new Contacts to [this Google Sheet](https://docs.google.com/spreadsheets/d/1GeWRcu5cvNVA-0hpHZHtatjnFtyunbgWUgRur5uT08A/edit?usp=sharing).",
        "height": 160.1450000000002,
        "width": 480.31999999999596
      },
      "id": "cf69cda9-ba96-468f-990c-6c3ad5242053",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        520,
        100
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1GeWRcu5cvNVA-0hpHZHtatjnFtyunbgWUgRur5uT08A",
          "mode": "list",
          "cachedResultName": "New HubSpot Contacts",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1GeWRcu5cvNVA-0hpHZHtatjnFtyunbgWUgRur5uT08A/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "New Contacts",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1GeWRcu5cvNVA-0hpHZHtatjnFtyunbgWUgRur5uT08A/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Name": "={{ $json.properties.num_unique_conversion_events.versions[0]['source-type'] }}",
            "Email": "={{ $json.properties.num_unique_conversion_events.versions[0]['source-label'] }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "Name",
              "displayName": "Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "displayName": "Email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Sync timestamp",
              "displayName": "Sync timestamp",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ]
        },
        "options": {}
      },
      "id": "1e4084bd-b7fb-41f1-a340-1414ef134468",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4,
      "position": [
        1140,
        440
      ],
      "notesInFlow": true,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "notes": "Append new contact to sheet"
    }
  ],
  "connections": {
    "HubSpot Trigger": {
      "main": [
        [
          {
            "node": "IF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF": {
      "main": [
        [
          {
            "node": "Is Gmail, Don't Add to Sheet",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "4748dbbc-75dd-400e-98d1-41bbd82c7208",
  "id": "cGYp8fpTdh3LAgP5",
  "tags": [
    {
      "createdAt": "2023-09-21T09:36:34.726Z",
      "updatedAt": "2023-09-21T09:36:52.231Z",
      "id": "vh6ctEIEfFztmSF2",
      "name": "release-template-version"
    }
  ]
}