Introduction
Introduction
Two files can share a name while making different promises. A version check should establish which reviewed attachment is being handed over and where it belongs.
Use the worksheet below to make those expectations explicit, with a fictional workshop brief and clearly bounded local test results.
A filename is a label, not a version check
Imagine a fictional workshop brief saved twice as brief.txt. The earlier version offers eight seats; the approved revision offers five. A handoff that checks only the filename can pick the earlier bytes without noticing. Sorting by a recent timestamp is not an approval record either.
Before a handoff, compare the candidate with a trusted record of the approved file, then check the destination separately. Keep an explicit stop result when information is missing. Do not turn “the file exists” into “the right file was delivered.” This guide provides a small review worksheet and an offline teaching example, not a ready-made production integration.
Build one attachment record before approving it
Use one row per attachment. Give the asset a stable identifier so the filename can change without silently becoming a different deliverable. Record a revision label meaningful to the people reviewing it. The expected digest must be calculated from the bytes that were actually reviewed, rather than copied from the incoming candidate at handoff time.
Keep the approval tied to the asset, revision and digest. In a real process, deciding who may approve or replace that record is a separate access-control problem. Our demonstrator assumes the expected record and approval are already trustworthy. If an incoming request can replace both, comparison alone cannot provide trust.
Original worksheet: complete from the reviewed attachment, not the incoming filename alone.
| Field | Fictional example | What it checks |
|---|---|---|
| Asset ID | demo-brief | Which deliverable this is |
| Revision | v2 | Which reviewed revision is intended |
| Expected filename | brief.txt | The naming convention chosen for this handoff |
| Approved SHA256 | Digest computed from reviewed bytes | Whether candidate bytes match the approved bytes |
| Destination | demo-review-folder | The intended destination identifier |
| Approval | Approved asset/revision/digest record | Whether this exact revision has an approval record |
| Delivery evidence | Unresolved until checked | Whether the destination actually contains the intended artifact |
When an approved brief changes before delivery
Suppose the five-seat workshop brief, v2, is approved and waiting to go out. The editor then cuts capacity to four. A copy of v2 can still match its recorded digest byte for byte. The decision that changed is which revision the editor wants delivered.
In this fictional handoff, mark the v2 approval “withdrawn before delivery” and pause the queued send. Keep its approval and withdrawal in the history. Save the four-seat brief as v3, read its seat count, and record approval for those reviewed bytes. A matching v3 filename alone leaves the handoff paused.
If a receipt already shows that v2 reached the recipient, keep that receipt. Record v3 as a correction with its own delivery check. Replacing the local file tells you nothing about which copy the recipient has.
Check identity, destination and bytes as separate questions
First confirm the required inputs exist. Then compare the approval with the trusted expected record. Next compare asset identity and revision, filename, destination and the bytes. A failure should identify which comparison stopped the handoff, so the reviewer can resolve that specific mismatch.
A SHA256 digest is useful here as a comparison value computed from the file bytes. It is not an assessment of the document’s factual accuracy, image rights or suitability, and it is not a permission grant. The destination string in the example is fictional. An actual platform destination must be independently checked using its own identity and permissions.
This worksheet deliberately treats a renamed file as a mismatch even when the bytes match. That is a chosen convention, not a universal requirement. If your team allows renaming, define that rule explicitly and review the updated record. Do not weaken the check merely because a stopped job is inconvenient.
What our 11 offline cases actually showed
On October 27, 2026, we ran a small standalone JavaScript demonstrator using Node 22.22.3 and synthetic in-memory text buffers. All 11 cases returned their predefined expected decisions. No client attachment was used, no file was sent and no n8n workflow or connector was run. These results describe those fixtures, not production reliability.
The passing fixture used the reviewed five-seat brief, its matching asset and revision, the chosen filename, a matching approval and the intended fictional destination. Its result was READY_FOR_LOCAL_HANDOFF. That label stops short of claiming delivery.
Offline fixture results; grouped rows below cover all 11 cases.
| Input change | Cases | Expected and observed decision |
|---|---|---|
| None: approved fixture | 1 | READY_FOR_LOCAL_HANDOFF |
| Same name with older contents | 1 | STOP_BYTES |
| Old revision or different asset | 2 | STOP_REVISION |
| Correct bytes, wrong destination | 1 | STOP_DESTINATION |
| Unapproved or stale approval | 2 | STOP_APPROVAL |
| Missing bytes or expected record | 2 | STOP_MISSING_INPUT |
| Identical bytes with a different filename | 1 | STOP_NAME |
| Modified bytes plus substituted expected digest, old approval | 1 | STOP_APPROVAL |
The final case shows why a matching candidate and substituted digest are insufficient when the approval still refers to different bytes. It does not test an attacker replacing every trusted input.
Where this fits beside n8n file handling
n8n documents files as binary data. Its JavaScript getBinaryDataBuffer helper retrieves a buffer using an item index and binary property name. The official helper page says the helper is not supported in Python. Node documents createHash and update/digest operations, including SHA256 examples.
Those documents explain how bytes and hashes can be handled; they do not validate our approval record or destination. If you adapt the comparison to n8n, first verify the node’s actual binary property and item selection, runtime support and permitted modules. Do not assume that a standalone Node example runs unchanged in your deployment. No configuration change or live n8n test is represented by this article.
Validate the same bytes you intend to hand over. Reopening a mutable file path afterward can introduce a different revision. Our offline example does not test concurrent changes, atomic operations, transport behavior or destination receipts. Those are additional engineering checks before an automated workflow could be considered ready.
Keep delivery as a second result
After local review, record delivery separately: intended destination, observed destination, resulting artifact and the evidence used to inspect it. An upload request or an accepted job is not the same observation as a verified artifact at the destination.
If the destination preserves bytes, a digest comparison may be part of that follow-up. If a service converts or re-exports the attachment, document the expected transformation and inspect the resulting content and format. A source digest by itself does not prove that a transformed output is correct. Leave delivery unresolved until the required evidence exists.
For a manual handoff, the useful habit is the same: identify the approved revision, confirm where it belongs and check what arrived. This article does not authorize sending a file or provide evidence that any file has been sent.
Use a small preflight before the next handoff
Choose one ordinary attachment and fill the worksheet before building an automation around it. Resolve missing version or approval information first. If you cannot identify the expected bytes and destination, adding more workflow steps will not answer those questions.
Try a harmless local mismatch deliberately: change the revision label or supply an older synthetic file with the same name. Confirm that your comparison stops for the reason you expect. Keep that result distinct from destination testing. This gives you a specific review question to resolve, without inventing an end-to-end success story.
Which asset and revision were reviewed?
Does approval refer to those exact bytes?
Is the candidate the intended file under the chosen naming rule?
Has the destination been checked independently?
What evidence will establish successful delivery?
