{
  "name": "Celebrate Every Closed-Won HubSpot Deal in Email",
  "nodes": [
    {
      "name": "HubSpot — Deal Won",
      "type": "n8n-nodes-base.hubspot",
      "typeVersion": 2,
      "parameters": {
        "operation": "getAll",
        "filter": "stage=closed_won"
      },
      "notes": "Trigger on the Closed-Won stage.",
      "position": [
        260,
        300
      ]
    },
    {
      "name": "Deal Details",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "1000",
              "name": "deal_name",
              "value": "={{ $json.properties.dealname }}",
              "type": "string"
            },
            {
              "id": "1001",
              "name": "amount",
              "value": "={{ $json.properties.amount }}",
              "type": "string"
            },
            {
              "id": "1002",
              "name": "owner",
              "value": "={{ $json.properties.owner }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "notes": "",
      "position": [
        500,
        300
      ]
    },
    {
      "name": "Send Email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2,
      "parameters": {
        "subject": "=🎉 Deal won: {{ $json.deal_name }} — {{ $json.amount }} ({{",
        "text": "={{ $json.summary }}"
      },
      "notes": "Add SMTP credentials (or swap for the Gmail node).",
      "position": [
        740,
        300
      ]
    },
    {
      "name": "Respond / Finish",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "parameters": {},
      "notes": "End of flow — extend with extra steps as needed.",
      "position": [
        980,
        300
      ]
    }
  ],
  "connections": {
    "HubSpot — Deal Won": {
      "main": [
        [
          {
            "node": "Deal Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Deal Details": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email": {
      "main": [
        [
          {
            "node": "Respond / Finish",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
