You are helping me build the following AI agent workflow. ## Goal Research & Report Builder: Submit a topic via webhook to trigger an automated research workflow that refines the scope, gathers data from Tavily. ## Specification - What it does: Submit a topic via webhook to instantly trigger an automated research workflow that clarifies your scope, gathers data from Tavily, and delivers a structured Markdown report directly into your Notion database. You get a comprehensive, ready-to-use summary without manually searching or compiling sources yourself. - Trigger: Triggered by an event (Manual ยท on webhook request) - Autonomy: Fully hands-off - Expected setup effort: about an afternoon - Tools/services involved: - n8n: Workflow orchestration platform - Tavily Search API: Web search and content extraction - Notion: Storing final research reports - OpenRouter Chat Model: AI agent reasoning and report generation ## Known pitfalls, handle each one explicitly in your implementation 1. Tavily API calls can fail if the topic is too broad so add error handling to retry with refined keywords. 2. LLM output formatting might break Markdown parsing so validate the structure before sending it to Notion. 3. Webhook payloads can be malformed by external clients so add validation logic to reject invalid JSON inputs. ## Reference implementation https://n8n.io/workflows/7160 (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/automated-research-report-builder/ via usecasesforagents.com