Skip to main content

Slack webhook - verify signature

Workflow preview

Workflow preview
100%
Slack webhook - verify signature preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Description This template will help you verify that incoming calls from a Slack webhook actually come from Slack and not some unknown third party services. It is mainly used to prevent attacks from...

Best for

  • SecOps automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.code, n8n-nodes-base.crypto, n8n-nodes-base.if, n8n-nodes-base.stopanderror, n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.stickynote, n8n-nodes-base.set, n8n-nodes-base.merge

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Slack webhook - verify signature
Workflow name
Slack webhook - verify signature

Description

This template will help you verify that incoming calls from a Slack webhook actually come from Slack and not some unknown third-party services. It is mainly used to prevent attacks from malicious bots or individuals. This is a Sub-Workflow, so it should be used inside the main workflow that contains the webhook listening for Slack requests.

How to Use

What to Edit

You should set the Slack Signing Secret that you can find on your Slack App dashboard in the general tab. It should be located under the following URL:

https://api.slack.com/apps/[SLACK_APP_ID]/general

Input

The input should be the received Slack request. This workflow should then be placed directly after the Slack Webhook.

Outputs

Success Output

If the signature was verified successfully, we return a key verified_signature set to true along with data from the Slack request itself.

Error Output

When the signature could not be verified, we raise an error. You can handle this case in your main workflow by using an Error Workflow or by changing your node settings and choosing some actions in case of an error.

Changelog

Version 1.0.1 (2023-12-11)

  • Changed replace by replaceAll in JS code in case of several arguments.
  • Added some custom replacements that encodeURIComponent does not take into account

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 - Make Slack Verif Token

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

Block 2 - Encode Secret String

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

Block 3 - IF

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

Block 4 - Stop and Error

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

Block 5 - Execute Workflow Trigger

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

Block 6 - Sticky Note

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

Block 7 - Set Verified to True

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

Block 8 - Merge

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

Block 9 - Sticky Note1

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

Block 10 - Sticky Note2

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

Block 11 - Sticky Note3

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

Block 12 - Sticky Note4

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

3. Summary Table

Workflow Slack webhook - verify signature
Complexity intermediate
Nodes 12
Categories SecOps
Author Henri
Published 09 Dec 2023

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2009/2009.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 Slack webhook - verify signature do?

Description This template will help you verify that incoming calls from a Slack webhook actually come from Slack and not some unknown third party services. It is mainly used to prevent attacks from...

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 SecOps use case.