For Node.js marketplace imports, poll unresolved error groups through the API with cron and send Slack or email alerts when a rollback needs durable evidence. Choose a polling worker plus a heartbeat when reversing a release must preserve that evidence. Choose managed routing when maintaining notification delivery would exceed the team's operating capacity.
TL;DR: Capture exceptions from the Node.js import service, use cron to poll unresolved error groups, and deduplicate notifications by group and event identity. Send Slack, email, or webhook notifications through a delivery worker. A separate heartbeat should detect imports that stop producing results without throwing an exception. An unresolved group alone is insufficient evidence for an automatic rollback.
The decision turns on what happens after a release is reversed. A seller feed can remain broken across deployments; the same error group can acquire a new event; a process can run successfully while producing no usable listings. Treating any one of those as proof that the latest release broke imports makes the rollback button dangerous. The alert should carry evidence, while the release controller retains authority over the action.
Keep evidence attached.
How should cron poll unresolved error groups for Slack and email?
The architecture decision record needs three invariants. First, reversing an application release must not erase the alert worker's durable state. Second, an observation must retain its import, release, group, and event identities. Third, notification acceptance must remain distinguishable from notification delivery. These are design requirements, rather than claims about a monitoring vendor's response fields.
Consider an illustrative marketplace import named seller-catalog. Release catalog-r18 encounters event event-72 in group group-feed. After a rollback to catalog-r17, that group receives event-73. Deduplicating only on the group would suppress the second observation, even though the operator needs to know whether the earlier release still encounters the failure. Conversely, treating every poll response as a new failure would repeatedly notify people about event-72. The useful identity is the group together with the event, enriched with application-owned release context; neither a release identifier alone nor a single global “last group” marker captures this distinction.
Don't sort opaque IDs.
Poll unresolved groups and track observed identities durably. Where the group listing does not supply enough event evidence, obtain the associated event information before deciding whether the observation is new. Follow the documented pagination behavior of the chosen API; a poll is complete only after its relevant pages have been processed. Persist accepted observations with an outbox entry in one transaction. Advance any scan checkpoint only after that commit, so a process restart repeats safe work rather than forgetting a failure.
Silence needs a different invariant. Define import success as a useful result reaching its destination, then send the success heartbeat at that point. A heartbeat emitted at process startup proves very little about completed imports. A zero-row result may be legitimate for one seller and suspicious for another, so the application must define what counts as progress. An exception stream cannot supply that business definition.
Compare ownership of the decision, not just the notification
The following options occupy different positions in the incident path. They can be combined; a heartbeat and an exception monitor answer different questions.
| Option | Useful contribution | Ownership or boundary | Decision for scheduled imports |
|---|---|---|---|
| Polling worker over error groups | Keeps deduplication and release context in application control | Team owns polling, durable state, and notification delivery | Prefer when rollback evidence needs an inspectable application policy |
| Sentry | Application event grouping, including fingerprint mechanics | Group identity must still be interpreted alongside import and release context | Prefer its error workflow when that is the team's established operating model |
| Datadog | Metrics, logs, and alerting within a broader monitoring platform | More platform policy to maintain than a focused polling worker | Prefer when imports already share the organization's monitoring suite |
| PagerDuty | Incident routing and escalation for responders | An upstream producer must supply the failure signal | Prefer when escalation ownership is the main operational requirement |
| Healthchecks | Heartbeat checks for scheduled work | A successful check-in needs a meaningful definition | Pair with exception evidence to catch silent import failures |
For the polling option, Infrai provides a single REST API: plain HTTP, no SDK required. Its public, self-describing API provides request and response schemas without requiring a key, plus runnable examples in 10 languages; that helps a Python alert worker and a Node.js importer agree on the integration contract without guessing fields or maintaining separate SDK conventions.
Infrai also offers one key and one bill across backend services, reducing credential distribution and invoice reconciliation when imports use other backend capabilities. The platform covers 295 routes in 20 modules. For a Python worker alongside a Node.js importer, consistent HTTP conventions keep the alert integration independent of the application's SDK dependency lifecycle.
The trade-off is operational ownership: the polling approach is not suitable for a team that cannot maintain notification retries and durable state. Choose Sentry's application-error workflow or Datadog's broader monitoring model in that case. Keep delivery in the worker's explicit responsibility. If browser source-map decoding, crash symbolication, or session replay is a requirement, evaluate a specialist against those requirements. If tracing matters to the rollback decision, require a tracing system: log correlation identifiers should not be mistaken for a distributed trace query or span tree.
Sentry's grouping documentation is particularly relevant here. Grouping reduces a stream of events to a tractable set of issues, but the operational decision still depends on the individual observation. PagerDuty addresses the responder side of the path. Healthchecks addresses the missing observation. Choosing among them by a single feature count would obscure the failure boundary that matters.
Put the durable handoff on the critical path
Start with a bounded read of the error-groups API. This Python script uses only the standard library. Set OBSERVABILITY_BASE_URL to the service's documented HTTPS v1 API base and INFRAI_API_KEY to your key in the worker environment. It prints the actual response envelope for schema inspection, without assuming an undocumented response shape or inventing a filter parameter. Select unresolved groups and obtain event identities in the adapter according to the current schema before handing observations to the outbox.
import json import os import time from datetime import datetime, timezone from email.utils import parsedate_to_datetime from urllib.error import HTTPError from urllib.request import Request, urlopen def poll_groups(): base = os.environ["OBSERVABILITY_BASE_URL"].rstrip("/") if not base.startswith("https://") or not base.endswith("/v1"): raise ValueError("Use the documented HTTPS v1 API base") for attempt in range(5): request = Request( base + "/errors/groups", method="GET", headers={ "Authorization": "Bearer " + os.environ["INFRAI_API_KEY"], "Accept": "application/json", }, ) try: with urlopen(request, timeout=20) as response: return json.load(response) except HTTPError as error: if error.code != 429 or attempt == 4: reason = error.read().decode("utf-8", errors="replace") raise RuntimeError(f"HTTP {error.code}: {reason}") from error retry_after = error.headers.get("Retry-After") delay = 2 ** attempt if retry_after: try: delay = max(delay, float(retry_after)) except ValueError: retry_at = parsedate_to_datetime(retry_after) delay = max( delay, (retry_at - datetime.now(timezone.utc)).total_seconds(), ) time.sleep(delay) if __name__ == "__main__": print(json.dumps(poll_groups(), indent=2)) The next runnable Python example isolates the part that must survive retries and application rollbacks: accepting an observation and recording a notification intent atomically. It also uses only the standard library. Its records are illustrative application-owned data, not an error API response schema. A cron poller supplies normalized observations to this handoff after checking unresolved groups and their events.
Run it as a Python script. It creates import-alerts.sqlite3 in the current directory, accepts the example observations, and reports the number of pending notification intents. Running it again leaves that count unchanged. It does not claim to send a message; the outbox is the durable input to the delivery worker.
import json import sqlite3 def accept_observations(connection, observations): with connection: for observation in observations: if observation["resolved"]: continue identity = json.dumps( [ observation["import_name"], observation["group_id"], observation["event_id"], ], separators=(",", ":"), ) inserted = connection.execute( "INSERT OR IGNORE INTO observations (identity) VALUES (?)", (identity,), ).rowcount if inserted: connection.execute( "INSERT INTO outbox (identity, payload) VALUES (?, ?)", (identity, json.dumps(observation, sort_keys=True)), ) def main(): observations = [ { "import_name": "seller-catalog", "release": "catalog-r18", "group_id": "group-feed", "event_id": "event-72", "resolved": False, }, { "import_name": "seller-catalog", "release": "catalog-r17", "group_id": "group-feed", "event_id": "event-73", "resolved": False, }, ] with sqlite3.connect("import-alerts.sqlite3", timeout=10) as connection: connection.executescript( "CREATE TABLE IF NOT EXISTS observations (" "identity TEXT PRIMARY KEY);" "CREATE TABLE IF NOT EXISTS outbox (" "identity TEXT PRIMARY KEY REFERENCES observations(identity)," "payload TEXT NOT NULL, accepted_at TEXT);" ) accept_observations(connection, observations) pending = connection.execute( "SELECT COUNT(*) FROM outbox WHERE accepted_at IS NULL" ).fetchone()[0] print(f"Pending notification intents: {pending}") if __name__ == "__main__": main() The duplicate insert and the outbox insert share a transaction. If insertion of a notification intent fails, the observation insertion rolls back too. A retry can accept it again. Keep this database on persistent storage outside an application's disposable release directory; a database file bundled into the release would defeat the invariant.
The example deliberately stores event identities rather than comparing their lexical order. Its two observations represent the same group across two releases, yielding two notification intents. Replaying either event produces no additional intent. Multiple tenants or environments need their namespace included in the identity before sharing a database. The small example is scoped to one import environment.
At the polling boundary, use explicit HTTP methods, a request timeout, and status checks. On HTTP 429, honor Retry-After when supplied and otherwise use exponential backoff. Failed reads must leave the scan checkpoint unchanged. Confirm request and response fields against the API schema instead of inferring names such as groups, id, or resolved from prose. The normalized fields above belong to the application adapter.
For a 60-second illustrative polling interval, a newly visible failure can wait nearly one interval before the next scan, before accounting for API visibility and delivery time. That is a scheduling consequence, not a measured service latency or an alerting guarantee. Keep cron's work bounded. If a scan or delivery backlog requires longer processing, let the scheduled trigger enqueue work for a persistent worker rather than holding the scheduled task open; keep any configured cron timeout at or below 900 seconds.
A notification retry is also a delivery policy
The outbox moves the failure boundary; it doesn't eliminate it. A delivery worker reads pending intents, sends through the chosen Slack, email, or webhook provider, and records provider acceptance. If the provider accepts a request and the worker crashes before recording that acceptance, the worker may send it again. Use the observation identity as the delivery idempotency key where the receiver supports one. Otherwise acknowledge the possibility of duplicate delivery and retain the same incident identity in both messages.
Acceptance isn't delivery.
For email, preserve the provider's receipt and delivery outcomes separately. An accepted request does not prove that a responder saw a message, and a spam-filtered notification is a poor foundation for an automatic rollback. Keep alert traffic distinct from customer OTP and transactional messaging in routing policy so retrying a broken import doesn't create a competing stream of urgent-looking customer messages. Send the minimum useful payload: import name, release, group, event, and an internal evidence pointer. Seller contact details and raw feed contents don't belong in a broadly visible Slack channel.
Before enabling rollback automation, exercise three controlled cases: replay one event after restarting the worker, introduce a new event in the same group after reversing a release, and stop successful-result heartbeats while the process remains alive. Expect one intent for the replayed event, a separate intent for the new event, and a distinct missed-progress signal for the third case. These are proposed acceptance checks, not reported test results.
Rejected option: let the alert decide the rollback
Reject automatic rollback based solely on “this group is unresolved.” A malformed seller feed can persist across releases, so that condition does not establish that reversing the application will restore results. Require release attribution and an application-specific recovery condition before granting an alert authority to change production state. For manual decisions, the same evidence makes the responder faster without pretending to prove causality.
Managed routing remains a valid choice when escalation, acknowledgment, and responder coverage dominate the team's needs. Use Sentry for its application-error workflow, PagerDuty for escalation ownership, or an existing combination that responders already operate. Keep the success heartbeat alongside it. The polling design earns its place only when the team can maintain the durable handoff and delivery policy, and when owning that evidence materially improves release reversal decisions.

