Reference patterns for reliable enterprise integration, workflow automation, and system-of-record synchronization.
Project description
integration-automation-patterns
The problem this solves
Enterprise systems that span CRM + ERP + messaging fail in predictable ways: duplicate event processing, partial transaction failures, and lost messages under retry. This library provides reference implementations of the patterns that solve these problems structurally — idempotent event envelopes, field-level authority boundaries, distributed saga orchestration, and transactional outbox — so integration logic is explicit, testable, and broker-agnostic.
Architecture
Inbound Event
│
▼
EventEnvelope
(event_id, idempotency_key, source, schema_version, metadata)
│
├─ Duplicate Check ──────────────────────────────────────────┐
│ event_id already processed? → skip, return cached result │
│ │
├─ Authority Check ──────────────────────────────────────────┤
│ SyncBoundary.detect_conflict() │
│ Which system owns this field? │
│ Conflict → raise ConflictError, log authority boundary │
│ │
├─ Retry Policy ─────────────────────────────────────────────┤
│ Exponential backoff, max attempts │
│ CircuitBreaker: CLOSED → OPEN → HALF_OPEN recovery │
│ │
└─ Outbox → DB Transaction → Reliable Publish ───────────────┘
Write event in same DB tx as domain change
Relay process delivers to broker independently
Installation
pip install integration-automation-patterns
30-second example
from integration_automation_patterns.event_envelope import EventEnvelope, DeliveryStatus
from integration_automation_patterns.sync_boundary import SyncBoundary, FieldAuthority
# Idempotent event envelope — safe to process multiple times
event = EventEnvelope(
event_id="evt_8f3a1b",
source="salesforce",
event_type="contact.updated",
payload={"email": "alice@example.com", "phone": "+1-555-0100"},
schema_version="1.0",
)
# Field-level authority — who owns each field across systems?
boundary = SyncBoundary(
authorities={
"email": FieldAuthority(owner="salesforce", read_others=["erp", "itsm"]),
"phone": FieldAuthority(owner="erp", read_others=["salesforce"]),
}
)
conflicts = boundary.detect_conflict(
incoming_system="salesforce",
fields={"email": "alice@example.com", "phone": "+1-555-0100"},
)
# conflicts → {"phone": ConflictDetail(owner="erp", incoming_system="salesforce")}
if not conflicts:
event.mark_delivered()
See docs/implementation-note-01.md for a full walkthrough.
Pattern catalog
| Pattern | Class | Problem Solved |
|---|---|---|
| Idempotent Event | EventEnvelope |
Duplicate processing under at-least-once delivery |
| Authority Model | SyncBoundary |
Field-level conflict detection across systems |
| Circuit Breaker | CircuitBreaker |
Cascading failure isolation with automatic recovery |
| Saga | SagaOrchestrator |
Multi-step distributed transaction with compensation |
| Outbox | OutboxPublisher |
Reliable event publish in the same DB transaction |
| Kafka Envelope | KafkaEnvelope |
Partition routing, schema versioning, DLQ support |
| Webhook Validation | WebhookHandler |
HMAC-SHA256 signature verification + idempotency |
| Change Data Capture | CDCEvent |
Typed INSERT/UPDATE/DELETE with Debezium parsing |
Repository structure
src/integration_automation_patterns/
├── event_envelope.py # Reliable event transport + retry + delivery status
├── sync_boundary.py # Bi-directional SOR sync with field authority
├── circuit_breaker.py # CLOSED/OPEN/HALF_OPEN state machine
├── saga.py # Distributed saga orchestrator + compensation
├── outbox.py # Transactional outbox for at-least-once delivery
├── kafka_envelope.py # Kafka-aware envelope: partition key, DLQ, schema
├── webhook_handler.py # HMAC-SHA256 webhook verification
└── cdc_event.py # Change Data Capture event types (Debezium-compatible)
docs/
├── architecture.md
├── implementation-note-01.md # Event-driven integration reliability
├── implementation-note-02.md # Idempotency in enterprise event processing
└── adr/
See ECOSYSTEM.md for the full broker, connector, and framework coverage matrix.
Published notes
- Implementation Note 01 — Event-driven integration reliability
- Implementation Note 02 — Idempotency in enterprise event processing
Contributing
Contributions are welcome. Please read CONTRIBUTING.md for guidelines. Run pytest tests/ -v to verify your changes before opening a pull request.
Citation
If you use these patterns in research or production, please cite:
@software{rana2026iap,
author = {Rana, Ashutosh},
title = {integration-automation-patterns: Enterprise integration reliability patterns},
year = {2026},
url = {https://github.com/ashutoshrana/integration-automation-patterns},
license = {MIT}
}
Or use GitHub's "Cite this repository" button above (reads CITATION.cff).
Part of the enterprise AI patterns trilogy
| Library | Focus | Regulation |
|---|---|---|
| enterprise-rag-patterns | What to retrieve | FERPA identity-scoped RAG |
| regulated-ai-governance | What agents may do | FERPA, HIPAA, GLBA policy enforcement |
| integration-automation-patterns | How data flows | Event-driven enterprise integration |
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file integration_automation_patterns-0.7.0.tar.gz.
File metadata
- Download URL: integration_automation_patterns-0.7.0.tar.gz
- Upload date:
- Size: 56.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c1400cd5eeb93a2dae71d3ce20c2d2e864b00f0c52ced49900e46722b6da13b
|
|
| MD5 |
8e99e0646ecd03b6e13f71fbc835c393
|
|
| BLAKE2b-256 |
264c82c164be03690749981d618af9f0737d6a6cec80ed140d575d029987a4a4
|
Provenance
The following attestation bundles were made for integration_automation_patterns-0.7.0.tar.gz:
Publisher:
publish.yml on ashutoshrana/integration-automation-patterns
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
integration_automation_patterns-0.7.0.tar.gz -
Subject digest:
0c1400cd5eeb93a2dae71d3ce20c2d2e864b00f0c52ced49900e46722b6da13b - Sigstore transparency entry: 1282899558
- Sigstore integration time:
-
Permalink:
ashutoshrana/integration-automation-patterns@6a6713eb3350f3de43bf76c28cc8ee31eb02c325 -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/ashutoshrana
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6a6713eb3350f3de43bf76c28cc8ee31eb02c325 -
Trigger Event:
release
-
Statement type:
File details
Details for the file integration_automation_patterns-0.7.0-py3-none-any.whl.
File metadata
- Download URL: integration_automation_patterns-0.7.0-py3-none-any.whl
- Upload date:
- Size: 50.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2614915e5363bc0fdd7bcc4a88fbcdfe66868af397ea9682eb10efc14d64b140
|
|
| MD5 |
bfab6554eb8a714265ca97b64f202a52
|
|
| BLAKE2b-256 |
01599575b8f1cafb3af52a9a85d3e352f7ef1ed081f7f84095ce9829d615b393
|
Provenance
The following attestation bundles were made for integration_automation_patterns-0.7.0-py3-none-any.whl:
Publisher:
publish.yml on ashutoshrana/integration-automation-patterns
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
integration_automation_patterns-0.7.0-py3-none-any.whl -
Subject digest:
2614915e5363bc0fdd7bcc4a88fbcdfe66868af397ea9682eb10efc14d64b140 - Sigstore transparency entry: 1282899561
- Sigstore integration time:
-
Permalink:
ashutoshrana/integration-automation-patterns@6a6713eb3350f3de43bf76c28cc8ee31eb02c325 -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/ashutoshrana
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6a6713eb3350f3de43bf76c28cc8ee31eb02c325 -
Trigger Event:
release
-
Statement type: