🤖 Advanced Slackbot with n8n
Ready for 3.0What this workflow does
This workflow has 30 nodes and runs when an HTTP POST request hits its webhook URL (plus 1 other trigger). Along the way it connects Slack and Postgres.
How it runs
Trigger: When an HTTP POST request hits its webhook URL (plus 1 other trigger).
- Set vars (Edit Fields (Set)): sets 5 fields: command_text, user, response_url…
- Reply to user directly (HTTP Request): calls an HTTP API
- If: checks a condition and branches into true / false
- Set config (Edit Fields (Set)): sets 6 fields: commands, alerts_channel, instance_url…
- If: checks a condition and branches into true / false
- Validate webhook signature (Code): runs custom JavaScript code
- Get user here for example (Postgres): select
- Validate Slack token (If): checks a condition and branches into true / false
- Format data into nice structure (Code): runs custom JavaScript code
- Reply to user that command was received (HTTP Request): calls an HTTP API
…plus 18 more steps. See the full node list below.
Services it uses
Other PostgreSQL + Slack templates (109)
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (11)
- Slack
n8n-nodes-base.slack - HTTP Request
n8n-nodes-base.httpRequest - If
n8n-nodes-base.if - Edit Fields (Set)
n8n-nodes-base.set - Execute Sub-workflow
n8n-nodes-base.executeWorkflow - Merge
n8n-nodes-base.merge - Switch
n8n-nodes-base.switch - Webhook
n8n-nodes-base.webhook - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Code
n8n-nodes-base.code - Postgres
n8n-nodes-base.postgres
From the author
Use case Slackbots are super powerful. At n8n, we have been using them to get a lot done.. But it can become hard to manage and maintain many different operations that a workflow can do. This is the base workflow we use for our most powerful internal…