N
n8n Store
Workflow Market
Escalation Workflow

Escalation Workflow

by rahul080 views

Description

Categories

🤖 AI & Machine Learning

Nodes Used

n8n-nodes-base.coden8n-nodes-base.coden8n-nodes-base.coden8n-nodes-base.mergen8n-nodes-base.clickUpn8n-nodes-base.zendeskn8n-nodes-base.zendeskn8n-nodes-base.telegramn8n-nodes-base.stickyNoten8n-nodes-base.stickyNote
PriceGratis
Views0
Last Updated11/28/2025
workflow.json
{
  "id": "9uaKLgOrveMqlebn",
  "meta": {
    "instanceId": "8443f10082278c46aa5cf3acf8ff0f70061a2c58bce76efac814b16290845177"
  },
  "name": "Escalation Workflow",
  "tags": [],
  "nodes": [
    {
      "id": "613892c0-fbe7-4ab9-ac04-c0cbc0979a91",
      "name": "Fetch Zendesk Tickets",
      "type": "n8n-nodes-base.zendesk",
      "position": [
        -224,
        16
      ],
      "parameters": {
        "options": {
          "group": 22337660284956,
          "sortBy": "status",
          "status": "pending",
          "sortOrder": "desc"
        },
        "operation": "getAll"
      },
      "credentials": {
        "zendeskApi": {
          "id": "gyKfBorFigBI1uj8",
          "name": "Zendesk account vivek"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "308d53f2-a968-44bb-be27-d787b8d601e2",
      "name": "Select Latest Ticket",
      "type": "n8n-nodes-base.code",
      "position": [
        32,
        16
      ],
      "parameters": {
        "jsCode": "// Input: array of tickets from Zendesk\nconst tickets = items.map(item => item.json);\n\n// Sort tickets by created_at descending\ntickets.sort((a, b) => new Date(b.created_at) - new Date(a.created_at));\n\n// Pick the most recent ticket\nconst latest = tickets[0];\n\n// Return only that ticket as output\nreturn [{\n  json: {\n    id: latest.id,\n    subject: latest.subject,\n    description: latest.description,\n    requester_id: latest.requester_id,\n    created_at: latest.created_at\n  }\n}];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "8faf2c0b-d6c7-4513-9b0c-40de728dde4d",
      "name": "Fetch Requester Email",
      "type": "n8n-nodes-base.zendesk",
      "position": [
        336,
        -176
      ],
      "parameters": {
        "id": "={{ $json.requester_id }}",
        "resource": "user",
        "operation": "get"
      },
      "credentials": {
        "zendeskApi": {
          "id": "gyKfBorFigBI1uj8",
          "name": "Zendesk account vivek"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "551ea948-976a-4b8f-abd9-e320d9881f7e",
      "name": "Create a task",
      "type": "n8n-nodes-base.clickUp",
      "position": [
        1056,
        0
      ],
      "parameters": {
        "list": "901411343468",
        "name": "={{ $json.name }}",
        "team": "9014872066",
        "space": "90143686913",
        "folderless": true,
        "additionalFields": {
          "content": "={{ $json.description }}",
          "dueDate": "={{ new Date(Date.now() + 7*24*60*60*1000).toISOString() }}",
          "assignees": [
            224432632
          ]
        }
      },
      "credentials": {
        "clickUpApi": {
          "id": "kahuAqa6VKsSxhn1",
          "name": "ClickUp account 3"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "955d2b4a-a387-4586-9bbe-db77e690c27d",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -496,
        16
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0c712188-6a30-4de6-afa2-a0c08f90c6c4",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1184,
        -320
      ],
      "parameters": {
        "height": 288,
        "content": "Action: Builds a concise escalation alert for Telegram.\n\nDescription: Extracts the key details from the ClickUp task — such as ticket subject, requester’s name/email, and task link — and formats them into a short, urgent message. The message includes emojis, bold highlights, and a direct call to action so managers can immediately see what requires their attention."
      },
      "typeVersion": 1
    },
    {
      "id": "159cc87f-c633-4a75-8aeb-70f8e828c8d7",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        176
      ],
      "parameters": {
        "height": 272,
        "content": "Action: Creates a new task in the designated ClickUp list.\n\nDescription: Pushes the formatted payload into ClickUp, generating a trackable task inside the escalation list. It sets the assignee, fills in the description, applies tags, and even includes a due date. This ensures the escalation is visible within ClickUp for project tracking and accountability."
      },
      "typeVersion": 1
    },
    {
      "id": "fffd694d-fe17-4aa6-987d-14e8b6631b56",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        -384
      ],
      "parameters": {
        "height": 320,
        "content": "Action: Formats the ticket and requester data into ClickUp task structure.\n\nDescription: Builds a new task object with a clear escalation title, detailed description (including ticket info and requester context), priority, and tags. It also adds a predefined escalation message so assignees in ClickUp immediately understand the urgency. This node ensures the ClickUp task has all the relevant context in one place."
      },
      "typeVersion": 1
    },
    {
      "id": "ab81ac67-e9af-4990-aee2-cd7e8b5f04db",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        176
      ],
      "parameters": {
        "height": 272,
        "content": "Action: Combines ticket and requester information into one dataset.\n\nDescription: Consolidates the ticket metadata (ID, subject, description, creation time) with requester details (name, email, timezone). This merged dataset provides a single, enriched record that can be passed downstream to build a complete ClickUp task payload"
      },
      "typeVersion": 1
    },
    {
      "id": "09511909-5d66-4eb9-be18-ca738ec1e0c6",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        -496
      ],
      "parameters": {
        "height": 288,
        "content": "Action: Retrieves requester details from Zendesk.\n\nDescription: Uses the requester_id from the ticket to fetch the associated user record in Zendesk. This provides critical context, including the requester’s name, email address, and timezone, so that the ClickUp task and Telegram alert include the human element of who raised the issue."
      },
      "typeVersion": 1
    },
    {
      "id": "df617f84-9ad6-4647-856f-c51ed74a7a58",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        176
      ],
      "parameters": {
        "height": 304,
        "content": "Action: Chooses the most recent ticket from the Zendesk list.\n\n Description: From the list of tickets retrieved, this node sorts them by created_at in descending order and selects only the latest ticket. This keeps the workflow focused on handling the most urgent or most recently flagged issue rather than overwhelming the system with multiple old tickets at once."
      },
      "typeVersion": 1
    },
    {
      "id": "43aa9671-8dc0-4ff6-8e63-0ed4ce24c3f6",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        -256
      ],
      "parameters": {
        "height": 240,
        "content": "Action: Retrieves Zendesk tickets from a specific group.\n\nDescription: Pulls all tickets with status “pending” from the specified Zendesk group, sorted by status. This ensures the workflow always works with tickets that are active and may need attention. It forms the entry point for identifying potential escalations."
      },
      "typeVersion": 1
    },
    {
      "id": "48ecaccd-160f-447e-bbc0-0252a7488606",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1440,
        176
      ],
      "parameters": {
        "height": 336,
        "content": "Action: Sends the formatted message to Telegram.\n\nDescription: Delivers the escalation alert directly into the manager’s Telegram chat. The notification contains all the essentials — ticket details, requester info, and the direct ClickUp link — ensuring fast visibility and a quick response time from the escalation team. This is the final step that closes the loop between Zendesk, ClickUp, and the communication channel."
      },
      "typeVersion": 1
    },
    {
      "id": "3455937a-d102-45e7-a337-d300f82ea268",
      "name": "Merge Ticket & Requester Data",
      "type": "n8n-nodes-base.merge",
      "position": [
        592,
        0
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "3fc52bad-cb5f-49b0-a28d-c3ce296a0a16",
      "name": "Prepare ClickUp Task Payload",
      "type": "n8n-nodes-base.code",
      "position": [
        832,
        0
      ],
      "parameters": {
        "jsCode": "const inputData = $input.all();\n\n// Extract requester and ticket info\nconst requester = inputData[0].json;\nconst ticket = inputData[1].json;\n\n// Build task name\nconst taskName = `[Escalation] ${ticket.subject} (Ticket #${ticket.id})`;\n\n// Add a custom escalation message\nconst escalationMessage = `🚨 This ticket has been escalated for immediate review by the support team.`;\n\n// Build detailed description\nconst description = `\n${escalationMessage}\n\n---\n\n**Zendesk Ticket Escalation**\n\n**Ticket Info**\n- ID: ${ticket.id}\n- Subject: ${ticket.subject}\n- Description: ${ticket.description}\n- Created At: ${ticket.created_at}\n\n**Requester Info**\n- Name: ${requester.name}\n- Email: ${requester.email}\n- Timezone: ${requester.time_zone}\n\n🔗 [View Ticket](${ticket.url})\n`;\n\n// Return ClickUp task payload\nreturn [{\n  json: {\n    name: taskName,\n    description: description,\n    priority: 3,  // default, adjust if needed\n    tags: [\"zendesk\", \"escalation\"],\n  }\n}];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "9188d0e5-08a2-4387-8689-c903fcb71c83",
      "name": "Format Telegram Alert Message",
      "type": "n8n-nodes-base.code",
      "position": [
        1264,
        0
      ],
      "parameters": {
        "jsCode": "const inputData = $input.item.json;\n\n// Extract essentials\nconst taskName = inputData.name || \"No Task Name\";\nconst ticketId = taskName.match(/#(\\d+)/) ? taskName.match(/#(\\d+)/)[1] : \"N/A\";\nconst description = inputData.description || \"\";\nconst requesterMatch = description.match(/Name:\\s(.+)\\n- Email:\\s(.+)/);\n\nconst requesterName = requesterMatch ? requesterMatch[1].trim() : \"Unknown\";\nconst requesterEmail = requesterMatch ? requesterMatch[2].trim() : \"Unknown\";\nconst clickupUrl = inputData.url || \"No ClickUp URL\";\n\n// Build concise Telegram message with urgency + CTA\nconst message = `\n🚨 *Escalation Alert – Immediate Attention Required!*\n\n• *Ticket:* ${taskName}  \n• *Requester:* ${requesterName} (${requesterEmail})  \n\n🔗 [Open ClickUp Task](${clickupUrl})\n\n⚡ Please review and assign *next steps* ASAP.\n`;\n\nreturn [{\n  json: {\n    message: message.trim()\n  }\n}];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "50807447-941e-4192-a04e-2b4e33026243",
      "name": "Send Telegram Escalation Alert",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1504,
        0
      ],
      "webhookId": "4f35a13c-afa2-457c-8432-8ae7891e9f61",
      "parameters": {
        "text": "={{ $json.message }}",
        "chatId": "963318735",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "7YyOQlYeUAQ5mTTN",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "2f0b9d6c-0bc3-4bb4-b69a-6501761cdcab",
  "connections": {
    "Create a task": {
      "main": [
        [
          {
            "node": "Format Telegram Alert Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Latest Ticket": {
      "main": [
        [
          {
            "node": "Fetch Requester Email",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge Ticket & Requester Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Fetch Requester Email": {
      "main": [
        [
          {
            "node": "Merge Ticket & Requester Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Zendesk Tickets": {
      "main": [
        [
          {
            "node": "Select Latest Ticket",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare ClickUp Task Payload": {
      "main": [
        [
          {
            "node": "Create a task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Telegram Alert Message": {
      "main": [
        [
          {
            "node": "Send Telegram Escalation Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Ticket & Requester Data": {
      "main": [
        [
          {
            "node": "Prepare ClickUp Task Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Telegram Escalation Alert": {
      "main": [
        []
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Fetch Zendesk Tickets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

相关工作流