You are helping me build the following AI agent workflow. ## Goal AliExpress Affiliate Product Finder: Users send natural language product requests via Telegram and receive two AI-selected recommendations with images, prices. ## Specification - What it does: This Telegram bot allows users to find AliExpress products using natural language commands. It validates user membership, optimizes search queries via OpenAI, scrapes product data using Decodo, and selects the best options based on ratings and price. Finally, it generates affiliate tracking links and sends formatted recommendations with images and prices directly in the chat. - Trigger: Triggered by an event (Manual ยท on user message) - Autonomy: Fully hands-off - Expected setup effort: under an hour - Tools/services involved: - Telegram: User interaction and bot interface - OpenAI: Search query optimization and product analysis - Decodo: Scraping AliExpress product listings - AliExpress Affiliate API: Generating affiliate tracking links ## Known pitfalls, handle each one explicitly in your implementation 1. Decodo scraping can fail if AliExpress changes its DOM structure so add robust error handling and fallback selectors for common layout shifts. 2. OpenAI API costs can spiral with high traffic so implement input caching to avoid re-processing identical user queries within a short time window. 3. Affiliate link generation may return expired or invalid URLs if the product goes out of stock so verify link validity before sending them to users. 4. Telegram message length limits can truncate long product descriptions so ensure your formatting logic caps text content and uses collapsible details where possible. ## Reference implementation https://n8n.io/workflows/12437 (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/aliexpress-affiliate-product-finder-bot/ via usecasesforagents.com