Automation library · Documents and files

Extract and classify legal documents with Claude

Started by another system calling it, and works across Email, Google Sheets and Slack. It hands the judgement calls to Claude. 31 steps, 6 branches: large, and worth reading before you trust it with anything live.

LargeCalls a model: Claude

31 stepsLarge: read it before trusting it with anything live
6Branches: places the flow splits
0Loops or waits
3Services it connects to

The flow

Starts it 5Model 2Logic 16Service 8

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

  1. 1Receive DocumentWebhookStarts it
  2. 2Anthropic Chat ModelLm Chat AnthropicModel
  3. 3Workflow Error TriggerError triggerStarts it
  4. 4Workflow Config (model + settings)SetLogic
  5. 5Basic LLM ChainChain LlmModel
  6. 6Slack: Pipeline ErrorSlackService
  7. 7Validate PayloadCodeLogic
  8. 8Parse Claude ResponseCodeLogic
  9. 9Deduplication CheckCodeLogic
  10. 10Risk Level: HIGH?IfLogic
  11. 11High Token Usage?IfLogic
  12. 12Is Duplicate?IfLogic
  13. 13Snapshot Parsed ResultSetLogic
  14. 14Log to Google SheetsGoogle SheetsService
  15. 15Slack: High Token AlertSlackService
  16. 16Respond 200 DuplicateRespond To WebhookStarts it
  17. 17Is Valid?IfLogic
  18. 18Email: High Risk AlertEmail SendService
  19. 19Callback URL GuardCodeLogic
  20. 20Respond 202 AcceptedRespond To WebhookStarts it
  21. 21Respond 400 Bad RequestRespond To WebhookStarts it
  22. 22Slack: High Risk AlertSlackService
  23. 23Has Callback URL?IfLogic
  24. 24Has URL?IfLogic
  25. 25Send CallbackHttp RequestService
  26. 26SSRF URL GuardCodeLogic
  27. 27Use Provided TextSetLogic
  28. 28Download DocumentHttp RequestService
  29. 29Prepare Claude PromptCodeLogic
  30. 30Check File SizeCodeLogic
  31. 31Extract From FileExtract From FileService

How it's built

Starts on
Another system calling it
Steps
31, with 6 branches
Size
Large: read it before trusting it with anything live
Connects to
Email, Google Sheets, Slack
Model
Claude

Questions

What does it need to run?

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

What starts it?

It starts on another system calling it.

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?

Take your time. At 31 steps it is large: read it before trusting it with anything live.

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 31 steps before you point it at anything that matters.