Getting Started•Developer•Advanced

How Conversora handles requests

A developer overview of request handling, data access, and background work. Check the current repository configuration for implementation details.

7 min read•Updated 2026-09-18
In This Guide
  • The web application uses Cloudflare Workers with OpenNext; response time depends on the route, cache state, region, and connected services.
  • Data access depends on the configured database and connection path.
  • Store access is scoped by application authorization and data-access rules; review the current implementation before relying on a specific boundary.
  • Some background jobs use queues to process work outside the initial request; delivery and retry behavior depends on each integration.
Prerequisites

Before configuring this feature, confirm that your store meets the following requirements:

Technical Background:Helpful for engineering leads, developers, and technical store architects wanting to understand system reliability.

1. Edge Serverless Execution with Cloudflare Workers

Cloudflare Workers run application code on Cloudflare’s network. OpenNext adapts the Next.js application for this runtime. Which parts of a page are cached or rendered dynamically depends on the route and deployment configuration.

Using an edge runtime does not guarantee a particular page speed or conversion result. Measure the live route and inspect its cache and data dependencies when investigating performance.

1

Edge Route Resolution

Customer hits custom domain or conversora.io storefront URL. Cloudflare Anycast routes the request to the closest physical edge node.

Path:Browser Request → Cloudflare Edge PoP
2

V8 Isolate Execution

The application code runs in Cloudflare Workers. Runtime duration varies with the request and work performed.

Path:Worker Runtime → Next.js App Router

2. Asynchronous Queue Pipelines & Reliability

When a merchant's social post goes viral, hundreds of customers may send DMs within seconds. If an e-commerce platform tries to generate AI responses synchronously inside the incoming webhook request, Meta’s webhook gateway will time out after 5 seconds, resulting in dropped messages.

Conversora uses Cloudflare Queues to buffer incoming traffic safely: - conversora-ai-queue: Buffers incoming social messages and customer chat events. - conversora-db-queue: Batches analytics telemetry, message read receipts, and click tracking to prevent database lock contention. - conversora-outbound-meta-queue: Controls outbound message transmission to Meta Graph API, respecting Meta’s rate limits with exponential backoff and jitter.

1

Webhook Ingestion

The webhook checks the request signature and may place the event in a background queue. Processing time can vary.

Path:POST /api/webhooks/meta → conversora-ai-queue
2

Queue Consumption & AI Inference

Worker processes messages in batches, pulls catalog context, runs LLM reasoning, and queues the outbound response.

Path:conversora-ai-queue → Worker → LLM Engine
Tenant Isolation Security Pattern
// Strict multi-tenant query pattern
export function tenantDb(storeId: string) {
  return {
    product: {
      findMany: (args) => prisma.product.findMany({ ...args, where: { ...args?.where, storeId } }),
      findUnique: (args) => prisma.product.findFirst({ ...args, where: { ...args?.where, storeId } })
    }
  };
}

Practical Business Scenarios

How leading merchants implement this functionality in daily operations:

Viral TikTok / Instagram Reel Traffic Surge
Situation: A merchant receives a sudden increase in storefront visits and social messages after a product is shared.
Best practice: Check page caching, queue configuration, provider limits, and error logs. Do not assume requests or messages are handled without delay or loss.

Troubleshooting & Common Issues

Diagnose and resolve frequent failure points quickly:

Problem: Database query latency spikes during high-concurrency promotions
Why this occurs: Direct database connections are bypassing the Hyperdrive connection pooler.
Resolution: Verify that production environment variables route through env.HYPERDRIVE rather than direct unpooled connection strings.

Frequently Asked Questions

How is store access separated?

Access is controlled in the application. The exact protections depend on the current server-side authorization and data-access code. Review those checks for each feature; this overview is not a security guarantee.