# Stale Approvals: Re-Check the Draft Before You Execute It

> Source: <https://dev.to/ujjwal_dubey_9/stale-approvals-re-check-the-draft-before-you-execute-it-1g0>
> Published: 2026-10-25 11:04:15+00:00

A reviewer approves an AI-drafted refund at 4 pm. The workflow executes it at 4:05. Between those times, the customer wrote "never mind, found it." Who is right? This is the stale approval problem, and it shows up in almost every [human-in-the-loop approval step in an AI workflow](https://www.nxflowai.com/blog/custom-ai-vs-off-the-shelf-chatbots) once volume grows.

Approve a specific snapshot, not "the refund for customer X."

``` python
import hashlib, json

def fingerprint(action, context):
    payload = {"action": action, "last_msg_id": context["last_msg_id"],
               "order_status": context["order_status"], "amount": action.get("amount")}
    return hashlib.sha256(json.dumps(payload, sort_keys=True).encode()).hexdigest()

def request_approval(store, action, context):
    fp = fingerprint(action, context)
    store.save(action_id=action["id"], fingerprint=fp, status="pending")
    return fp
python
def execute_if_still_valid(store, action, load_context, run):
    record = store.get(action["id"])
    if record.status != "approved":
        return "not_approved"
    if fingerprint(action, load_context(action)) != record.fingerprint:
        store.update(action["id"], status="needs_review")
        return "stale_back_to_reviewer"
    run(action, idempotency_key=action["id"])
    store.update(action["id"], status="done")
    return "done"
```

We write about scoping these decisions in our guide to auditing a workflow first.
