{
  "name": "Large Deal Created Alert — HubSpot → Slack",
  "nodes": [
    {
      "parameters": {
        "eventsUi": {
          "eventValues": [
            {
              "name": "deal.creation",
              "value": ""
            }
          ]
        }
      },
      "id": "hubspot-trigger",
      "name": "HubSpot Trigger",
      "type": "n8n-nodes-base.hubspotTrigger",
      "typeVersion": 1,
      "position": [0, 0],
      "webhookId": "hubspot-deal-created",
      "credentials": {
        "hubspotDeveloperApi": {
          "id": "credential-id",
          "name": "HubSpot Developer API"
        }
      }
    },
    {
      "parameters": {
        "method": "GET",
        "url": "=https://api.hubapi.com/crm/v3/objects/deals/{{ $json.objectId }}",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "hubspotApi",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "properties",
              "value": "dealname,amount,dealstage,hubspot_owner_id,pipeline"
            }
          ]
        },
        "options": {}
      },
      "id": "fetch-deal",
      "name": "Fetch Deal",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [220, 0],
      "credentials": {
        "hubspotApi": {
          "id": "credential-id",
          "name": "HubSpot API"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{ parseFloat($json.properties.amount || '0') }}",
              "operation": "larger",
              "value2": 50000
            }
          ]
        }
      },
      "id": "check-amount",
      "name": "Amount > $50K?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [440, 0]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "=https://api.hubapi.com/crm/v3/owners/{{ $json.properties.hubspot_owner_id }}",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "hubspotApi",
        "options": {}
      },
      "id": "fetch-owner",
      "name": "Fetch Owner",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [660, 0],
      "credentials": {
        "hubspotApi": {
          "id": "credential-id",
          "name": "HubSpot API"
        }
      }
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "executive-deals",
          "mode": "name"
        },
        "messageType": "block",
        "blocksUi": "={\n  \"blocks\": [\n    {\n      \"type\": \"section\",\n      \"text\": {\n        \"type\": \"mrkdwn\",\n        \"text\": \":dart: *New Large Deal Created*\\n*\" + $('Fetch Deal').first().json.properties.dealname + \"*\\nAmount: *$\" + parseFloat($('Fetch Deal').first().json.properties.amount).toLocaleString() + \"*\\nOwner: \" + $('Fetch Owner').first().json.firstName + \" \" + $('Fetch Owner').first().json.lastName\n      }\n    },\n    {\n      \"type\": \"context\",\n      \"elements\": [\n        {\n          \"type\": \"mrkdwn\",\n          \"text\": \"<https://app.hubspot.com/contacts/YOUR_PORTAL_ID/deal/\" + $('Fetch Deal').first().json.id + \"|View in HubSpot>\"\n        }\n      ]\n    }\n  ]\n}",
        "otherOptions": {
          "unfurl_links": false
        }
      },
      "id": "post-to-slack",
      "name": "Post to Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.3,
      "position": [880, 0],
      "credentials": {
        "slackApi": {
          "id": "credential-id",
          "name": "Slack API"
        }
      }
    }
  ],
  "connections": {
    "HubSpot Trigger": {
      "main": [
        [
          {
            "node": "Fetch Deal",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Deal": {
      "main": [
        [
          {
            "node": "Amount > $50K?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Amount > $50K?": {
      "main": [
        [
          {
            "node": "Fetch Owner",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Fetch Owner": {
      "main": [
        [
          {
            "node": "Post to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 0,
  "active": false,
  "meta": {
    "instanceId": "",
    "templateId": "revi-large-deal-alert"
  }
}
