AutomationMart
Home/Browse/Secure AI agent webhook with HMAC, replay protection, and OpenAI GPT-5
n8n

Secure AI agent webhook with HMAC, replay protection, and OpenAI GPT-5

n8nn8n11 modulesv1.0
OpenAI

Disclaimer: > I am not a cybersecurity expert. This workflow was built through research and with the assistance of an LLM (Claude Opus 4.6). While it implements well-established security patterns (HMAC-SHA256, timing-safe comparison, replay protection, strict payload validation), please review the logic carefully and ensure it meets your own security requirements before deploying it in production. Who is this for? This template is for anyone exposing an n8n workflow via webhook and wanting

At a glance

Secure AI agent webhook with HMAC, replay protection, and OpenAI GPT-5 is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects OpenAI. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
OpenAI
Modules
11
Price
Free
Version
v1.0
Secure AI agent webhook with HMAC, replay protection, and OpenAI GPT-5 workflow diagram

About this workflow

Disclaimer: > I am not a cybersecurity expert. This workflow was built through research and with the assistance of an LLM (Claude Opus 4.6). While it implements well-established security patterns (HMAC-SHA256, timing-safe comparison, replay protection, strict payload validation), please review the logic carefully and ensure it meets your own security requirements before deploying it in production. Who is this for? This template is for anyone exposing an n8n workflow via webhook and wanting to ensure that only authenticated, untampered requests are processed. What problem does this solve? Public webhooks are vulnerable by default. Without proper verification, anyone who discovers your URL can send forged requests, replay old ones, or inject unexpected parameters. While n8n's built-in Webhook authentication modes (Basic Auth, Header Auth, JWT) verify who is calling, they don't verify that the payload hasn't been altered, that the request is fresh, or that the data structure matches what you expect. This template adds those missing layers: - Authentication — Verifies the sender's identity through HMAC-SHA256 signature validation - Integrity — Ensures the payload hasn't been modified by signing the raw body byte-for-byte - Replay protection — Rejects requests with expired timestamps (configurable, default: 5 minutes) - Payload sanitization — Strict whitelist filtering blocks unauthorized fields before they reach your logic What this workflow does The workflow chains six security layers before any business logic runs: 1. Webhook receives the request with Header Auth + Raw Body enabled to preserve the original payload 2. Extract rawBody (Code node) decodes the binary into a UTF-8 string and extracts the security headers 3. Crypto computes the HMAC-SHA256 signature of {timestamp}.{rawBody} using your HMAC secret 4. Timing-Safe HMAC Check (Code node) validates the timestamp freshness and compares signatures using crypto.timingSafeEqual() 5. Strict Payload Validation (Code node) parses the JSON, checks required fields, and rejects any unexpected keys 6. AI Agent processes the prompt only after all checks pass Invalid requests are immediately rejected with 403 Forbidden (signature/timestamp failure) or 400 Bad Request (payload validation failure), with no response body to avoid leaking internal logic. Example use case The included example protects an AI Agent endpoint that expects a simple {"prompt": "..."} payload. But this is just a starting point — replace the AI Agent with any node and adapt the payload validation to your own schema. Common adaptations: CRM or SaaS event callbacks CRUD operations on a database Third-party API integrations Setup Prerequisites - An n8n instance (Cloud or Self-hosted) - A shared HMAC secret between the sender and this workflow — keep it safe and never expose it in workflow logs or execution data Going further This workflow is a solid starting point — it's more secure than a raw exposed webhook. However, it focuses on application-level security (authentication, integrity, replay protection, payload sanitization). For a production-grade setup, consider adding layers at the infrastructure level : - Rate limiting - IP whitelisting - Reverse proxy hardening

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Digest new YouTube videos to Slack with Google Sheets, RapidAPI & GPT-4o-mini

Who is this for? Marketing, content, and enablement teams that need a quick, human-readable summary of every new video published by the YouTube channels they care about—without leaving Slack. What problem does this workflow solve? Manually checking multiple channels, skimming long videos, and pasting the highlights into Slack wastes time. This template automates the whole loop: detect a fresh upload from your selected channels → pull subtitles → distill the key take-aways with GPT-4o-mini → drop

Free

Extract trends, auto-generate social content with AI, Reddit, Google & post

Extract Trends and Auto-Generate Social Media Content with OpenAI, Reddit, and Google Trends: Approve and Post to Instagram, TikTok, and More --- Description What Problem Does This Solve? 🛠️ This workflow automates trend extraction and social media content creation for businesses and marketers. It eliminates manual trend research and content generation by fetching trends, scoring them with AI, and posting tailored content to multiple platforms. Target audience: Social media

Free

Generate student course schedules based on prerequisites with GPT and Google Sheets

Create a Fall 2025 course schedule for each student based on what they’ve already completed, catalog prerequisites, and term availability (Fall/Both). Reads students from Google Sheets → asks an AI agent to select exactly 5 courses (target 15–17 credits, no duplicates, prereqs enforced) → appends each student’s schedule to a schedule tab. --- 🧠 Summary - Trigger: Manual — “When clicking ‘Execute workflow’” - I/O: Google Sheets in → OpenAI decisioning → Google Shee

Free

Create a Telegram bot with Mistral Nemotron AI and conversation memory

Create a Telegram Bot with Mistral AI and Conversation Memory A sophisticated Telegram bot that provides AI-powered responses with conversation memory. This template demonstrates how to integrate any AI API service with Telegram, making it easy to swap between different AI providers like OpenAI, Anthropic, Google AI, or any other API-based AI model. 🔧 How it works The workflow creates an intelligent Telegram bot that: - 💬 Maintains conversation history for each user - 🧠 Provides contextual AI re

Free

Automated meeting recording & AI summaries with Google Calendar, Vexa & Llama 3.2

Transform your meetings into actionable insights automatically! This workflow captures meeting audio, transcribes conversations, generates AI summaries, and emails the results to participants—all without manual intervention. What's the Goal? - Auto-record meetings when they start and stop when they end - Transcribe audio to text using Vexa Bot integration - Generate intelligent summaries with AI-powered analysis - Email summaries to meeting participants automatically - Elim

Free

Monitor Facebook posts and send email notifications with ChatGPT integration

Monitor Facebook posts and send email alerts using OpenAI GPT-3. Automatically track updates and receive insights directly in your inbox.

Free

Automate ASMR glass fruit video creation & publishing with Veo, Shotstack & Postiz

Veo Machine Reels Factory — Full User Guide 🧭 Introduction The Veo Machine Reels Factory is an automated content creation system built in n8n that turns creative ideas into fully rendered ASMR-style glass fruit reels, ready to post on TikTok, YouTube Shorts, and Instagram Reels. This template connects multiple AI and automation services into a single, repeatable pipeline. It eliminates manual steps — from concept brainstorming to posting — allowing creators or marketing teams to produce viral sh

Free

Sync Linear issues to Todoist tasks automatically (create, update, close)

Try It Out! Sync your Linear issues to Todoist automatically with this n8n workflow. When an issue is created, updated, or completed in Linear, a corresponding task is created, updated, or closed in Todoist. --- ⚙️ How It Works - Triggered by issue changes via linearTrigger - Routes based on action (create, update, remove) - Checks if a matching Todoist task already exists (via issue ID) - If the issue has: - A due date - And is assigned to you (youremail@example.com) ➤ Then it creates or up

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free