Skip to main content

🤖 Advanced Slackbot with n8n

Workflow preview

Workflow preview
100%
🤖 Advanced Slackbot with n8n preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

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 th...

Best for

  • DevOps automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.slack, n8n-nodes-base.httprequest, n8n-nodes-base.if, n8n-nodes-base.stickynote, n8n-nodes-base.set, n8n-nodes-base.executeworkflow, n8n-nodes-base.merge, n8n-nodes-base.switch

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Mutasem.

Original n8n.io source

1.1 Workflow description

Title
🤖 Advanced Slackbot with n8n
Workflow name
🤖 Advanced Slackbot with n8n

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 Slackbots. They handle a lot from running e2e tests for Github branch to deleting a user. By splitting the workflow into many subworkflows, we are able to handle each command seperately, making it easier to debug as well as support new usecases.

In this template, you can find eveything to setup your own Slackbot (and I made it simple, there's only one node to configure 😉). After that, you need to build your commands directly.

This bot can create a new thread on an alerts channel and respond there.

Or reply directly to the user.

It responds for help request to return a help page.

It automatically handles unknown commands.

It also supports flags and environment variables. For example /cloudbot-test info mutasem --full-info -e env=prod would give you the following info, when calling subworkflow.

How to setup

  1. Add Slack command and point it up to the webhook. For example.
  2. Add the following to the Set config node
  • alerts_channel with alerts channel to start threads on
  • instance_url with this instance url to make it easy to debug
  • slack_token with slack bot token to validate request
  • slack_secret_signature with slack secret signature to validate request
  • help_docs_url with help url to help users understand the commands
  1. Build other workflows to call and add them to commands in Set Config. Each command must be mapped to a workflow id with an Execute Workflow Trigger node
  2. Activate workflow 🚀

How to adjust

  1. Add your own commands.
  2. Depending on your need, you might need to lock down who can call this.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Start thread

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2

Block 2 - send help

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 1

Block 3 - Validate Slack token

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 4 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Reply to user that command was received

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 1

Block 6 - if has workflow

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 7 - Set config

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.3

Block 8 - Send debug url

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 2

Block 9 - if create thread

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 10 - Alert user that thread was created

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 2

Block 11 - Add debug info

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2

Block 12 - Execute target workflow

Type / Role
n8n-nodes-base.executeWorkflow - executeWorkflow
Config choices
Version 1

Block 13 - Add thread info

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 2

Block 14 - Handle other commands

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3

Block 15 - Set thread info

Type / Role
n8n-nodes-base.set - set
Config choices
Version 1

Block 16 - Unknown command

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 1

Block 17 - Set vars

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.3

Block 18 - Webhook to call for Slack command

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 1.1

Block 19 - Reply to user directly

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 2

Block 20 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Command workflow trigger

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1

Block 22 - if has flag

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 23 - If matches env variable

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 24 - Found user

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 2

Showing the first 24 of 34 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow 🤖 Advanced Slackbot with n8n
Complexity advanced
Nodes 34
Categories DevOps
Author Mutasem
Published 01 Mar 2024

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2157/2157.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does 🤖 Advanced Slackbot with n8n do?

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 th...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps use case.