<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Idempotency on ErrorZap</title><link>https://errorzap.com/tags/idempotency/</link><description>Recent content in Idempotency on ErrorZap</description><image><title>ErrorZap</title><url>https://errorzap.com/og.png</url><link>https://errorzap.com/og.png</link></image><generator>Hugo</generator><language>en-US</language><copyright>ErrorZap</copyright><lastBuildDate>Fri, 20 Nov 2026 09:00:00 -0700</lastBuildDate><atom:link href="https://errorzap.com/tags/idempotency/index.xml" rel="self" type="application/rss+xml"/><item><title>The Good Automation Knows When Not to Run</title><link>https://errorzap.com/posts/the-good-automation-knows-when-not-to-run/</link><pubDate>Fri, 20 Nov 2026 09:00:00 -0700</pubDate><guid>https://errorzap.com/posts/the-good-automation-knows-when-not-to-run/</guid><description>The most valuable branch in an automation is often the one that refuses to act.</description><content:encoded><![CDATA[<p>Most automation demos celebrate motion.</p>
<p>A trigger fires. Windows flash by. An API responds. A message lands somewhere. The machine looks busy, which is visually indistinguishable from useful.</p>
<p>In production, the best branch is often the one that does nothing.</p>
<h2 id="refusal-is-a-feature">Refusal is a feature</h2>
<p>A safe automation should stop when:</p>
<ul>
<li>the source is stale or structurally wrong;</li>
<li>the destination identity is ambiguous;</li>
<li>the same item was already processed;</li>
<li>a required approval is missing;</li>
<li>a person is actively using the system;</li>
<li>the prior run has not finished;</li>
<li>a dependency is unhealthy;</li>
<li>the action would exceed a cost, volume, or time boundary;</li>
<li>the result cannot be verified.</li>
</ul>
<p>Those are not edge cases. They are the control system.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>trigger
</span></span><span style="display:flex;"><span>  |
</span></span><span style="display:flex;"><span>  v
</span></span><span style="display:flex;"><span>preconditions ---- fail ----&gt; record why + stop
</span></span><span style="display:flex;"><span>  |
</span></span><span style="display:flex;"><span> pass
</span></span><span style="display:flex;"><span>  v
</span></span><span style="display:flex;"><span>act once
</span></span><span style="display:flex;"><span>  |
</span></span><span style="display:flex;"><span>  v
</span></span><span style="display:flex;"><span>verify outcome ---- fail ----&gt; contain + escalate
</span></span></code></pre></div><h2 id="triggers-are-suggestions">Triggers are suggestions</h2>
<p>A file appeared. A timer fired. A webhook arrived. A game process closed. An email matched a phrase.</p>
<p>Each of those is evidence that something may need to happen. None is blanket authority.</p>
<p>Before acting, the automation should re-read the current state. Is this the same file the previous run handled? Is the email still a draft? Did the user reopen the game? Is the target the exact account or server expected? Did the data pass validation?</p>
<p>This small pause separates event-driven software from event-obedient software.</p>
<h2 id="idempotency-is-memory-with-teeth">Idempotency is memory with teeth</h2>
<p>The simplest automation failure is doing the right thing twice.</p>
<p>Send two notices. Import the same records again. Create duplicate tasks. Publish the same post from two workers. Restart the service after another worker already repaired it.</p>
<p>An idempotency key converts &ldquo;I think I have seen this&rdquo; into a test. It can be a message ID, content hash, source record plus version, canonical URL, or explicit run token. Store the outcome. On repetition, return the previous result instead of repeating the effect.</p>
<p>For external actions, recovery must also be read-based. A network timeout after a send does not mean nothing happened. Check the destination before retrying.</p>
<h2 id="human-context-matters">Human context matters</h2>
<p>One of my favorite automations waited for a game to close before showing a message. The technical trick was not the notification. It was respecting the fact that a person was in the middle of something.</p>
<p>That idea scales. Do not reboot an interactive workstation because a maintenance clock fired. Do not flood a phone because a device flapped. Do not publish a draft because its date looks old. Do not turn a rough note into a client message without exact approval.</p>
<p>Good automation understands that people are part of the state.</p>
<h2 id="a-clean-skip-needs-a-receipt">A clean skip needs a receipt</h2>
<p>Silence without evidence is indistinguishable from failure. Every refusal should be inspectable:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>skipped: destination did not match pinned account
</span></span><span style="display:flex;"><span>skipped: source validation failed, last-good preserved
</span></span><span style="display:flex;"><span>skipped: duplicate content hash already completed
</span></span><span style="display:flex;"><span>skipped: approval absent
</span></span></code></pre></div><p>The receipt should be concise, secret-free, and tied to the trigger. Repeated identical skips should deduplicate just like repeated alerts.</p>
<p>The goal is not an automation that always runs. It is an automation that always makes the right decision about whether running is safe, useful, and authorized.</p>
<p>Motion is easy. Restraint is engineering.</p>
]]></content:encoded></item></channel></rss>