Every Integration Needs an Owner: Authority, Freshness and Failure Handling
Wiring two applications together is the easy part. You can usually get a demo working in an afternoon: a webhook fires, a record shows up on the other side, everyone nods. Keeping that shared information dependable for the next two years is a different job, and most integration specs never get to it.
The questions that decide whether an integration holds up are boring ones. Which system owns this value? How stale is too stale? What happens when the call times out? Who notices when it fails, and what do they do about it?
This piece is adapted from a Centravon™ resource on integration ownership. The code and field names below are illustrative, so adapt them to your own stack.
Assign authority per field, not per system
"The CRM is the source of truth" sounds decisive and usually isn't true. Relationship details may belong in the CRM. Invoice numbers belong in accounting. Delivery events might originate in a scheduling tool. One system rarely owns everything.
So write authority down at the field or object level, along with which direction updates are allowed to flow:
| Field | Authoritative system | Update direction | Conflict rule |
|---|---|---|---|
| account.name | CRM | CRM to accounting | CRM wins, change logged |
| invoice.number | Accounting | Accounting to CRM | Read-only in CRM |
| invoice.status | Accounting | Accounting to CRM | Read-only in CRM |
| contact.email_opt_out | CRM | CRM to email platform | Most restrictive value wins |
| session.attendance | Scheduling tool | Scheduling to CRM | Manual edits go to review queue |
The conflict rule column is the one people skip. If two systems can edit the same value, you need an explicit rule and a place where disagreements get reviewed. Silent last-write-wins is easy to build, and it produces the kind of data dispute nobody can explain three months later because the losing write left no trace.
Keeping this table in the repo next to the sync code, as config the code actually reads, stops it from drifting into a wiki page nobody opens:
# field_authority.yaml account.name: owner: crm flows_to: [accounting] on_conflict: owner_wins_and_log invoice.number: owner: accounting flows_to: [crm] on_conflict: reject_non_owner_write contact.email_opt_out: owner: crm flows_to: [email_platform] on_conflict: most_restrictive Decide how fresh each value needs to be
Some updates have to land in seconds. Others are fine in a nightly batch. The right question is how stale data affects the decision someone makes with it. A contact's opt-out preference and a monthly management summary have very different needs, and treating them the same either wastes effort or bites you.
Then show freshness where it matters. A last-synced timestamp, an in-progress state, or a visible exception is more honest than presenting every synced field as current. If your UI can't tell the difference between "this event never happened" and "the integration is behind," your users can't either.
A small pattern that helps: store sync metadata alongside the value instead of only the value.
CREATE TABLE synced_value ( entity_type TEXT NOT NULL, entity_id TEXT NOT NULL, field TEXT NOT NULL, value JSONB, source_system TEXT NOT NULL, source_updated_at TIMESTAMPTZ, synced_at TIMESTAMPTZ NOT NULL DEFAULT now(), PRIMARY KEY (entity_type, entity_id, field) ) Now the screen can say "invoice status as of 9:12 AM" and a monitor can flag anything older than the freshness target you agreed for that field.
Retry without repeating the business action
A timeout does not prove the other side did nothing. Maybe the request never arrived. Maybe it was processed and the response got lost. If you blindly retry, you can create a second invoice, a duplicate task, or a customer getting the same email twice.
The fix is a stable operation identifier that the receiving side can use to recognize a repeat. Many payment and messaging APIs support an idempotency key for exactly this reason. Generate it once per business action, persist it, and reuse it on every retry:
import uuid def create_invoice(order, client, store): # One key per business action, saved before the first attempt key = store.get_or_create_key(f"invoice:{order.id}", default=lambda: str(uuid.uuid4())) return client.post( "/invoices", json={"order_id": order.id, "amount": order.total}, headers={"Idempotency-Key": key}, ) The important part is that the key is tied to the order, not generated fresh inside the retry loop. A new key per attempt defeats the whole point.
Not every failure deserves a retry
Bound your retries, and sort failures before deciding what to do. A brief network interruption or a 503 is worth retrying with backoff. An expired credential, a malformed record or a permission denial is not. Sending the same invalid request five more times only adds noise to the logs, and sometimes earns you a rate limit you didn't need.
import random import time TRANSIENT = {408, 429, 500, 502, 503, 504} def send_with_retry(send, max_attempts=5, base_delay=1.0): for attempt in range(1, max_attempts + 1): response = send() if response.status_code < 400: return response if response.status_code not in TRANSIENT: # 400, 401, 403, 422 and friends need a person or a fix, not another try raise PermanentFailure(response) if attempt == max_attempts: raise RetriesExhausted(response) time.sleep(base_delay * 2 ** (attempt - 1) + random.uniform(0, base_delay)) The jitter matters more than it looks. Without it, every worker that failed at the same moment retries at the same moment too.
Make exceptions part of the workflow
Failed items need somewhere to go besides a log file. Decide who gets alerted, what context they need, and how they retry or resolve the item. Keep enough detail to investigate without copying sensitive payloads into places that don't need them.
A workable exception queue tracks distinct states:
- queued
- processing
- completed
- failed
- resolved
"Failed" and "resolved" being separate states is the useful bit. It means someone looked at the failure and made a decision, and you can report on how long that took.
SELECT integration, count(*) AS open_failures, min(failed_at) AS oldest FROM sync_job WHERE status = 'failed' GROUP BY integration ORDER BY oldest The queue also needs to support reconciliation against the source, especially after an outage. Technical monitoring tells you the job ran. Business reconciliation tells you the right records ended up in the right place. You usually need both, and they answer different questions.
Name an owner after launch
Integrations change after go-live. Providers alter their APIs, credentials rotate, business rules shift, volumes grow. Every one of those is a maintenance event, and if nobody owns the integration, the first sign of trouble is a user noticing wrong data.
Put a named owner on each connection, include monitoring and reconciliation in the operating plan, and scope new integrations by the actual systems, workflows, provider dependencies and acceptance evidence involved. "Connects to accounting" is a feature claim. "Syncs invoice number and status from accounting to the CRM within 15 minutes, with failures routed to the finance ops queue" is something you can test and accept.
Checklist
- [ ] Record the authoritative system and update direction for each shared field
- [ ] Pick an explicit conflict rule wherever two systems can write
- [ ] Set a freshness target per workflow and show sync time where it matters
- [ ] Use a stable idempotency key per business action
- [ ] Retry only transient failures, with backoff and jitter
- [ ] Give failed items a visible owner and a resolution path
- [ ] Test duplicate delivery, timeouts and an unavailable provider before launch
- [ ] Put maintenance and reconciliation in the scope, with a named owner
Further reading
Originally published at centravon.app.