Automation library · Money admin

Sync and validate invoices with KSeF 2.0

Started by a clock, and works across n8n data table. 27 steps, 2 branches, 3 loops or waits: 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
3Loops or waits
1Service it connects to

The flow

Starts it 2Logic 9Service 16

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

  1. 1Create TablesManual triggerStarts it
  2. 2Start Sync ScheduleSchedule triggerStarts it
  3. 3Split OutSplit OutLogic
  4. 4Get OrganizationsData TableService
  5. 5Get Table KSEF_ConfigData TableService
  6. 6Get table KSEF_Audit_LogData TableService
  7. 7Loop OrganizationsSplit In BatchesLogic
  8. 8IfIfLogic
  9. 9If1IfLogic
  10. 10Get Auth ChallengeHttp RequestService
  11. 11Create KSEF_ConfigData TableService
  12. 12Create KSEF_Audit_LogData TableService
  13. 13Get MF Public KeyHttp RequestService
  14. 14Write ConfigurationData TableService
  15. 15Encrypt KSeF TokenCodeLogic
  16. 16Init Session TokenHttp RequestService
  17. 17Wait for Session InitWaitLogic
  18. 18Check Session StatusHttp RequestService
  19. 19Redeem Session TokenHttp RequestService
  20. 20Fetch Invoice ListHttp RequestService
  21. 21Split Invoice ItemsCodeLogic
  22. 22Loop Over ItemsSplit In BatchesLogic
  23. 23Retrive XMLHttp RequestService
  24. 24Extract from FileExtract From FileService
  25. 25XMLXmlLogic
  26. 26Check WhiteListHttp RequestService
  27. 27Upsert row(s)Data TableService

How it's built

Starts on
A clock
Steps
27, with 2 branches, 3 loops or waits
Size
Large: read it before trusting it with anything live
Connects to
n8n data table
Model
None. This is plumbing, not judgement

Questions

What does it need to run?

An n8n account. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a clock.

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.