CRM write succeeded, receiver crashed: two recovery tests for an n8n handoff

The CRM task exists, but the receiver stopped before saving the confirmation. Before repeating that write, can your handoff identify the task already created?

I test two interruption points in the Python receiver behind CRM Handoff Desk. Each test terminates a separate worker with exit code 73, then reopens the same SQLite files. These test a receiver fed by n8n, not n8n’s own crash recovery.

1. Approval saved, dispatch not started

Approval and the pending operation are committed, then the worker exits. Recovery must finish the approved operation:

Before recovery: queued, 0 CRM tasks
After recovery:  delivered, 1 CRM task

2. Destination write saved, local confirmation missing

The mock CRM has the task, but the receiver is still processing with no local receipt. After the operation’s lease expires, recovery looks it up at the destination and records the confirmation:

Before recovery: processing, 1 CRM task
Local receipt:   missing
After recovery:  delivered, 1 CRM task

The tests explicitly call Store.recover(request_id). Duplicate intake alone does not trigger recovery. In this excerpt from the second test, the reopened receiver must finish without adding a task:

delivered = reopened.recover(item["id"])
self.assertEqual(delivered["status"], "delivered")
self.assertEqual(len(reopened.state()["tasks"]), 1)

Run these two tests

Download the two forum attachments and follow README_RUN.txt to restore the runnable bundle. From its tests directory, run with Python 3.11+:

python -m unittest -v test_workflow -k child_process_crash_after

This selects the two child-process crash tests. Both passed locally. They use fresh temporary receiver and mock CRM databases: no server, API keys or Node build is needed. The assertions are in tests/test_workflow.py; the termination points are in tests/crash_worker.py. The second test also compares the receiver’s delivered receipt with the destination receipt after recovery.

The destination contract matters. This mock supports a stable operation ID, lookup and idempotent creation. An empty lookup or timeout in a real CRM is not permission to repeat an uncertain write. If the outcome cannot be established safely, keep it unresolved for review.

crm-handoff-desk-source.json
README_RUN.txt — PDF copy

Use the forum-attached JSON with the guide. The app’s “Source JSON” is a separate developer export. The bundle includes a React review screen and n8n intake example; it is not a workflow import of the whole application.

How does your CRM/API identify a write after its response is lost? Share the destination and one redacted failure case; my profile has contact details for a private brief. The first task I’d scope is that one failure: a reproduction, written findings, recovery acceptance cases and a repair proposal. We’d agree its effort limit and price before starting. The findings may point to an existing n8n retry or a small adapter change.