{
  "name": "Customer Support Reply Drafting — Starter Template",
  "description": "A simplified starter template for drafting AI-powered customer support replies using n8n, Zendesk or a webhook, and Claude or ChatGPT. Requires manual configuration before use.",
  "version": "1.0",
  "type": "starter_template",
  "kairox_workflow": "customer-support-reply-drafting",
  "stack": {
    "automation": "n8n",
    "helpdesk": "Zendesk or Intercom (or generic webhook)",
    "ai": "Claude API or OpenAI API"
  },
  "required_credentials": [
    {
      "name": "Zendesk API Key or Intercom Access Token",
      "type": "api_key",
      "note": "Required to read incoming tickets and post reply drafts. Alternatively, use a webhook trigger for any helpdesk with webhook support."
    },
    {
      "name": "Claude API Key or OpenAI API Key",
      "type": "api_key",
      "note": "Used to draft the support reply. Claude 3.5 Sonnet recommended for tone and accuracy."
    }
  ],
  "nodes": [
    {
      "id": "1",
      "name": "Zendesk Trigger — New Ticket",
      "type": "n8n-nodes-base.zendesk",
      "description": "Triggers when a new support ticket is received in Zendesk.",
      "config": {
        "operation": "ticketCreated",
        "note": "Replace with a Webhook Trigger node if your helpdesk supports webhooks but does not have a native n8n node."
      }
    },
    {
      "id": "2",
      "name": "Extract Ticket Data",
      "type": "n8n-nodes-base.set",
      "description": "Extracts and formats the ticket subject, body and customer context for the AI.",
      "config": {
        "fields": {
          "subject": "{{ $json.subject }}",
          "message": "{{ $json.description }}",
          "customer_name": "{{ $json.requester.name }}",
          "ticket_id": "{{ $json.id }}",
          "plan_tier": "[ADD CUSTOMER PLAN FIELD IF AVAILABLE]"
        }
      }
    },
    {
      "id": "3",
      "name": "Claude — Draft Reply",
      "type": "n8n-nodes-base.anthropic",
      "description": "Sends the ticket content to Claude to generate a structured support reply draft.",
      "config": {
        "model": "claude-3-5-sonnet-20241022",
        "system_prompt": "Use the prompt from kairox.com/prompts/customer-support-reply-prompt. Add your product description and key policies in the 'Company and product context' section.",
        "user_message": "Subject: {{ $('Extract Ticket Data').item.json.subject }}\\n\\nCustomer message:\\n{{ $('Extract Ticket Data').item.json.message }}\\n\\nCustomer name: {{ $('Extract Ticket Data').item.json.customer_name }}",
        "max_tokens": 800
      }
    },
    {
      "id": "4",
      "name": "Zendesk — Create Internal Note",
      "type": "n8n-nodes-base.zendesk",
      "description": "Posts the AI-drafted reply as an internal note on the ticket for agent review.",
      "config": {
        "operation": "createTicketComment",
        "ticket_id": "{{ $('Extract Ticket Data').item.json.ticket_id }}",
        "body": "AI Draft Reply:\\n\\n{{ $json.content[0].text }}",
        "public": false,
        "note": "Set public: true only if you want the draft sent directly to the customer without agent review."
      }
    }
  ],
  "connections": [
    { "from": "1", "to": "2" },
    { "from": "2", "to": "3" },
    { "from": "3", "to": "4" }
  ],
  "setup_notes": [
    "Add your Zendesk API credentials in n8n before activating",
    "Add your Claude or OpenAI API key as a credential in n8n",
    "Paste your product description and support policies into node 3's system prompt",
    "Use the prompt from kairox.com/prompts/customer-support-reply-prompt as the base",
    "Start with internal notes (public: false) and review drafts before switching to direct replies",
    "Test with low-stakes tickets before enabling on high-priority or billing-related tickets"
  ],
  "limitations": [
    "This is a starter template — node configurations must be completed manually in n8n",
    "The AI draft is only as accurate as the product context you provide in the system prompt",
    "Agent review is strongly recommended before any auto-send configuration",
    "Does not include ticket routing, priority detection or escalation logic",
    "Replace the Zendesk nodes with appropriate nodes if using Intercom, Freshdesk or email"
  ]
}
