Automation library · Documents and files

Advanced document approval for Microsoft 365 with MySQL

Started by another system calling it, and works across Email and MySQL. 27 steps, 2 branches: large, and worth reading before you trust it with anything live.

Large

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

The flow

Starts it 3Logic 8Service 16

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

  1. 1Webhook - SharePoint (file created)WebhookStarts it
  2. 2Webhook - ApproveWebhookStarts it
  3. 3Webhook - RejectWebhookStarts it
  4. 4Set Document FieldsSetLogic
  5. 5Parse Approve QueryFunctionLogic
  6. 6Parse Reject QueryFunctionLogic
  7. 7Get Approval Matrix (MySQL)My SqlService
  8. 8Insert Workflow Start History (MySQL)My SqlService
  9. 9Insert Approve Log (MySQL)My SqlService
  10. 10Insert Reject Log (MySQL)My SqlService
  11. 11Approvers Exist?IfLogic
  12. 12Get Next Approver (MySQL)My SqlService
  13. 13Final Update Log (MySQL)My SqlService
  14. 14Move File to Rejected (SharePoint via Graph)Http RequestService
  15. 15Update Log Rejected (MySQL)My SqlService
  16. 16Notify HR - RejectedEmail SendService
  17. 17Prepare Approver ListFunctionLogic
  18. 18Move File to Approved (SharePoint via Graph)Http RequestService
  19. 19Create ClickUp Task - ApprovedHttp RequestService
  20. 20Notify HR - ApprovedEmail SendService
  21. 21Has Next Approver?IfLogic
  22. 22Set First Approver InfoSetLogic
  23. 23Prepare Next Approver InfoFunctionLogic
  24. 24Send Email to Approver (Level 1)Email SendService
  25. 25Insert Approval Request LogMy SqlService
  26. 26Send Email to Next ApproverEmail SendService
  27. 27Get Approval Logs (MySQL)My SqlService

How it's built

Starts on
Another system calling it
Steps
27, with 2 branches
Size
Large: read it before trusting it with anything live
Connects to
Email, MySQL
Model
None. This is plumbing, not judgement

Questions

What does it need to run?

An n8n account, plus your own Email and MySQL accounts. 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?

No. Every step is fixed logic or a call to a service, so it does the same thing every time.

How long does it take to set up?

Take your time. At 27 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 27 steps before you point it at anything that matters.