Skip to content
event-driven · BullMQ · multi-AZ · idempotent · audited

The system, not the sales pitch.

How Sumeru Systems is actually built — event ingest, BullMQ workers, multi-tenant data plane, self-throttling helpers, snapshot-and-undo. With actual code from the runtime.

By the runtime

Production scale. Audited. Observable.

P95 60s
Event → action
99.99%
Uptime · 90d
365d
Audit retention
Multi-AZ
Deployment
AES-256
At rest
0 bytes
Cross-tenant exposure
01 System overview

One block diagram. No abstractions left out.

If you can't draw it, you can't operate it. Here's the entire production runtime.

SOURCE LAYER Shopify webhooks · orders GSC API queries · pages · AI Ad platforms Google · Meta · TikTok Storefront pixel · CWV · events WhatsApp inbound · receipts Public API webhooks · 3rd-party DATA PLANE · idempotent ingest · per-shop scope · BullMQ event bus webhook normalization · idempotency keys · schema-level tenancy INTELLIGENCE PLANE · attribution · decay · anomaly · recommendation 7 attribution models · Z-score baselines · cohort retention · NBA DECISION PLANE · 18 typed events · 13 actions · snapshot + undo dispatcher · cooldown + quiet hours · approval queues · audit log ACTION PLANE · self-throttling helpers · provider buckets · cost gates Shopify GraphQL · Ad APIs · WhatsApp · email · public API · audit
02 Emit site · seo-engine

Detection emits a typed event.

Detection paths (decay, score drop, anomaly, opportunity) emit autoaction events. Fire-and-forget; emit failure can never block the detector.

seo-engine/decay-detector.server.js js
// app/lib/seo-engine/decay-detector.server.js
const findings = await detectDecay(shop, runs);
if (findings.length > 0) {
  const { emitAutoAction } = await import("../autoactions/dispatcher.server.js");
  const { EVENTS } = await import("../automations/events.js");
  await emitAutoAction({
    shop,
    triggerEvent: EVENTS.SEO_CONTENT_DECAY_DETECTED,
    resources: findings.slice(0, 50).map((f) => ({
      resourceType: "page",
      resourceId:   f.page,
      payload: { dropPct: f.dropPct, priorClicks: f.priorClicks, nowClicks: f.nowClicks },
    })),
  });
}
03 Action handler · refresh-blog-post

Every action: meta + snapshot + handler + undoHandler.

A four-function contract. Adding a new action means dropping a file in app/lib/autoactions/actions/ and registering it. The dispatcher discovers it automatically.

autoactions/actions/refresh-blog-post.server.js js
// app/lib/autoactions/actions/refresh-blog-post.server.js
export const meta = {
  key:           "refresh_blog_post",
  triggerEvents: ["seo.content_decay_detected"],
  resourceType:  "page",
  requiredPlan:  "pro",
  paramSchema:   [
    { key: "minDropPct", type: "number", default: 30, min: 10, max: 90 },
  ],
};

export async function snapshot(shop, resourceId) {
  const content = await prisma.seoContent.findFirst({
    where:  { shop, urlSlug: deriveSlug(resourceId) },
    select: { id: true, status: true, content: true },
  });
  return { contentId: content?.id, prevStatus: content?.status, prevContent: content?.content };
}

export async function handler(shop, resourceId, params, ctx) {
  const before = await snapshot(shop, resourceId);
  if (!before.contentId) return { skipped: "not_found" };
  const queued = await queueContentRefresh(shop, before.contentId, { _manual: true });
  return { refreshQueueId: queued.id, scheduledFor: queued.scheduledFor };
}

export async function undoHandler(shop, resourceId, before) {
  const pending = await prisma.blogRefreshQueue.findFirst({
    where: { shop, contentId: before.contentId, status: "pending" },
  });
  if (!pending) return { undone: false, reason: "already_processed" };
  await prisma.blogRefreshQueue.update({
    where: { id: pending.id },
    data:  { status: "cancelled" },
  });
  return { undone: true, refreshQueueId: pending.id };
}
04 Outbound webhook · /your-endpoint

Subscribe via outbound webhook.

Every applied action fires an outbound webhook to your endpoint. Signed with HMAC-SHA256, retry with exponential backoff, dead-letter after 4 attempts.

POST /your-endpoint json
// inbound webhook payload (your endpoint)
{
  "event": "autoaction.applied",
  "eventId": "evt_a8c4f...",
  "shop": "yourshop.myshopify.com",
  "ruleId": "rule_19fc...",
  "ruleName": "Refresh decaying blog posts",
  "actionKey": "refresh_blog_post",
  "resourceType": "page",
  "resourceId": "/products/my-blog-post",
  "after": { "refreshQueueId": "q_4f...", "scheduledFor": "2026-05-10T18:24:00Z" },
  "occurredAt": "2026-05-10T18:23:42Z"
}
05 Operational maturity

What's running in production.

P95 <60s
Event-to-action latency
99.99%
Trailing 90-day uptime
365 days
Audit log retention
3
BullMQ workers per concurrency
Multi-AZ
Database deployment
AES-256
Encryption at rest
TLS 1.3
Encryption in transit
145
Permissions in RBAC catalog
0 bytes
Cross-tenant data exposure

Want a deeper architecture review?

Our engineering team runs a 60-min technical deep-dive for prospective enterprise customers. Whiteboard, runtime walkthrough, Q&A on the specific primitives above.