Skip to main content

Reference patterns for reliable enterprise integration, workflow automation, and system-of-record synchronization.

Project description

integration-automation-patterns

CI PyPI Python License Downloads]


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


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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

integration_automation_patterns-0.8.0.tar.gz (56.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

integration_automation_patterns-0.8.0-py3-none-any.whl (50.3 kB view details)

Uploaded Python 3

File details

Details for the file integration_automation_patterns-0.8.0.tar.gz.

File metadata

File hashes

Hashes for integration_automation_patterns-0.8.0.tar.gz
Algorithm Hash digest
SHA256 2f62c051c35f238928cb1ea9ee30d000deb3af9e66916a14bbe9322a9d35d5c4
MD5 7558bf2c707f5d1bc3e845299a105ba8
BLAKE2b-256 2ba485ac4a25e87a203d95a905251bfac59a6aab362525b2a21187750470688c

See more details on using hashes here.

Provenance

The following attestation bundles were made for integration_automation_patterns-0.8.0.tar.gz:

Publisher: publish.yml on ashutoshrana/integration-automation-patterns

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file integration_automation_patterns-0.8.0-py3-none-any.whl.

File metadata

File hashes

Hashes for integration_automation_patterns-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 99caae54ae9d901276cdbde58b8bbdf81b7c60249d66b8b32fcd7bb95e769331
MD5 f715e6b9ad38686b97d775428a57dbd6
BLAKE2b-256 cf1b6db3f9cb19c61d32f111fe13b5d5cea964dcfdeb9a23eb370d6ade46c387

See more details on using hashes here.

Provenance

The following attestation bundles were made for integration_automation_patterns-0.8.0-py3-none-any.whl:

Publisher: publish.yml on ashutoshrana/integration-automation-patterns

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page