Templates / Create OPNsense firewall and NAT rules from Telegram with AI

Create OPNsense firewall and NAT rules from Telegram with AI

Needs changes

by Wetomate DevOps ✓ · 15 views · created 2026-08-26 · SecOps, AI Chatbot

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 64 nodes and runs when someone submits an n8n form (“Add allowed Telegram IDs”) (plus 2 other triggers). Along the way it connects Telegram and OpenAI Chat Model.

How it runs

Trigger: When someone submits an n8n form (“Add allowed Telegram IDs”) (plus 2 other triggers).

  1. Ensure Table Exists (Data table): create (table)
  2. Parse Delete IDs (Code): runs custom JavaScript code
  3. Set OPNsense host (Edit Fields (Set)): sets 1 field: opnsense_host
  4. Parse Add IDs (Code): runs custom JavaScript code
  5. Delete Allowed Users (Data table): delete rows
  6. Lookup In Allowlist (Data table): get
  7. Upsert Allowed Users (Data table): create or update
  8. Check Deleted Rows (If): checks a condition and branches into true / false
  9. Check Allowlist Status (If): checks a condition and branches into true / false
  10. Add IDs Success (n8n Form): shows the next form page

…plus 42 more steps. See the full node list below.

Services it uses

TelegramOpenAI Chat Model

Before you upgrade to n8n 3.0

1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:

  • AI Agent v1 (old agent modes) in AI Request Classifier (v1.9), AI NAT Interpreter (v1.9), AI Firewall Interpreter (v1.9)…: replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Removed in 3.0Replace with
AI Agent v1 (old agent modes)
AI Request Classifier (v1.9), AI NAT Interpreter (v1.9), AI Firewall Interpreter (v1.9), AI Security Audit (v1.9)
Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.

Nodes used (14)

From the author

Quick overview Create OPNsense firewall and destination NAT rules directly from Telegram using natural-language requests and AI-assisted rule interpretation. This workflow adds a controlled approval layer, allowing users to review proposed changes before…

Excerpt from Wetomate DevOps's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.