Skip to main content

Secure GitHub webhooks with HMAC256 signature validation

Workflow preview

Workflow preview
100%
Secure GitHub webhooks with HMAC256 signature validation 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 cases Ensure that the calls to the workflow's webhook are (a) originating from the correct GitHub repository and (b) haven't been tampered with. How it works When a secret is provided in a GitH...

Best for

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

Tools used

n8n-nodes-base.respondtowebhook, n8n-nodes-base.webhook, n8n-nodes-base.crypto, n8n-nodes-base.if, n8n-nodes-base.stickynote, n8n-nodes-base.github, n8n-nodes-base.stopanderror

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Secure GitHub webhooks with HMAC256 signature validation
Workflow name
Secure GitHub webhooks with HMAC256 signature validation

Use cases

  • Ensure that the calls to the workflow's webhook are (a) originating from the correct GitHub repository and (b) haven't been tampered with.

How it works

  • When a secret is provided in a GitHub webhook configuration, a x-hub-signature-256 header is added to the webhook.
  • Compute HMAC256 computes the HMAC256 signature similarly to how it was computed by GitHub.
  • Validate HMAC256 tests for the equality of the computed value and the value provided by the header.
    • If the values are equal then 200 is returned to GitHub and the workflow continues
    • If the values are NOT equal then 401 is returned and the workflow ends.
    • Note: The Stop and Error step is optional and can be removed. Removing it means that the workflow completes successfully while still returning 401 to GitHub. This means that you will not be able to easily track malicious or incorrect calls to your webhook from n8n.

How to use

  • Add the steps (1) and (2) of the workflow to your current workflow receiving webhook calls from GitHub.
  • Update the Secret field in the Compute HMAC256 node with the same value as the secret stored in the Secret field in the GitHub webhook definition.

Requirements

  • GitHub account and repository.
  • GitHub webhook setup with a Secret key. Key can be of any length and should be generated with a key or password generator.

Who’s it for

Developers or DevOps engineers who want to ensure secure webhook communication between GitHub and n8n.

How to customize the workflow

  • This is a building block for your own workflow. If you use this workflow as a base, replace step (3) with your own business logic.
  • You can modify the Stop and Error node to log unauthorized requests or trigger alerts.

⚠️ Warning

The secret is stored in plain text in the workflow. You should take this into consideration if the workflow is committed to source control or shared in any other way.

Need Help?

Reach out on LinkedIn or Ask in the Forum!

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 - Respond 200 OK

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.4

Block 2 - Respond 401 Unauthorized

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.4

Block 3 - GitHub Webhook

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

Block 4 - Compute HMAC256

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

Block 5 - Validate HMAC256

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

Block 6 - Sticky Note6

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

Block 7 - Sticky Note

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

Block 8 - Sticky Note1

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

Block 9 - Get the profile of a repository

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

Block 10 - Stop and Error

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

Block 11 - Sticky Note7

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

3. Summary Table

Workflow Secure GitHub webhooks with HMAC256 signature validation
Complexity intermediate
Nodes 11
Categories DevOps
Author Yves Tkaczyk
Published 24 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8906/8906.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 Secure GitHub webhooks with HMAC256 signature validation do?

Use cases Ensure that the calls to the workflow's webhook are (a) originating from the correct GitHub repository and (b) haven't been tampered with. How it works When a secret is provided in a GitH...

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.