You are helping me build the following AI agent workflow. ## Goal Intercom Support Bot with Discord Thread Logging: Connects Intercom support chats to an AI agent that replies automatically while logging every message in a dedicated Discord thread for... ## Specification - What it does: Automates customer support by connecting Intercom chat to an AI agent that replies to user inquiries. It creates a dedicated Discord thread for every new conversation, logging all messages from users, the AI, and human agents for full transparency. Support staff can manually pause or resume AI responses via a star icon in the Intercom interface without code changes. - Trigger: Triggered by an event (Event ยท on new Intercom conversation) - Autonomy: Fully hands-off - Expected setup effort: about an afternoon - Tools/services involved: - Intercom: Customer support chat and webhook trigger - Discord: Logging conversation threads in real time - OpenAI Chat Model: Generating AI responses for support queries - n8n: Orchestrating the workflow and API connections ## Known pitfalls, handle each one explicitly in your implementation 1. OpenAI token costs can spiral with verbose logs, implement a message truncation strategy that keeps only the last N exchanges before sending to the model. 2. Thread naming collisions occur if multiple users join simultaneously, use unique conversation IDs in the Discord thread title instead of generic names. ## Reference implementation https://n8n.io/workflows/3558 (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/intercom-support-bot-with-discord-thread-logging/ via usecasesforagents.com