Mine pharma complaint trends and trigger CAPA alerts with Claude and Slack
Needs changesWhat this workflow does
This AI workflow has 19 nodes and runs on a schedule (every day) (plus 1 other trigger). Along the way it connects Anthropic Chat Model and Slack.
How it runs
Trigger: On a schedule (every day) (plus 1 other trigger).
- Set - Config (Edit Fields (Set)): sets 8 fields: complaintSourceApiUrl, capaTicketingApiUrl, trendLogApiUrl…
- HTTP - Fetch New Complaints (HTTP Request): calls an HTTP API
- JS - Normalize Complaint Records (Code): runs custom JavaScript code
- If: checks a condition and branches into true / false
- JS - Fan Out Complaints for Extraction (Code): runs custom JavaScript code
- AI Agent: runs an AI agent, with model: Anthropic - Complaint Extraction Model
- JS - Parse Extracted Fields (Code): runs custom JavaScript code
- JS - Cluster by Product & Defect Category (Code): runs custom JavaScript code
- JS - Compare Clusters Against Rolling Baseline (Code): runs custom JavaScript code
- JS - Fan Out Clusters for Routing (Code): runs custom JavaScript code
…plus 5 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in AI Agent - Extract Structured Complaint Fields (v1.6): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Agent - Extract Structured Complaint Fields (v1.6) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (12)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Manual Trigger
n8n-nodes-base.manualTrigger - Edit Fields (Set)
n8n-nodes-base.set - HTTP Request
n8n-nodes-base.httpRequest - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - No Operation, do nothing
n8n-nodes-base.noOp - AI Agent
@n8n/n8n-nodes-langchain.agent - Anthropic Chat Model
@n8n/n8n-nodes-langchain.lmChatAnthropic - Switch
n8n-nodes-base.switch - Slack
n8n-nodes-base.slack - Merge
n8n-nodes-base.merge
From the author
Quick overview This workflow polls a complaint-source API on a schedule, uses Anthropic Claude to extract structured defect signals from complaint narratives, clusters complaints by product and defect category, detects statistically unusual spikes against a…