Log AI agent runs in hash-chained receipts with OpenAI and Data Tables
Ready for 3.0What this workflow does
This AI workflow has 39 nodes and runs when an HTTP POST request hits its webhook URL (plus 2 other triggers). Along the way it connects OpenAI Chat Model.
How it runs
Trigger: When an HTTP POST request hits its webhook URL (plus 2 other triggers).
- Settings (Edit Fields (Set)): sets 12 fields: model, system_message, max_output_tokens…
- Daily check settings (Edit Fields (Set)): sets 4 fields: owner_email, sender_email, email_when_intact…
- Load the client's chain (Data table): get
- Validate request (Code): runs custom JavaScript code
- Load the whole log (Data table): get
- Load the client's anchors (Data table): get
- Route the request (Switch): routes items into 3 branches
- Load saved anchors (Data table): get
- Verify the chain (Code): runs custom JavaScript code
- Client AI agent (AI Agent): runs an AI agent, with model: Chat model; 1 tool (Calculator)
…plus 24 more steps. See the full node list below.
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.
Nodes used (13)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - Switch
n8n-nodes-base.switch - Respond to Webhook
n8n-nodes-base.respondToWebhook - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Calculator
@n8n/n8n-nodes-langchain.toolCalculator - Data table
n8n-nodes-base.dataTable - If
n8n-nodes-base.if - Wait
n8n-nodes-base.wait - Send Email
n8n-nodes-base.emailSend - Schedule Trigger
n8n-nodes-base.scheduleTrigger
From the author
Quick overview This workflow exposes webhook endpoints to run an OpenAI-powered agent per client, log each run into an n8n Data Table as a SHA-256 hash chain, and email daily integrity reports and anchors, with an additional verification endpoint clients can…