Skip to content

Scenarios Overview

These scenarios follow the OAGi ConnectSpec pattern — each defines participants, assumptions, a business workflow, and exception handling. They serve as the Operational Analysis (OA) layer in the Arcadia method, directly traceable to logical components and physical infrastructure.

Each scenario page includes:

  • API endpoints — concrete paths mapped to OpenAPI specs
  • Schema tables — PlanetScale tables read or written
  • Infrastructure — CF Workers, Pipelines, Queues, and storage involved
  • Participants — actors and services
  • Workflow steps — the main success path and exception handling
ScenarioTriggerPrimary actorsKey tables / storageWhat it does
Daily Shopify Bulk SyncCron (daily) or manualCron, CF Workflow, Shopify APIorder_header, order_line_item, product (PG); sync.telemetry (R2); watermarks in DOAcquires order data and streams to pipelines
Product Tag SyncManual (“Sync Tags”)Staff, CF Workflow, Shopify APIproduct, product_tagUpdates product attributes (tags, vendor, status)
Asset IngestStaff submits artifact + URLStaff, CF Workflow, Dropbox, R2, Shopifymacrodata_artifact (kind: design_asset), link_product_macrodata_artifactIngests design assets to R2, links to products
CSV ExportStaff requests exportStaff, CF Workflow, R2macrodata_artifact (kind: document_export), order_headerGenerates downloadable export file
Fulfillment MonitoringRead-only (data from daily sync)Fulfillment teamfulfillment_daily_summaryDaily fulfillment metrics (success/failure rates)
ScenarioTriggerPrimary actorsKey tables / storageWhat it does
Performance MetricsBrowsing + settingsOps/Creative, Dashboard APImeasurement.performance (R2 Iceberg), macrodata_artifact (kind: classification_spec)Metrics retrieval; classification thresholds govern tier assignment
Tag AnalyticsBrowsing + refreshCreative/Ops, Dashboard APIproduct, measurement.sales (R2 Iceberg), product_tagAggregated sales metrics by tag
Tag GroupsStaff creates/edits groupsCreative/Ops, Dashboard APIproduct_categoryCRUD on tag group collections
Tag ClassificationStaff bulk-classifies tagsStaff, Dashboard APIproduct_tagAssigns tags to product collections
Designer AssignmentStaff assigns tags to designersCreative lead, Dashboard APImacrodata_artifact (kind: agent_assignment), product, measurement.sales (R2)Links designers to tags for sales attribution
ScenarioTriggerPrimary actorsKey tables / storageWhat it does
Combo Log CRUDStaff creates/imports combosStaff, Dashboard APImacrodata_artifact (kind: combo_report)Report lifecycle management
Combo TemplatesStaff manages template libraryCreative, Dashboard APImacrodata_artifact (kind: combo_template)Template library with action specs
Combo SuggestionsStaff requests generationStaff, CF Workflowmacrodata_artifact (kinds: combo_suggestion, combo_report), measurement.performance (R2)Auto-generates combo suggestions with confidence scores
ScenarioTriggerPrimary actorsKey tables / storageWhat it does
Order LookupStaff searches by ID/nameStaff, Dashboard APIorder_header, order_line_itemSearch and retrieve order records
ScenarioEndpointsAuth
Bulk SyncPOST /api/performance-metrics/sync, GET /api/ingest/runs, GET /api/healthCF_ACCESS
Tag SyncPOST /api/products/tags/sync, GET /api/products/tags/sync/statusCF_ACCESS
Performance MetricsGET/POST/PUT/DELETE /api/performance-metrics, GET /api/performance-metrics/stats/summary, GET/PUT /api/performance-metrics/settings/classificationCF_ACCESS
Tag AnalyticsPOST /api/tag-analytics/performance, GET /api/tag-analytics/distribution/:category, GET /api/tag-analytics/group-performance/:groupId, POST /api/tag-analytics/refreshCF_ACCESS
Tag GroupsGET/POST /api/tag-groups, DELETE /api/tag-groups/:groupIdCF_ACCESS
Tag ClassificationPOST /api/tag-classifications/bulk, GET /api/tag-classifications/unclassifiedCF_ACCESS
Designer AssignmentGET /api/designers, GET /api/designers/names, POST /api/designers/assign, DELETE /api/designers/unassign, DELETE /api/designers/:designerNameCF_ACCESS
Combo CRUDGET/POST /api/combo-logs, PUT/DELETE /api/combo-logs/:id, POST /api/combo-logs/import, GET /api/combo-logs/exportCF_ACCESS
Combo TemplatesGET/POST /api/combo-templates, DELETE /api/combo-templates/:templateIdCF_ACCESS
Combo SuggestionsPOST /api/combo-suggestions/generate, GET /api/combo-suggestions, POST /api/combo-suggestions/:id/acceptCF_ACCESS
Asset IngestPOST /api/assets/ingest, GET /api/assets/:productId, GET /api/assets/status/:productIdCF_ACCESS
CSV ExportPOST /api/csv/generate, GET /api/csv/exports, GET /api/csv/exports/:idCF_ACCESS
Order LookupPOST /api/orders/lookupCF_ACCESS
FulfillmentGET /api/fulfillment-daily-summaryCF_ACCESS

All endpoints are staff-only, protected by Cloudflare Access. JWT validation uses the Cf-Access-Jwt-Assertion header (cookie is not guaranteed).

Scenarios using CF Workflows for workflow execution (ProcedureExecution) dispatch assume:

  • Durable step tracking with automatic retries and replay
  • Watermark state in Durable Object persistent storage
  • Execution audit trail via SYNC_TELEMETRY Pipeline → sync.telemetry on R2
  • Error events emitted to sync telemetry for long-term retention

All PG domain writes must respect PlanetScale limits: 100k rows per statement, 64 MiB result size, 20s transaction timeout.

These one-time or maintenance workflows exist in the codebase but don’t warrant standalone scenarios:

ScriptPurposeFrequency
Shopify OAuth callbackOne-time token exchange for permanent offline accessOnce
Asset backfillBatch-process existing Dropbox links into R2 objectsOne-time migration
Metafield auditCompare Dropbox links vs product-asset linksAd-hoc diagnostic
Asset retry / cleanupRetry failed Workflows, fix content types, delete old artifactsAd-hoc maintenance