{
  "name": "Sync Beex WhatsApp ticket messages with HubSpot contact activities",
  "nodes": [
    {
      "id": "167e4d54-f34b-49f9-ab0d-073cbf9df00e",
      "name": "Beex Trigger",
      "type": "n8n-nodes-beex.beexTrigger",
      "position": [
        -1344,
        192
      ]
    },
    {
      "id": "e33d37fc-71c9-4d11-87ef-20f1c19066eb",
      "name": "Get Phone",
      "type": "n8n-nodes-base.set",
      "position": [
        -896,
        192
      ]
    },
    {
      "id": "1990cfdb-0484-4dbb-985a-4775bbab27d6",
      "name": "Search Contact",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        -672,
        192
      ]
    },
    {
      "id": "865d2f20-8719-4930-9cc9-3464cd0ab694",
      "name": "Get Messages",
      "type": "n8n-nodes-beex.beex",
      "position": [
        -448,
        192
      ]
    },
    {
      "id": "2135aaa8-bb50-48e1-bc67-0f8ae6ea925e",
      "name": "Routes",
      "type": "n8n-nodes-base.switch",
      "position": [
        -224,
        176
      ]
    },
    {
      "id": "92c15f3e-0f63-46f5-af17-e920515e7c22",
      "name": "Format Text",
      "type": "n8n-nodes-base.set",
      "position": [
        0,
        0
      ]
    },
    {
      "id": "3d669270-8d36-42ac-9383-4d169d8cc3af",
      "name": "Format Image",
      "type": "n8n-nodes-base.set",
      "position": [
        0,
        192
      ]
    },
    {
      "id": "a34e65b7-6cd7-473f-858d-b61c09ed291a",
      "name": "Format Audio",
      "type": "n8n-nodes-base.set",
      "position": [
        0,
        384
      ]
    },
    {
      "id": "116ff56f-a2be-4cd0-9300-99b18179fcf0",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        224,
        176
      ]
    },
    {
      "id": "60d68e56-c11e-4169-907d-2e118676eb91",
      "name": "Sort Messages",
      "type": "n8n-nodes-base.sort",
      "position": [
        448,
        192
      ]
    },
    {
      "id": "6257e5a4-4a4a-450a-9590-80625500b00d",
      "name": "Consolidate Chat",
      "type": "n8n-nodes-base.code",
      "position": [
        672,
        192
      ]
    },
    {
      "id": "51cc123e-8a09-4e85-a9d0-a07a25e541fe",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        -128
      ],
      "parameters": {
        "width": 672,
        "height": 704,
        "content": "## Routing by message type\n- Depending on the type of message (text, image or audio) sent during the interaction, it will be given an equivalent HTML format. Then we consolidated."
      }
    },
    {
      "id": "b8479e5f-4aa9-472a-861c-2be7a3dd220f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1392,
        -128
      ],
      "parameters": {
        "width": 432,
        "height": 704,
        "content": "## Beex Trigger Node + Filter\n- The trigger receives the `On Management Create` event\n- Currently, the workflow only accepts an event that uses WhatsApp messaging as its **channel**"
      }
    },
    {
      "id": "1d458282-73c3-4cd1-b32f-c7b1e305656a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        -128
      ],
      "parameters": {
        "width": 704,
        "height": 704,
        "content": "## Logging Activity in HubSpot\n- We proceed to sort the messages by creation.\n- We consolidate the messages into a single record.\n- We record the activity of type `WHATS_APP` in HubSpot."
      }
    },
    {
      "id": "23ab178b-d25e-47cc-8db5-d10663eb557a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        -128
      ],
      "parameters": {
        "width": 672,
        "height": 704,
        "content": "## Retrieving Messages from BeexCC\n- We strategically obtain a valid phone number (*insert* the **country code**)\n- We are looking for HubSpot's contact information using their **phone number**\n- We o"
      }
    },
    {
      "id": "019f1c60-5857-4888-a7e4-1efa0d8c99fa",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2176,
        -336
      ],
      "parameters": {
        "width": 560,
        "height": 1088,
        "content": "# Sync Beex Ticket Messages to HubSpot Activities\n\n> **Requires:** Community node `n8n-nodes-beex`\n\n## Overview\nCaptures WhatsApp ticket classifications from Beex and syncs message history as HubSpot "
      }
    },
    {
      "id": "c5e2672a-ffb5-4241-a8b2-1ec9161c9e68",
      "name": "Is WhatsApp Channel?",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1120,
        192
      ]
    },
    {
      "id": "47b21b35-4fb5-4aa9-9e23-dcbae718abe7",
      "name": "Register Activity",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        896,
        192
      ]
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Sort Messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Routes": {
      "main": [
        [
          {
            "node": "Format Text",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Format Image",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Format Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Phone": {
      "main": [
        [
          {
            "node": "Search Contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Text": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Beex Trigger": {
      "main": [
        [
          {
            "node": "Is WhatsApp Channel?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Audio": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Format Image": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get Messages": {
      "main": [
        [
          {
            "node": "Routes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort Messages": {
      "main": [
        [
          {
            "node": "Consolidate Chat",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Contact": {
      "main": [
        [
          {
            "node": "Get Messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Consolidate Chat": {
      "main": [
        [
          {
            "node": "Register Activity",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is WhatsApp Channel?": {
      "main": [
        [
          {
            "node": "Get Phone",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}