LeadFlow
n8n · approval gate · reproducible

A stale approval cannot publish

A reviewer approves a revision. The editor then changes the text. The gate compares the content fingerprint, finds it no longer matches what was approved, and blocks publication - with no human in the loop and no way to slip the edited version through on the old approval.

Put this gate on your own site - $49, working within 24 hours

You send one case: a page, the revision that gets approved, and what an editor changes afterwards. I deliver the importable n8n workflow wired to your CMS (WordPress, Webflow, Shopify or a plain webhook), the same BLOCKED/PUBLISHED responses you see below, and a one-page runbook. If it does not block your case, you do not pay.

Start the $49 build - PayPal or send the case first

Agencies: $450 per workflow as white-label capacity, 72 hours from spec, your client never hears my name. Same PayPal rail.

Prefer to install it yourself? The same rule ships as a free GPL WordPress plugin - no account, no key, no upsell inside it: Stale Approval Gate 1.0.0 (zip, 5 KB).

Try it yourself: approve, then edit

This widget runs the same FNV-1a fingerprint that the workflow's Code nodes use, in your browser. Nothing is sent anywhere. Approve the caption, then change one word and press Publish.

No revision approved yet. Press "Approve this revision".
waiting for a decision

Whitespace counts: adding a trailing space is enough to make the old approval stale. That is intentional - the fingerprint is over the exact text, not over "someone said yes at some point".

A recorded run: the same page, driven step by step

This is the widget above, clicked through in a real browser and captured frame by frame - approve, edit one word, publish, get blocked, re-approve, publish. Captions name the step and the fingerprint at each stage. No video editor was used: six screenshots of the live page, stitched into one animation.

Six-frame recording: approve, edit, publish blocked, re-approve, publish allowed

  1. Start - nothing approved. Both buttons are live; pressing Publish here does nothing a human would call a decision.
  2. Approve - revision 1 is fingerprinted 3fbd1432. The approval records that fingerprint, not a yes/no flag.
  3. Edit - the headline gains the single word "today". The text now hashes to 87364197, and the page says so before anyone presses Publish.
  4. Publish on the old approval - {"decision":"BLOCKED","reason":"content changed after approval - approval is stale","approved_hash":"3fbd1432","current_hash":"87364197"}. The old approval cannot carry new text.
  5. Re-approve - the reviewer approves the edited text; the stored fingerprint becomes 87364197.
  6. Publish - {"decision":"PUBLISHED","reason":"hash matches the approved revision"}. The gate is not anti-publish; it is anti-stale-approval.

Both stills, full size: the blocked attempt and the allowed one. The same gate runs as a real n8n workflow (05d - Approval gate, active) whose webhook returns the identical BLOCKED payload - see the section below for the verbatim response.

The run, verbatim

{"decision":"BLOCKED","reason":"content changed after approval - approval is stale","approved_hash":"3fbd1432","current_hash":"c953f47d","alert":"slack/email alert would fire here"}

Approved fingerprint 3fbd1432. After the edit the content hashed to c953f47d. The publish branch refused.

Why it is content-hash based, not a boolean

The workflow

Import this JSON into any n8n instance: webhook → revision v1 → approve → edit after approval → hash comparison → publish / block.

{
 "name": "05d - Approval gate (live demo)",
 "nodes": [
  {
   "parameters": {
    "httpMethod": "POST",
    "path": "approval-gate-demo",
    "responseMode": "lastNode",
    "options": {}
   },
   "name": "Webhook",
   "type": "n8n-nodes-base.webhook",
   "typeVersion": 2,
   "position": [
    -420,
    300
   ],
   "webhookId": "approval-gate-demo"
  },
  {
   "parameters": {
    "jsCode": "function h(s){let x=2166136261;for(let i=0;i<s.length;i++){x^=s.charCodeAt(i);x=Math.imul(x,16777619);}return (x>>>0).toString(16).padStart(8,'0');}\nconst content='Hero headline: Turn messy lead lists into a clean pipeline';\nreturn [{json:{revision:1,content,hash:h(content),status:'draft'}}];"
   },
   "name": "Revision v1 (draft)",
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "position": [
    -200,
    300
   ]
  },
  {
   "parameters": {
    "jsCode": "// Reviewer approves exactly this version, storing the hash they approved\nconst r = $input.first().json;\nreturn [{ json: { ...r, approved_hash: r.hash, approved_at: new Date().toISOString(), status: 'approved' } }];"
   },
   "name": "Approve v1",
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "position": [
    20,
    300
   ]
  },
  {
   "parameters": {
    "jsCode": "function h(s){let x=2166136261;for(let i=0;i<s.length;i++){x^=s.charCodeAt(i);x=Math.imul(x,16777619);}return (x>>>0).toString(16).padStart(8,'0');}\nconst r=$input.first().json;\nconst edited='Hero headline: Turn ANY messy lead list into revenue';\nreturn [{json:{...r,revision:2,content:edited,hash:h(edited),status:'edited'}}];"
   },
   "name": "Edit after approval",
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "position": [
    240,
    300
   ]
  },
  {
   "parameters": {
    "conditions": {
     "options": {
      "caseSensitive": true,
      "version": 2
     },
     "conditions": [
      {
       "leftValue": "={{ $json.hash }}",
       "rightValue": "={{ $json.approved_hash }}",
       "operator": {
        "type": "string",
        "operation": "equals"
       }
      }
     ],
     "combinator": "and"
    },
    "options": {}
   },
   "name": "Is approval still valid?",
   "type": "n8n-nodes-base.if",
   "typeVersion": 2,
   "position": [
    460,
    300
   ]
  },
  {
   "parameters": {
    "jsCode": "return [{ json: { decision: 'PUBLISHED', reason: 'hash matches the approved revision', revision: $json.revision } }];"
   },
   "name": "Publish",
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "position": [
    700,
    200
   ]
  },
  {
   "parameters": {
    "jsCode": "// The guard: a stale approval can never publish\nreturn [{ json: { decision: 'BLOCKED', reason: 'content changed after approval - approval is stale', approved_hash: $json.approved_hash, current_hash: $json.hash, alert: 'slack/email alert would fire here' } }];"
   },
   "name": "Block publication",
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "position": [
    700,
    400
   ]
  }
 ],
 "connections": {
  "Revision v1 (draft)": {
   "main": [
    [
     {
      "node": "Approve v1",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Approve v1": {
   "main": [
    [
     {
      "node": "Edit after approval",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Edit after approval": {
   "main": [
    [
     {
      "node": "Is approval still valid?",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Is approval still valid?": {
   "main": [
    [
     {
      "node": "Publish",
      "type": "main",
      "index": 0
     }
    ],
    [
     {
      "node": "Block publication",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Webhook": {
   "main": [
    [
     {
      "node": "Revision v1 (draft)",
      "type": "main",
      "index": 0
     }
    ]
   ]
  }
 },
 "settings": {}
}

Built and executed on a self-hosted n8n instance. Webhook: POST /webhook/approval-gate-demo.