You are helping me build the following AI agent workflow. ## Goal WHMCS Support Ticket Creation: Receives chat queries via webhook, uses Gemini to extract details, validates the department against WHMCS. ## Specification - What it does: You get instant support ticket creation when customers send queries via webhook, as the agent uses Google Gemini to extract key details like name, email, issue description, and priority. It automatically validates your department against WHMCS data and generates structured tickets in the system without manual entry. - Trigger: Triggered by an event (Event ยท on customer chat message) - Autonomy: Fully hands-off - Expected setup effort: about an afternoon - Tools/services involved: - n8n: Workflow orchestration platform - Google Gemini Chat Model: Natural language processing and information extraction - WHMCS API: Creating support tickets and fetching departments ## Known pitfalls, handle each one explicitly in your implementation 1. Webhook payloads might contain HTML or special characters that break JSON parsing, so sanitize input strings in n8n before passing them to the AI model. 2. Session memory can cause context overflow with long conversations, so implement a token limit check or truncate history in n8n to prevent API errors. ## Reference implementation https://n8n.io/workflows/7960 (workflow template) Fetch and inspect this before building. If it matches my stack, adapt it; if not, rebuild the pattern with my tools. ## Process requirements 1. Before building: ask me which of the listed tools I actually use and what my platform is (n8n / Make / code / other). Do not assume. 2. Adapt the pattern to my answers; do not force the reference stack. 3. Address every pitfall above; tell me how you handled each. 4. Provide a test plan I can run before letting this touch real data. 5. Ask before any step that sends messages, modifies data, or spends money. Source: https://usecasesforagents.com/use-case/automate-whmcs-support-ticket-creation/ via usecasesforagents.com