An ‘article published’ event tells you that a status changed in the CMS. It does not tell you that the newsletter copy, link version or specific social post has been approved. Without further conditions, automation simply distributes a mistake faster.
A safer flow separates drafting, approval of the exact version, sending and confirmation at the destination. Before launching it, test deliberate duplicate events, content changes, revoked permission and a stop. The original demonstration below ran only against a local HTTP destination. It sent no email or social post and used no language model.
Define the approved version and channel
Approval should not be a floating ‘yes’ checkbox beside an article title. It must be tied to what will actually be sent: article identity, body version, post copy, destination channel and image. When a material component changes, the old approval no longer covers the new combination.
In the work card, record the approver and time, checksum of the approved package, target account and any scheduled sending time. A checksum such as SHA-256 detects changes in bytes. It does not tell you whether the text is true or whether an authorized person approved it. You also need permission management and a traceable decision history.
Each channel has its own output. Approval to publish an article is not automatically approval for a newsletter. For content featuring a person’s likeness or third-party materials, resolve the scope of rights in advance too. If you rely on consent, agree what withdrawal means for pending distribution and who handles copies already published.
A content calendar helps assign owners and deadlines. This procedure adds a specific technical boundary: what authorizes the queue to send this exact version to this exact account.
Separate drafting a post from sending it
The first stage can prepare a draft: read authorized CMS data, compose the copy, attach the correct link and offer a preview. Sending access goes only to a subsequent step with fixed conditions. AI can help with wording. Its own draft must not replace approval, nor may it choose another account when the selected destination fails.
WordPress REST API distinguishes post identity, status, content, link and modification times. Process the actual response values. An article title is not a stable identifier, and a modification date alone does not describe which parts of the distribution package changed.
The official transition_post_status reference passes the new and old statuses and the post object. Its accompanying developer notes warn that the hook can also fire on an update without a status change. A custom integration therefore needs an exact condition and deduplication; the hook’s name alone does not guarantee one-time distribution. We install no plugin or hook on a live website here.

