Secure AI agent webhook with HMAC, replay protection, and OpenAI GPT-5
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-12-01.
What this workflow does
This AI workflow has 11 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects OpenAI Chat Model.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Extract rawBody (Code): runs custom JavaScript code
- Crypto: hashes or encrypts values
- Timing-Safe HMAC Check (Code): runs custom JavaScript code
- If: checks a condition and branches into true / false
- Strict Payload Validation (Code): runs custom JavaScript code
- Response to webhook : Forbidden (Respond to Webhook): sends the response back to the webhook caller
- If: checks a condition and branches into true / false
- AI Agent: runs an AI agent, with model: OpenAI Chat Model
- Bad Request (Respond to Webhook): sends the response back to the webhook caller
Services it uses
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.
Check at runtime on n8n 3.0
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (7)
- If
n8n-nodes-base.if - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Respond to Webhook
n8n-nodes-base.respondToWebhook - Code
n8n-nodes-base.code - Crypto
n8n-nodes-base.crypto - Webhook
n8n-nodes-base.webhook
From the author
⚠️ 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,…