{
  "id": "sEuroExb82N769tT",
  "name": "Analyze support requests and route tickets to Jira-V2",
  "tags": [],
  "nodes": [
    {
      "id": "c0453d3a-8471-4636-a4c9-8d32563af61d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "4df0099f-aaba-4226-8aa2-2b199445867c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        0
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "ffd221ef-0d3f-4f31-9d27-74ba6ff72d78",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        576
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "3aedd030-66e1-4cae-95cd-e75e383555d6",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1440,
        416
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "320b0499-4fdb-4bdf-beba-50ac34effec2",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1888,
        464
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "b44f7218-58d5-4756-b3a6-92f0f7cc42de",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        976
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "96bad4b4-a2d8-4934-a864-28950e2b9d01",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1968,
        1440
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "3c688a6e-7429-4c27-a82e-e11194f7ffd7",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2240,
        1520
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "3acb6632-58d4-49e7-9e64-260f49837053",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2672,
        1552
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "acbad6a0-c376-45b8-a82f-61e96ee38273",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3568,
        1552
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "0b18909b-7905-410b-b47f-6b3092c17887",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4832,
        1520
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "aae023e5-13f3-4dad-974c-47453286cc06",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5296,
        1552
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "46eaf852-f267-4288-8372-70e7fc0c3ab4",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5984,
        1280
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "f77d3fad-cc1e-401f-83ae-3cc53bc38be2",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5968,
        1760
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "100da289-a7f8-42a9-a30f-fbcaa208fa1b",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6416,
        1632
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "08d9965f-fedf-432f-8e6a-3519eaa4f765",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6624,
        1264
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "dc4d3edc-9050-4d81-91d7-bae08ab00d11",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        7072,
        1632
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "01a016d7-c66c-4826-ad31-9eee5d1b72d0",
      "name": "Sticky Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        7520,
        1680
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "7234076f-36b1-4228-b2f7-0dd47d5d4569",
      "name": "Sticky Note18",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        7792,
        1632
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "be220c4a-f070-4493-a072-ed067ea024f7",
      "name": "Sticky Note19",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        8240,
        1472
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "6e43a74a-abbb-42a2-bf65-0a4d2a71201c",
      "name": "Sticky Note20",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        8688,
        1552
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "861fdfa4-7d9e-4a3f-9af7-9286be72a5a6",
      "name": "Sticky Note21",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        2448
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "b525e7b1-9794-48c5-99ba-45936ea18fc1",
      "name": "Sticky Note22",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1584,
        2128
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "8936a208-5c4c-48da-bb98-38dabd6ebcf4",
      "name": "Sticky Note23",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1584,
        2640
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "daf6654e-fcee-4d92-9cb7-6a06b417d9f2",
      "name": "Sticky Note24",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2304,
        2560
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "787d42e9-0a65-418c-bb45-dcfc34d4b9aa",
      "name": "Sticky Note25",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        3184
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "7b30df58-8b7b-43d6-acf1-5924435a10c3",
      "name": "When Gmail Received",
      "type": "n8n-nodes-base.gmailTrigger",
      "notes": "Polls inbox for new support emails",
      "position": [
        608,
        128
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "1f5ff733-ee38-41cc-861d-0f8e27775bff",
      "name": "Normalize Gmail Data",
      "type": "n8n-nodes-base.code",
      "notes": "Extracts name, email, subject & body",
      "position": [
        880,
        128
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "91db454b-7e86-4e4a-8195-147d60015b75",
      "name": "WAHA Support Webhook",
      "type": "n8n-nodes-base.webhook",
      "notes": "Receives inbound WhatsApp events",
      "position": [
        608,
        704
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "846d0f72-61df-4cf7-9041-4cda842b2ee3",
      "name": "Filter WAHA Messages",
      "type": "n8n-nodes-base.code",
      "position": [
        832,
        704
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "fa5ed6cc-cd8a-4b84-9b46-30cbfc5dae5e",
      "name": "Parse WAHA Data",
      "type": "n8n-nodes-base.code",
      "notes": "Extracts phone, message & media",
      "position": [
        1040,
        704
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "d5566dd1-5778-4fec-b577-60c54c692d75",
      "name": "Check for Media",
      "type": "n8n-nodes-base.if",
      "position": [
        1264,
        704
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "16372208-3220-4549-87b7-750b4af82d53",
      "name": "Fetch WAHA Media",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "WAHA /api/files needs header X-Api-Key. Select credential 'WAHA Header Auth' (Header Auth, Name=X-Api-Key, Value=plain WAHA key) on this node after import. 401 here means the credential is not selected or the key is wrong.",
      "onError": "continueRegularOutput",
      "maxTries": 3,
      "position": [
        1488,
        576
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 4.2,
      "waitBetweenTries": 2000
    },
    {
      "id": "e1e2f3f8-0ba7-4537-8f41-a4f5661c1638",
      "name": "Normalize WhatsApp Data",
      "type": "n8n-nodes-base.code",
      "notes": "Maps WhatsApp data to common format",
      "position": [
        1936,
        704
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "f2c13470-3a6c-4463-be67-0e92f9bf0324",
      "name": "Restore WAHA Media Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1712,
        576
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "e101087f-04b5-4a04-a88c-7d2d4f51be96",
      "name": "When Form Submitted",
      "type": "n8n-nodes-base.formTrigger",
      "notes": "Receives website contact form submits",
      "position": [
        608,
        1136
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "c6c279c1-9c21-4933-addb-e1db45abb0f7",
      "name": "Normalize Form Data",
      "type": "n8n-nodes-base.code",
      "notes": "Maps form data to common format",
      "position": [
        880,
        1136
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "a45bec9d-32f7-4a50-baf7-3af864619b42",
      "name": "Reply Form Success",
      "type": "n8n-nodes-base.form",
      "notes": "Confirms receipt to the website form",
      "position": [
        8976,
        1712
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5a004024-68fb-4a47-886a-4230722d5910",
      "name": "Merge All Results",
      "type": "n8n-nodes-base.code",
      "position": [
        8512,
        1792
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "c298e47e-2907-4c9c-9fd3-e88f1205cc67",
      "name": "Build Primary Result",
      "type": "n8n-nodes-base.code",
      "position": [
        8288,
        1648
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "20e67411-842a-43f0-959a-70f9314b31e2",
      "name": "Build Duplicated Result",
      "type": "n8n-nodes-base.code",
      "position": [
        6032,
        1568
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "9d6ca99f-25e4-4661-b012-8ec18ce0b6b3",
      "name": "Merge Ticket with Slack",
      "type": "n8n-nodes-base.merge",
      "position": [
        8400,
        1728
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "db79a365-33cb-4c5e-af70-bbe92e10ac1d",
      "name": "Load Configuration",
      "type": "n8n-nodes-base.code",
      "position": [
        2288,
        1680
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "556d3516-c311-4e75-9e3b-e2941e762efe",
      "name": "Prepare HubSpot Search Query",
      "type": "n8n-nodes-base.code",
      "position": [
        2496,
        1680
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "b5512afc-9ead-4f66-b426-c428487c8bbb",
      "name": "Post HubSpot Search",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Looks up requester in HubSpot",
      "onError": "continueRegularOutput",
      "maxTries": 3,
      "position": [
        2720,
        1680
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 4.2,
      "continueOnFail": true,
      "waitBetweenTries": 2000
    },
    {
      "id": "7a2514ff-1884-4c24-8e38-443213334cc0",
      "name": "Consolidate HubSpot Results",
      "type": "n8n-nodes-base.code",
      "position": [
        3392,
        1680
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "d42fab35-1353-49e0-b8c7-3ab87f4300e3",
      "name": "Filter Text for OpenAI",
      "type": "n8n-nodes-base.code",
      "position": [
        3616,
        1680
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "7c05ec09-8bff-4940-a96b-7e7e81be09e4",
      "name": "OpenAI Analysis",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "notes": "AI classifies category, urgency & sentiment",
      "maxTries": 3,
      "position": [
        3792,
        1680
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 1.8,
      "waitBetweenTries": 3000
    },
    {
      "id": "cd39dd47-845a-4fa4-bc37-e08446f0d9d4",
      "name": "Decode AI Analysis",
      "type": "n8n-nodes-base.code",
      "notes": "Parses AI response into structured fields",
      "position": [
        4064,
        1680
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "52015f62-01b7-421a-9b2e-c5945613f8bd",
      "name": "Compute SLA and Team Allocation",
      "type": "n8n-nodes-base.code",
      "notes": "Assigns SLA deadline & owning team",
      "position": [
        4880,
        1680
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "1954cbc3-654d-4ee4-8c78-52ffdb9846cb",
      "name": "Generate Jira Payload",
      "type": "n8n-nodes-base.code",
      "position": [
        5104,
        1680
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "d672ceaf-ed08-44cb-a1b9-1e8b8f5ddf0d",
      "name": "Search Jira for Duplicates",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Checks Jira for an existing ticket",
      "onError": "continueRegularOutput",
      "maxTries": 3,
      "position": [
        5344,
        1680
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 4.2,
      "waitBetweenTries": 2000
    },
    {
      "id": "757dccab-8387-4a7d-8948-3beb83732e13",
      "name": "Parse Deduplication Result",
      "type": "n8n-nodes-base.code",
      "position": [
        5568,
        1680
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "b9b591b8-b9ea-4090-94f8-8767ccf823e1",
      "name": "Identify Duplicate Issues",
      "type": "n8n-nodes-base.if",
      "notes": "Branches duplicate vs new ticket",
      "position": [
        5792,
        1680
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "5ffffd0d-af29-469e-ae93-e6add271387f",
      "name": "Notify Slack of Duplicate",
      "type": "n8n-nodes-base.slack",
      "onError": "continueRegularOutput",
      "position": [
        6032,
        1488
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "a9260021-185b-4f60-9417-a6bb4111df48",
      "name": "Create Jira Issue4",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Creates the Jira support ticket",
      "maxTries": 3,
      "position": [
        6016,
        1920
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 4.2,
      "waitBetweenTries": 3000
    },
    {
      "id": "286c9a0b-473a-4b22-b5cc-692a5613d453",
      "name": "Merge Jira Create Result4",
      "type": "n8n-nodes-base.code",
      "position": [
        6240,
        1920
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "c16ed023-47ad-4547-8d72-cd7b44455a61",
      "name": "Stamp SLA Custom Fields4",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Writes SLA due date to Jira",
      "onError": "continueRegularOutput",
      "maxTries": 1,
      "position": [
        6672,
        1440
      ],
      "parameters": {},
      "retryOnFail": false,
      "typeVersion": 4.2
    },
    {
      "id": "e3cb5c2b-8140-49c2-9cba-0fc4979c0b29",
      "name": "Prepare Attachments4",
      "type": "n8n-nodes-base.code",
      "position": [
        7120,
        1792
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "c9deccee-eb54-41b1-a6c4-9dc94834e556",
      "name": "Skip Attachments?4",
      "type": "n8n-nodes-base.if",
      "position": [
        7344,
        1792
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "a31824d3-a6c5-41d1-bf69-1b3ff24b1604",
      "name": "Upload Jira Attachment4",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Attaches customer files to the ticket",
      "onError": "continueRegularOutput",
      "maxTries": 3,
      "position": [
        7568,
        1888
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 4.2
    },
    {
      "id": "578ca5ba-aa03-4735-852a-25d8d69a0b51",
      "name": "Normalize Before Slack3",
      "type": "n8n-nodes-base.code",
      "position": [
        7840,
        1792
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "c74c6402-3b85-482d-ac7a-d836ff752504",
      "name": "Slack Ticket Notification4",
      "type": "n8n-nodes-base.slack",
      "notes": "Posts new ticket alert to Slack",
      "onError": "continueRegularOutput",
      "maxTries": 2,
      "position": [
        8064,
        1792
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 2.2
    },
    {
      "id": "b226c152-9dd1-4bac-9b2f-e1d31530b959",
      "name": "Prepare SLA Stamp3",
      "type": "n8n-nodes-base.code",
      "position": [
        6464,
        1792
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "04b32d45-9e0b-45da-bd46-8891df8dd8e2",
      "name": "Should Stamp SLA?3",
      "type": "n8n-nodes-base.if",
      "notes": "Decides if SLA fields need stamping",
      "position": [
        6688,
        1792
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "922c6c7e-af3b-4db0-b964-fac5715ff0e3",
      "name": "Restore After SLA Stamp3",
      "type": "n8n-nodes-base.code",
      "position": [
        6896,
        1440
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "ac3874a2-2c00-4cc6-b402-9b72296bbc14",
      "name": "Restore After Upload3",
      "type": "n8n-nodes-base.code",
      "position": [
        7568,
        1968
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "d020301d-925b-4091-9e09-a76cd34495df",
      "name": "Pass Ticket (No Raise)",
      "type": "n8n-nodes-base.code",
      "position": [
        1872,
        3008
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "90283b4d-6f9a-4903-afb7-21cf66eaa3f0",
      "name": "Summarize Mark Result",
      "type": "n8n-nodes-base.code",
      "position": [
        2592,
        2688
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "df248714-f6cd-41e7-9d57-ac4461ceea3d",
      "name": "Every 10 Minutes1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "notes": "Runs the SLA breach check on schedule",
      "position": [
        624,
        2576
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "31bed51f-23e2-4ebe-b910-0308f8f32b54",
      "name": "Load SLA Config1",
      "type": "n8n-nodes-base.code",
      "position": [
        864,
        2576
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "b16744d8-7e27-4fb7-a012-7828e5b680b3",
      "name": "Search Breached Tickets1",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Finds tickets past their SLA deadline",
      "maxTries": 3,
      "position": [
        1104,
        2576
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 4.2,
      "waitBetweenTries": 2000
    },
    {
      "id": "bcf82b39-c899-4129-9b48-286fce330f8e",
      "name": "Split Breached Issues1",
      "type": "n8n-nodes-base.code",
      "position": [
        1344,
        2576
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "5d38e256-85da-46b9-9019-e52f800bb2ad",
      "name": "Slack SLA Alert1",
      "type": "n8n-nodes-base.slack",
      "notes": "Posts SLA breach warning to Slack",
      "onError": "continueRegularOutput",
      "maxTries": 2,
      "position": [
        1632,
        2288
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 2.2
    },
    {
      "id": "ec16ac8c-6ef6-41af-afc6-73b6e9e21447",
      "name": "Has Manager?1",
      "type": "n8n-nodes-base.if",
      "notes": "Checks if a manager is on record",
      "position": [
        1632,
        2448
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "58c40165-7c92-4535-845b-b88bc4bf11e7",
      "name": "Notify Manager1",
      "type": "n8n-nodes-base.slack",
      "notes": "Alerts the manager of the breach",
      "onError": "continueRegularOutput",
      "maxTries": 2,
      "position": [
        1872,
        2368
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 2.2
    },
    {
      "id": "e78b30ed-e265-4a3d-993e-be37f5409842",
      "name": "Raise Priority?1",
      "type": "n8n-nodes-base.if",
      "notes": "Decides whether to escalate priority",
      "position": [
        1632,
        2896
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "c5438d71-a082-46ac-8046-4c6e44167133",
      "name": "Raise Jira Priority1",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Bumps ticket priority in Jira",
      "onError": "continueRegularOutput",
      "maxTries": 2,
      "position": [
        1872,
        2800
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 4.2
    },
    {
      "id": "70eaeee0-6275-44a2-a8cb-8da1c70b2eda",
      "name": "Restore Before Mark1",
      "type": "n8n-nodes-base.code",
      "position": [
        2112,
        2800
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "4c188993-f1b3-4d3c-a637-1726ff8f5be4",
      "name": "Mark SLA Notified1",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Flags ticket so it isn't re-alerted",
      "onError": "continueRegularOutput",
      "maxTries": 3,
      "position": [
        2352,
        2688
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 4.2,
      "waitBetweenTries": 1000
    },
    {
      "id": "8f7b133c-3d5a-48d2-8f82-b76e7125648c",
      "name": "Error Trigger",
      "type": "n8n-nodes-base.errorTrigger",
      "notes": "Catches failures from any node",
      "position": [
        672,
        3312
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b75b82af-da45-4846-b7c4-ce9989579bd8",
      "name": "Format Error Payload",
      "type": "n8n-nodes-base.code",
      "position": [
        912,
        3312
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "ca3eb2b2-7fa3-46c6-8172-548382627935",
      "name": "Slack Error Channel",
      "type": "n8n-nodes-base.slack",
      "notes": "Reports workflow errors to Slack",
      "onError": "continueRegularOutput",
      "maxTries": 2,
      "position": [
        1152,
        3312
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 2.2
    },
    {
      "id": "20bc4225-5665-4818-80f1-00d75c74ab42",
      "name": "Is Form Channel?",
      "type": "n8n-nodes-base.if",
      "notes": "Routes form submissions to a reply",
      "position": [
        8736,
        1792
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "ab84ba12-22da-41ca-b9a1-f22b8593e9ff",
      "name": "Hold Binary For Upload",
      "type": "n8n-nodes-base.noOp",
      "notes": "In-line file stash (old sub-workflow trigger). Do not fan this out as a dead-end.",
      "position": [
        2016,
        1680
      ],
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "f0d9775e-8ebf-4f56-9521-70378e39d57b",
  "nodeGroups": [],
  "connections": {
    "Error Trigger": {
      "main": [
        [
          {
            "node": "Format Error Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has Manager?1": {
      "main": [
        [
          {
            "node": "Notify Manager1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for Media": {
      "main": [
        [
          {
            "node": "Fetch WAHA Media",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Normalize WhatsApp Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Analysis": {
      "main": [
        [
          {
            "node": "Decode AI Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse WAHA Data": {
      "main": [
        [
          {
            "node": "Check for Media",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch WAHA Media": {
      "main": [
        [
          {
            "node": "Restore WAHA Media Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Form Channel?": {
      "main": [
        [
          {
            "node": "Reply Form Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load SLA Config1": {
      "main": [
        [
          {
            "node": "Search Breached Tickets1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Raise Priority?1": {
      "main": [
        [
          {
            "node": "Raise Jira Priority1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Pass Ticket (No Raise)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Every 10 Minutes1": {
      "main": [
        [
          {
            "node": "Load SLA Config1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge All Results": {
      "main": [
        [
          {
            "node": "Is Form Channel?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Jira Issue4": {
      "main": [
        [
          {
            "node": "Merge Jira Create Result4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Decode AI Analysis": {
      "main": [
        [
          {
            "node": "Compute SLA and Team Allocation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load Configuration": {
      "main": [
        [
          {
            "node": "Prepare HubSpot Search Query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark SLA Notified1": {
      "main": [
        [
          {
            "node": "Summarize Mark Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare SLA Stamp3": {
      "main": [
        [
          {
            "node": "Should Stamp SLA?3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Should Stamp SLA?3": {
      "main": [
        [
          {
            "node": "Stamp SLA Custom Fields4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare Attachments4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Skip Attachments?4": {
      "main": [
        [
          {
            "node": "Normalize Before Slack3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Upload Jira Attachment4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Form Data": {
      "main": [
        [
          {
            "node": "Hold Binary For Upload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post HubSpot Search": {
      "main": [
        [
          {
            "node": "Consolidate HubSpot Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Form Submitted": {
      "main": [
        [
          {
            "node": "Normalize Form Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Gmail Received": {
      "main": [
        [
          {
            "node": "Normalize Gmail Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Primary Result": {
      "main": [
        [
          {
            "node": "Merge Ticket with Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter WAHA Messages": {
      "main": [
        [
          {
            "node": "Parse WAHA Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Error Payload": {
      "main": [
        [
          {
            "node": "Slack Error Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Gmail Data": {
      "main": [
        [
          {
            "node": "Hold Binary For Upload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Attachments4": {
      "main": [
        [
          {
            "node": "Skip Attachments?4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Raise Jira Priority1": {
      "main": [
        [
          {
            "node": "Restore Before Mark1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Restore Before Mark1": {
      "main": [
        [
          {
            "node": "Mark SLA Notified1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WAHA Support Webhook": {
      "main": [
        [
          {
            "node": "Filter WAHA Messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Jira Payload": {
      "main": [
        [
          {
            "node": "Search Jira for Duplicates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Restore After Upload3": {
      "main": [
        [
          {
            "node": "Normalize Before Slack3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Text for OpenAI": {
      "main": [
        [
          {
            "node": "OpenAI Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Hold Binary For Upload": {
      "main": [
        [
          {
            "node": "Load Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pass Ticket (No Raise)": {
      "main": [
        [
          {
            "node": "Mark SLA Notified1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Breached Issues1": {
      "main": [
        [
          {
            "node": "Slack SLA Alert1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Has Manager?1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Raise Priority?1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Duplicated Result": {
      "main": [
        [
          {
            "node": "Notify Slack of Duplicate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Ticket with Slack": {
      "main": [
        [
          {
            "node": "Merge All Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Before Slack3": {
      "main": [
        [
          {
            "node": "Build Primary Result",
            "type": "main",
            "index": 0
          },
          {
            "node": "Slack Ticket Notification4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize WhatsApp Data": {
      "main": [
        [
          {
            "node": "Hold Binary For Upload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Restore WAHA Media Data": {
      "main": [
        [
          {
            "node": "Normalize WhatsApp Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Jira Attachment4": {
      "main": [
        [
          {
            "node": "Restore After Upload3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Restore After SLA Stamp3": {
      "main": [
        [
          {
            "node": "Prepare Attachments4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Breached Tickets1": {
      "main": [
        [
          {
            "node": "Split Breached Issues1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Stamp SLA Custom Fields4": {
      "main": [
        [
          {
            "node": "Restore After SLA Stamp3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Identify Duplicate Issues": {
      "main": [
        [
          {
            "node": "Build Duplicated Result",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create Jira Issue4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Jira Create Result4": {
      "main": [
        [
          {
            "node": "Prepare SLA Stamp3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Slack of Duplicate": {
      "main": [
        [
          {
            "node": "Merge All Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Deduplication Result": {
      "main": [
        [
          {
            "node": "Identify Duplicate Issues",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Jira for Duplicates": {
      "main": [
        [
          {
            "node": "Parse Deduplication Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slack Ticket Notification4": {
      "main": [
        [
          {
            "node": "Merge Ticket with Slack",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Consolidate HubSpot Results": {
      "main": [
        [
          {
            "node": "Filter Text for OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare HubSpot Search Query": {
      "main": [
        [
          {
            "node": "Post HubSpot Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compute SLA and Team Allocation": {
      "main": [
        [
          {
            "node": "Generate Jira Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}