Handle duplicates and repeated events
The same record may arrive repeatedly or be processed by multiple automations. Create a key for the intended delivery: article identity + approved version + channel. The same key with the same data should return the original receipt, not create another post. This behavior is called idempotency.
The key must reflect editorial policy. If you want to send the same version again in a new campaign, you need a new explicitly approved operation; you cannot arbitrarily change the identifier to get past duplicate protection. The same key with a different body should cause a conflict, not a silent overwrite.
Zapier documentation distinguishes polling-trigger deduplication from actions in the destination application. Trigger checks take place within a particular Zap; multiple automations can still respond to the same input. Trigger behavior therefore does not establish that the target network will never create a duplicate. Our test does not use Zapier or verify a particular connector.
In production, use persistent sending-operation records, a unique database key and coordination between concurrent workers. Watch for a failure after the destination accepts a request but before you store its receipt. After a timeout, mark the state uncertain, establish the actual state at the destination and only then decide whether to retry. Simply recording ‘sent’ before the network call is not a solution: it can instead lose a delivery.
Stop withdrawn or changed content
Recheck conditions immediately before sending, not just when adding an item to the queue. The article may since have been withdrawn, its version edited or permission revoked. Return a pending item with invalid approval for review; do not automatically send the latest available wording instead.
Stop must have a specific owner and scope: one article, a channel or the entire sender. Test it before the first live connection. Stopping a queue does not retract copies already published and may not catch a request that has just reached the destination. This boundary needs its own operating procedure, including manual intervention.
In the local test, the same event arrived again after approved v1. The destination returned the original ID local-1, and the record count stayed at one. An attempt to change the text under the same v1 was stopped by the approved-hash check. After the current version changed to v2, both old v1 and as-yet-unapproved v2 were blocked. Only fresh approval of v2 allowed a second delivery, local-2.
| Event | Result | Total at destination |
|---|---|---|
| Approved v1 | local-1 | 1 |
| Repeated v1 | same local-1 | 1 |
| Text changed under the same v1 | blocked by hash | 1 |
| Old v1 when v2 is current | blocked | 1 |
| V2 without fresh approval | blocked | 1 |
| Approved v2 | local-2 | 2 |
| Permission revoked | blocked | 2 |
| Publication withdrawn | blocked | 2 |
| Stop active | blocked | 2 |
We then separately revoked the simulated permission, changed publication status to nonpublic and activated stop. Each condition blocked another sending attempt. This demonstrates the branches of this serial test. It does not establish the legal effect of withdrawal, the behavior of a real social network or resilience to crashes and concurrency.
Store confirmation of actual delivery
A successful automation run and the actual state at the destination are two different things. Store the sending-operation ID, target account, approved version, time and API response. Where possible, read the target record back and compare its content or checksum. HTTP 200 may mean only acceptance into another queue; it depends on the particular API’s contract.
In our example, the response contains an ID, checksum and an acceptance flag from our own local destination. A subsequent GET retrieved its actual stored record, and the program compared both ID and hash. Output with two entries confirms acceptance by this test server, not that a person read a message.
The complete standalone example below is intended for your own isolated environment with Python 3.14.9. Save it as distribuce.py and run python3 distribuce.py. It creates a server only on 127.0.0.1, executes serial scenarios, prints the records and shuts the server down. It has no production credentials and calls nowhere outside the local computer.
Complete verified Python example (expand)
"""Synthetic local HTTP target; no email, CMS or social network calls."""
import hashlib, json, threading, urllib.request
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
def demo():
receipts = {}
class Target(BaseHTTPRequestHandler):
def log_message(self, *args):
pass
def do_POST(self):
body = json.loads(self.rfile.read(int(self.headers['Content-Length'])))
key = self.headers['Idempotency-Key']
digest = hashlib.sha256(body['text'].encode()).hexdigest()
if key in receipts and receipts[key]['sha256'] != digest:
self.send_response(409)
self.end_headers()
return
receipts.setdefault(key, {'id': 'local-' + str(len(receipts) + 1),
'sha256': digest, 'accepted': True})
self.send_response(200)
self.end_headers()
self.wfile.write(json.dumps(receipts[key]).encode())
def do_GET(self):
self.send_response(200)
self.end_headers()
self.wfile.write(json.dumps(receipts).encode())
server = ThreadingHTTPServer(('127.0.0.1', 0), Target)
worker = threading.Thread(target=server.serve_forever, daemon=True)
worker.start()
url = 'http://127.0.0.1:' + str(server.server_port)
state = {'version': 'v1', 'approved': 'v1', 'published': True,
'permission': True, 'stop': False,
'approved_sha256': hashlib.sha256('Schválený syntetický text v1'.encode()).hexdigest()}
log = []
def send(version, text):
if state['stop']:
outcome = 'STOP'
elif not state['permission']:
outcome = 'PERMISSION_REVOKED'
elif not state['published']:
outcome = 'UNPUBLISHED'
elif version != state['version'] or version != state['approved']:
outcome = 'VERSION_BLOCKED'
elif hashlib.sha256(text.encode()).hexdigest() != state['approved_sha256']:
outcome = 'CONTENT_CHANGED'
else:
key = 'synthetic-article:' + version + ':local-channel'
request = urllib.request.Request(url, data=json.dumps({'text': text}).encode(),
headers={'Idempotency-Key': key,
'Content-Type': 'application/json'})
with urllib.request.urlopen(request, timeout=3) as response:
receipt = json.load(response)
with urllib.request.urlopen(url, timeout=3) as response:
actual = json.load(response)
assert actual[key] == receipt
assert receipt['sha256'] == hashlib.sha256(text.encode()).hexdigest()
outcome = receipt['id']
log.append({'version': version, 'outcome': outcome})
return outcome
try:
first = send('v1', 'Schválený syntetický text v1')
assert send('v1', 'Schválený syntetický text v1') == first
assert len(receipts) == 1
assert send('v1', 'Neschválená změna pod stejnou verzí') == 'CONTENT_CHANGED'
state['version'] = 'v2'
assert send('v1', 'Schválený syntetický text v1') == 'VERSION_BLOCKED'
assert send('v2', 'Nový syntetický text v2') == 'VERSION_BLOCKED'
state['approved'] = 'v2'
state['approved_sha256'] = hashlib.sha256('Nový syntetický text v2'.encode()).hexdigest()
assert send('v2', 'Nový syntetický text v2') == 'local-2'
state['permission'] = False
assert send('v2', 'Nový syntetický text v2') == 'PERMISSION_REVOKED'
state['permission'] = True
state['published'] = False
assert send('v2', 'Nový syntetický text v2') == 'UNPUBLISHED'
state['published'] = True
state['stop'] = True
assert send('v2', 'Nový syntetický text v2') == 'STOP'
assert len(receipts) == 2
return {'scope': 'serial in-memory local fixture, no crash recovery or production inference',
'events': log, 'receipts': receipts, 'scenarios': len(log)}
finally:
server.shutdown()
server.server_close()
worker.join(timeout=3)
if __name__ == '__main__':
print(json.dumps(demo(), ensure_ascii=False, indent=2))
The destination records in this example exist only in memory. They disappear after a restart; this is not a production sender. It lacks authentication between systems, a persistent queue, concurrency coordination, crash recovery and a complete approval check for the hash of the entire package. These are not minor details to add after going live. They belong in the implementation brief.
For a real pilot, also add a lost response, a destination error, concurrent delivery and a restart. Decide beforehand which states may be retried automatically and which wait for a human. The result should be traceable without reopening the original AI conversation.
For broader organization, see content marketing operations. If you are considering an agent instead of a fixed flow, also review the limits of MCP and AI agents. For a known input and a few fixed checks, ordinary automation is often clearer than a model deciding afresh on every run what it may send.
Want to automate distribution without losing editorial control?
I can help you choose a first bounded process and define approval, responsibility and result checks. Tell me which distribution step fails most often today. We will start with a brief and a safe pilot, not connect every account at once.









