Skip to product information

n8n Log AI Agent Runs with Hash-Chained Receipts & OpenAI

n8n Log AI Agent Runs with Hash-Chained Receipts & OpenAI

 (200+Reviews)
Regular price £36.99
Regular price £36.99 Sale price
SAVE Sold out
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
🔥
128+ Sold
Popular with n8n builders
⚡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
n8n Log AI Agent Runs with Hash-Chained Receipts & OpenAI

n8n Log AI Agent Runs with Hash-Chained Receipts & OpenAI

Regular price £36.99
Regular price £36.99 Sale price
SAVE Sold out

Run an OpenAI AI agent with tamper-evident logging—every request gets a hash-chained receipt

This n8n workflow exposes secure webhook endpoints that run an OpenAI-powered agent per client, then records each run into an n8n Data Table using a SHA-256 hash chain. It also generates daily integrity reports and anchors and provides a verification endpoint for clients.

What this workflow does

  • Receives webhook runs via POST with client_id and prompt, validating client and prompt rules and rejecting invalid requests immediately.
  • Executes a LangChain AI agent using OpenAI Chat (with an optional Calculator tool) to produce an answer or capture an agent failure.
  • Creates a logged receipt by hashing the prompt and answer (optionally storing clipped text), counting model/tool calls, and tagging the outcome as ok, refused, or error.
  • Appends a new hash-chained entry into the agent_run_log table by linking to the latest entry’s hash, computing the next entry_hash, and confirming canonical sequence (with short backoff retries on collisions).
  • Returns the result with integrity proof including seq and entry_hash. If reliable logging fails, it withholds the agent output and returns HTTP 503.
  • Notifies the owner and verifies daily: a scheduled run recomputes and verifies all clients’ hash chains in agent_run_log, stores anchors in agent_run_anchors, and emails a report (or failure notice).

Use cases

  • SaaS operators needing auditable AI responses for compliance and dispute resolution.
  • Automation engineers implementing tamper-evident agent logs for multi-tenant n8n apps.
  • Teams that want client-accessible verification of each run via a dedicated endpoint.

Technical details

  • n8n nodes/tools: webhook, if, set, code, wait, switch
  • AI stack: LangChain AI agent with OpenAI Chat and optional Calculator tool
  • Storage: agent_run_log and agent_run_anchors n8n Data Tables
  • Integrity: SHA-256 hash chaining, sequence verification, daily recomputation/anchoring
View full details