Automation library · Customer support

Mine pharma complaint trends and trigger CAPA alerts

Started by a clock, and works across Slack. It hands the judgement calls to Claude. 19 steps, 2 branches: a working afternoon to understand properly.

MediumCalls a model: Claude

19 stepsMedium: a working afternoon
2Branches: places the flow splits
0Loops or waits
1Service it connects to

The flow

Starts it 2Model 2Logic 11Service 4

The steps in the order they run, from what starts it.

  1. 1Schedule Trigger - Poll Complaint SourceSchedule triggerStarts it
  2. 2Manual Trigger - Test RunManual triggerStarts it
  3. 3Anthropic - Complaint Extraction ModelLm Chat AnthropicModel
  4. 4Set - ConfigSetLogic
  5. 5AI Agent - Extract Structured Complaint FieldsAgentModel
  6. 6HTTP - Fetch New ComplaintsHttp RequestService
  7. 7JS - Parse Extracted FieldsCodeLogic
  8. 8JS - Normalize Complaint RecordsCodeLogic
  9. 9JS - Cluster by Product & Defect CategoryCodeLogic
  10. 10IF - New Complaints Found?IfLogic
  11. 11JS - Compare Clusters Against Rolling BaselineCodeLogic
  12. 12JS - Fan Out Complaints for ExtractionCodeLogic
  13. 13No Action - End CycleNo OpLogic
  14. 14JS - Fan Out Clusters for RoutingCodeLogic
  15. 15Switch - Route by Statistical AnomalySwitchLogic
  16. 16HTTP - Create CAPA Quality EscalationHttp RequestService
  17. 17Merge - Combine Escalation & Routine PathsMergeLogic
  18. 18Slack - Alert Quality Team (Cluster Escalation)SlackService
  19. 19HTTP - Log Cluster to Trend StoreHttp RequestService

How it's built

Starts on
A clock
Steps
19, with 2 branches
Size
Medium: a working afternoon
Connects to
Slack
Model
Claude

Questions

What does it need to run?

An n8n account, plus your own Slack account, and a key for Claude. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a clock.

Does it use AI?

Yes. It calls Claude. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Plan an afternoon. 19 steps is enough that you should read each one before running it.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

Before you run it

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 19 steps before you point it at anything that matters.