Automation library · Alerts and monitoring

Advanced Slackbot with Postgres

Started by another system calling it, and works across Postgres and Slack. 30 steps, 6 branches: large, and worth reading before you trust it with anything live.

Large

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

The flow

Starts it 2Logic 15Service 13

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

  1. 1Webhook to call for Slack commandWebhookStarts it
  2. 2Command workflow triggerExecute Workflow triggerStarts it
  3. 3REPLACE ME WITH TRIGGERSetLogic
  4. 4Set varsSetLogic
  5. 5Reply to user directlyHttp RequestService
  6. 6if has flagIfLogic
  7. 7Replying to threadSlackService
  8. 8Delete user here for examplePostgresService
  9. 9Set configSetLogic
  10. 10If matches env variableIfLogic
  11. 11Confirm user was deletedSlackService
  12. 12Validate webhook signatureCodeLogic
  13. 13Get user here for examplePostgresService
  14. 14Validate Slack tokenIfLogic
  15. 15Format data into nice structureCodeLogic
  16. 16Reply to user that command was receivedHttp RequestService
  17. 17parse commandCodeLogic
  18. 18Found userHttp RequestService
  19. 19if has workflowIfLogic
  20. 20if create threadIfLogic
  21. 21Handle other commandsSwitchLogic
  22. 22Start threadSlackService
  23. 23Alert user that thread was createdHttp RequestService
  24. 24Add thread infoMergeLogic
  25. 25Send debug urlHttp RequestService
  26. 26Execute target workflowExecute WorkflowLogic
  27. 27send helpHttp RequestService
  28. 28Unknown commandHttp RequestService
  29. 29Add debug infoSlackService
  30. 30Set thread infoSetLogic

How it's built

Starts on
Another system calling it
Steps
30, with 6 branches
Size
Large: read it before trusting it with anything live
Connects to
Postgres, Slack
Model
None. This is plumbing, not judgement

Questions

What does it need to run?

An n8n account, plus your own Postgres and Slack 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 30 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 30 steps before you point it at anything that matters.