{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "ea481a3e-d030-4adc-ac1f-add78c676457",
      "name": "Get a user's presence status",
      "type": "n8n-nodes-base.slack",
      "position": [
        1168,
        -4192
      ],
      "parameters": {
        "user": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "resource": "user",
        "operation": "getPresence"
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "84ab1028-0a19-4e27-be18-ae2404964099",
      "name": "is the VIP Customer?",
      "type": "n8n-nodes-base.if",
      "position": [
        -160,
        -3968
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "8b2a84e0-0743-46a2-9d4e-7d55fde5eb51",
              "operator": {
                "type": "array",
                "operation": "contains",
                "rightType": "any"
              },
              "leftValue": "={{ $json.tags }}",
              "rightValue": "vip"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ead87c55-9f8d-4888-bea4-28280dd31b64",
      "name": "New ticket received",
      "type": "n8n-nodes-base.zendeskTrigger",
      "position": [
        -416,
        -3968
      ],
      "parameters": {
        "options": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "zendeskOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9d5b125e-a463-495f-96b4-d1e49488e96b",
      "name": "Intelligent Ticket Analysis",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        176,
        -4208
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4-turbo",
          "cachedResultName": "GPT-4-TURBO"
        },
        "options": {},
        "responses": {
          "values": [
            {
              "content": "=You are a support agent assistant. A VIP customer has submitted this ticket:\n\nTicket Subject: {{$json[\"subject\"]}}\nTicket Description: {{$json[\"description\"]}}\nPriority: {{$json[\"priority\"]}}\n\nSummarize the issue in 2-3 lines and give clear next steps the support agent should take.\n"
            }
          ]
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "b1c767f6-499c-4ad4-a894-0eebdbfc7a7e",
      "name": "Store VIP Ticket details",
      "type": "n8n-nodes-base.airtable",
      "position": [
        496,
        -4208
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appF2iYPgVqqyXDC1",
          "cachedResultUrl": "https://airtable.com/appF2iYPgVqqyXDC1",
          "cachedResultName": "n8n Demo"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblSE7MZYVnPYMSoU",
          "cachedResultUrl": "https://airtable.com/appF2iYPgVqqyXDC1/tblSE7MZYVnPYMSoU",
          "cachedResultName": "Customer Ticket"
        },
        "columns": {
          "value": {
            "Link": "={{ $('is the VIP Customer?').item.json.url }}",
            "Subject": "={{ $('is the VIP Customer?').item.json.subject }}",
            "Priority": "={{ $('is the VIP Customer?').item.json.priority }}",
            "Ticket Id": "={{ $('is the VIP Customer?').item.json.id }}",
            "Request Id": "={{ $('is the VIP Customer?').item.json.requester_id }}",
            "Issue Summary": "={{ $('Intelligent Ticket Analysis').item.json.output[0].content[0].text }}"
          },
          "schema": [
            {
              "id": "Ticket Id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Ticket Id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Subject",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Subject",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Priority",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Priority",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Request Id",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Request Id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Issue Summary",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Issue Summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Link",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "create"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "b4bd74d6-eaa0-4623-80d5-a56e2661f1e4",
      "name": "Get support team members",
      "type": "n8n-nodes-base.slack",
      "position": [
        720,
        -4208
      ],
      "parameters": {
        "resource": "user",
        "operation": "getAll"
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "d42c8a22-7cf0-4bfa-82b9-1006e8b26d69",
      "name": "Check each team member",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        960,
        -4208
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "c3bd8f80-cb2f-4444-8d8e-df75bc4e073b",
      "name": "Is someone Active?",
      "type": "n8n-nodes-base.if",
      "position": [
        1376,
        -4192
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "f4e653a2-c3a0-4d29-8f16-1cdfbbbe0e2a",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.presence }}",
              "rightValue": "active"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "a7bb69a5-0265-43eb-94ff-f9cd59e9c07d",
      "name": "Notify support channel",
      "type": "n8n-nodes-base.slack",
      "position": [
        1632,
        -4048
      ],
      "parameters": {
        "text": "=:rotating_light: *VIP Ticket Alert* :rotating_light:\n\n*Ticket ID:* {{ $('is the VIP Customer?').item.json.id }}\n*Subject:* {{ $('is the VIP Customer?').item.json.subject }}\n*Priority:* {{ $('is the VIP Customer?').item.json.priority }}\n*Requester ID:* {{ $('is the VIP Customer?').item.json.requester_id }}\n\n*Issue Summary & Suggested Steps:*\n{{$node[\"Intelligent Ticket Analysis\"].json[\"output\"][0][\"content\"][0][\"text\"]}}\n\n*Zendesk Link:* {{ $('is the VIP Customer?').item.json.url }}\n",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C09S57E2JQ2",
          "cachedResultName": "n8n"
        },
        "otherOptions": {
          "includeLinkToWorkflow": false
        }
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "2a687a9c-89f1-4c71-9160-7c3bc7228dad",
      "name": "Prepare non VIP ticket data",
      "type": "n8n-nodes-base.set",
      "position": [
        176,
        -3744
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f7b3fd0e-ed3e-47ab-9164-29507877f9a3",
              "name": "ticket_id",
              "type": "number",
              "value": "={{ $json.id }}"
            },
            {
              "id": "32d96e79-61d2-4668-884e-108434757530",
              "name": "subject",
              "type": "string",
              "value": "={{ $json.subject }}"
            },
            {
              "id": "c0eb2766-78ed-41df-a776-c8fce795900f",
              "name": "priority",
              "type": "string",
              "value": "={{ $json.priority }}"
            },
            {
              "id": "a9b262fd-d913-489d-9766-94b2ba9170e1",
              "name": "status",
              "type": "string",
              "value": "={{ $json.status }}"
            },
            {
              "id": "40a6600a-ce65-4918-93c8-1a57d158221e",
              "name": "description",
              "type": "string",
              "value": "={{ $json.description }}"
            },
            {
              "id": "9c69e073-42d3-4302-81a7-383558d66377",
              "name": "url",
              "type": "string",
              "value": "={{ $json.url }}"
            },
            {
              "id": "364e8d00-ba89-48b6-a8b7-8fa9e549d678",
              "name": "created_at",
              "type": "string",
              "value": "={{ $json.created_at }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "985adbbf-c7c1-46b4-8439-5ee3091c6c99",
      "name": "Notify directly Active user",
      "type": "n8n-nodes-base.slack",
      "position": [
        1632,
        -4384
      ],
      "parameters": {
        "text": "=:rotating_light: *VIP Ticket Alert* :rotating_light:  \n*Ticket ID:* {{ $('is the VIP Customer?').item.json.id }} \n*Subject:* {{ $('is the VIP Customer?').item.json.subject }} \n*Priority:* {{ $('is the VIP Customer?').item.json.priority }} \n*Requester ID:* {{ $('is the VIP Customer?').item.json.requester_id }}  \n\n*Issue Summary & Suggested Steps:* \n{{$node[\"Intelligent Ticket Analysis\"].json[\"output\"][0][\"content\"][0][\"text\"]}}  \n\n*Zendesk Link:* {{ $('is the VIP Customer?').item.json.url }}",
        "user": {
          "__rl": true,
          "mode": "id",
          "value": "=U05JTMVC7JL"
        },
        "select": "user",
        "otherOptions": {
          "includeLinkToWorkflow": false
        }
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "f0bde5f5-2ab8-4255-9bd8-0bdd6a0e4539",
      "name": "Combine all VIP ticket",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        416,
        -3744
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "a0fbd440-3d76-43fe-9b7b-3ca5cf32ef91",
      "name": "Notify for non VIP customer",
      "type": "n8n-nodes-base.gmail",
      "position": [
        656,
        -3744
      ],
      "parameters": {
        "message": "=Hello Team,  The following non-VIP support tickets were created:  \n{{    $json.data.map(ticket => ` ---------------------------------- \nTicket ID: ${ticket.ticket_id} \nSubject: ${ticket.subject} \nPriority: ${ticket.priority} \nStatus: ${ticket.status} \nCreated At: ${ticket.created_at}  \nDescription: ${ticket.description}  \nZendesk Link: ${ticket.url} `).join('\\n') }}  \nPlease review and assign these tickets accordingly.  \nThanks, n8n Automation",
        "options": {
          "appendAttribution": false
        },
        "subject": "=New Non-VIP Support Tickets ({{ $json.data.length }})",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "00188e5f-8c1c-468e-91a0-b5134822667a",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -464,
        -4064
      ],
      "parameters": {
        "color": 7,
        "width": 224,
        "height": 240,
        "content": "Starts the automation whenever a new support ticket is received in Zendesk."
      },
      "typeVersion": 1
    },
    {
      "id": "1ae3ef6f-fcf8-433d-96f1-41cdd4e085b5",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        -4064
      ],
      "parameters": {
        "color": 7,
        "width": 224,
        "height": 240,
        "content": "Checks whether the ticket belongs to a VIP customer based on the \u201cvip\u201d tag."
      },
      "typeVersion": 1
    },
    {
      "id": "9e319f61-630b-49d0-946e-070734e9ffdc",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        -4400
      ],
      "parameters": {
        "color": 7,
        "width": 1408,
        "height": 384,
        "content": "## Customer Support Process & Ticket Management Flow\n\nThis part of the workflow uses AI to understand VIP tickets, saves the ticket details for tracking and then checks the support team on Slack to see who is currently available.\nThe system goes through each team member one by one, checks who is online and decides the next step based on availability so the ticket can be handled quickly."
      },
      "typeVersion": 1
    },
    {
      "id": "5ec25fff-4c92-4191-8040-b1fa06967b87",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1552,
        -4480
      ],
      "parameters": {
        "color": 7,
        "width": 272,
        "height": 304,
        "content": "Sends a private Slack message to an available senior support agent about the VIP ticket."
      },
      "typeVersion": 1
    },
    {
      "id": "2688f747-29dd-4cce-a58a-2a0763655599",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1552,
        -4144
      ],
      "parameters": {
        "color": 7,
        "width": 272,
        "height": 304,
        "content": "Posts the VIP ticket alert in a shared Slack channel if no agent is active."
      },
      "typeVersion": 1
    },
    {
      "id": "2d76c93e-b095-429d-9561-4cbae7ed85b7",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        -3984
      ],
      "parameters": {
        "color": 7,
        "width": 768,
        "height": 416,
        "content": "## Non-VIP Ticket Email Process\n\n**Prepare Non-VIP Ticket Data:** Cleans and formats ticket information so it can be combined into one email.\n**Combine All Non-VIP Tickets:** Groups multiple non-VIP tickets together so only one email is sent instead of many.\n**Notify for non VIP customer:** Sends a single summary email listing all non-VIP tickets for the support team to review."
      },
      "typeVersion": 1
    },
    {
      "id": "4b0e92f5-cc59-4f04-bdf7-6ea45bc8ca65",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1072,
        -4576
      ],
      "parameters": {
        "width": 480,
        "height": 608,
        "content": "## How it Works\n\nThis workflow automatically listens for new support tickets from Zendesk. When a ticket is created, it checks whether the customer is marked as a VIP. If the customer is a VIP, the workflow uses AI to understand the problem, creates a short summary with next steps, saves the ticket details for tracking and sends an alert to an available support agent on Slack or to a team channel if no one is online. If the customer is not a VIP, the workflow collects all such tickets and sends one combined email to the support team. This helps VIP customers get faster attention while keeping regular ticket notifications simple and organized.\n\n\n\n## Setup steps\n\n**1.** Connect your Zendesk account to receive new ticket events.\n\n**2.** Set up Slack to fetch users, check online status and send messages.\n\n**3.** Connect OpenAI to summarize VIP tickets clearly.\n\n**4.** Connect Airtable to store VIP ticket details.\n\n**5.** Configure Gmail to send summary emails for non-VIP tickets.\n\n**6.** Make sure VIP customers are correctly tagged in Zendesk."
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Is someone Active?": {
      "main": [
        [
          {
            "node": "Notify directly Active user",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notify support channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New ticket received": {
      "main": [
        [
          {
            "node": "is the VIP Customer?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "is the VIP Customer?": {
      "main": [
        [
          {
            "node": "Intelligent Ticket Analysis",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare non VIP ticket data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check each team member": {
      "main": [
        [],
        [
          {
            "node": "Get a user's presence status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine all VIP ticket": {
      "main": [
        [
          {
            "node": "Notify for non VIP customer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify support channel": {
      "main": [
        [
          {
            "node": "Check each team member",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get support team members": {
      "main": [
        [
          {
            "node": "Check each team member",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store VIP Ticket details": {
      "main": [
        [
          {
            "node": "Get support team members",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Intelligent Ticket Analysis": {
      "main": [
        [
          {
            "node": "Store VIP Ticket details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify directly Active user": {
      "main": [
        [
          {
            "node": "Check each team member",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare non VIP ticket data": {
      "main": [
        [
          {
            "node": "Combine all VIP ticket",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a user's presence status": {
      "main": [
        [
          {
            "node": "Is someone Active?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}