Life ConnectLife Connect
Wiki index
Architecture
Services
UI
Concepts
Runbooks
Infra
Swagger Docs
GitHub
Wiki index
Architecture
Services
UI
Concepts
Runbooks
Infra
Swagger Docs
GitHub
  • Cross-cutting concepts

    • EventBridge fanout
    • Atlas Triggers
    • ECS Fargate deploy lifecycle
    • Keycloak hosting
    • Cloudflare Pages auto-deploy
    • Bitbucket Pipelines (legacy)
    • Terraform-managed envs (legacy)
  • Accounting model

    • Accounting model
    • Events catalog
    • Accounting journals
    • Plan of accounts (PCG)
    • Auxiliary accounts
    • FEC fields (Fichier des Écritures Comptables)
    • pieceReference numbering
    • Tenant matrix (payable / receivable)
    • Owner matrix (payable / receivable)
    • Take-over UI display rules
    • Engine functional audit (2026-07) ↗
Last updated 2026-09-23

Atlas Triggers

AI-generated content

This document was generated by an AI assistant. Verify accuracy before relying on the details.

The producer side of every async ADB event is a MongoDB Atlas Trigger — a server-side function that watches a single collection's change stream and pushes a transformed message to AWS EventBridge (or, for two internal cases, to a Realm function). Triggers are NOT managed by the new infra/ Pulumi project — they live in the Atlas App Services app triggers-kkeqz and are deployed via realm-cli. The legacy management scripts are in adb-infrastructure/mongodb-atlas/realm-cli/triggers/.

At a glance

FactValueSource
Atlas projectadb-prod (65b269f45146181dace9b228)atlas projects list
Clusteradb-prod (M20, MongoDB 8.0.21, Azure FRANCE_CENTRAL)atlas clusters describe adb-prod
Realm apptriggers-kkeqz, region aws-eu-west-1, deployment LOCALrealm-cli pull
Trigger count18 (16 → AWS EventBridge, 2 → internal Realm functions)realm-cli pull
AWS targetaccount 182790345476, region eu-west-3trigger event_processors.AWS_EVENTBRIDGE.config
Time zone in payloadsEurope/Paristrigger project.requestContextData

Details

Trigger inventory

Producer-side mapping (database, collection, operations watched):

TriggerDBCollectionOps→ AWS
accounting-entry-modifiedadb-accountingdomain_object_accounting_entryI/U/R/D✅
accounting-event-modifiedadb-accountingaccounting_eventI/U/R/D✅
auxiliary-account-balance-updatedadb-accountingledger_auxiliary_accountU/R✅
payment-modifiedadb-accountingpaymentsI/U/R/D✅
contract-modifiedadb-contractscontractsI/U/R/D✅
direct-debits-status-processedadb-contractsdirect_debitsU/R✅
dunning-notice-sentadb-contractsdunningsI/U✅
file-metadata-modifiedadb-filesfilesI/U/R/D✅
index-createdadb-utilitiesindexesI✅
organization-modifiedadb-personsorganizationI/U/R/D✅
person-modifiedadb-personspersonsI/U/R/D✅
part-modifiedadb-partspartsI/U/R/D✅
parts-charge-budget-modifiedadb-partschargesI/U/R/D✅
parts-market-performance-modifiedadb-partsmarket_performancesI/U/R/D✅
ticket-event-modifiedadb-ticketseventsI/U/R/D✅
ticket-modifiedadb-ticketsticketsI/U/R/D✅
notification-definition-modifiedadb-utilitiesnotification_definitionsI/U/R/D❌ → Realm fn — superseded, see below
notification-ttl-deletedadb-utilitiesnotifications_ttlD❌ → Realm fn — superseded, see below

The two notification Realm functions (superseded)

Together they used to perform the banner fan-out described in adb-utilities → Notification fan-out:

  1. notification-definition-modified runs dev_notification_definition_created_updated_deleted_replaced_function.js: when the changed definition's state is NOTIFICATION_DEFINITION_STATE.ACTIVE it upserts { _id: <definition id>, organisationId, start: schedule.start } into notifications_ttl (a TTL index with expireAfterSeconds: 0 on start, see adb-infrastructure/mongodb-atlas/data-scripts/create_notifications_ttl_index.js); on a delete it removes that document.
  2. notification-ttl-deleted runs dev_notification_ttl_deleted_function.js when MongoDB expires the TTL document: it loads the definition and insertManys one organisation-level notification per channel × organisation (organisationId = the target organisation, state: SENT, no user).

Both functions name the adb-development cluster service and were never provisioned for staging (adb-stage), the local stack or the Cloudflare port — which is why an activated banner reached no user there. Since 2026-09-23 adb-utilities performs this fan-out itself on every definition write (NotificationDefinitionServiceImpl#fanOut, property notifications.fan-out.enabled). Wherever the service fan-out is enabled these two triggers must be disabled (realm-cli → triggers-kkeqz), otherwise every banner is produced twice.

Database naming convention

Each microservice owns its own MongoDB database, named identically: adb-<service> (e.g. adb-contracts, adb-accounting). The adb-tickets database exists and triggers fire on it even though there's no adb-tickets/ directory in the monorepo today.

How to inspect or change a trigger

See MongoDB Atlas — Realm CLI setup for the install + auth steps. Then:

realm-cli login --api-key "$MONGODB_ATLAS_PUBLIC_API_KEY" --private-api-key "$MONGODB_ATLAS_PRIVATE_API_KEY"
realm-cli pull --remote triggers-kkeqz --local /tmp/realm
ls /tmp/realm/triggers
# Each <name>.json has config.{database,collection,operation_types} + event_processors.AWS_EVENTBRIDGE.config

To deploy a change, edit the JSON in the legacy adb-infrastructure/mongodb-atlas/realm-cli/triggers/ checkout (or in your realm-cli pull working copy) and realm-cli push --remote triggers-kkeqz.

Open questions

  • Why does every trigger's project set event: "CREATED" and operationType: 1 as static literals? Real values should come from the change-stream metadata.
  • Atlas Triggers don't appear in any IaC — they're managed by hand-edited JSON in adb-infrastructure/. Should they move to a Pulumi MongoDB Atlas provider integration so the new infra/ is the single deploy surface?
  • The two notification-* triggers are superseded by the in-service fan-out (see above): when are they disabled on adb-prod, and is the notifications_ttl collection + TTL index dropped with them?
Edit this page
Last Updated:
Contributors: Grégory Horion
Prev
EventBridge fanout
Next
ECS Fargate deploy lifecycle