Product architecture

From customer order to received blanks — automated end to end.

StitchFlow orchestrates Printavo, S&S Activewear and SanMar through a deterministic rules engine. Every step is observable, overridable, and auditable.

End-to-end flow
1

Printavo Sync

GraphQL poll for orders hitting trigger status.

2

Rules Engine

Group, route and prioritize line items by SKU & vendor.

3

Stock Check

S&S REST + SanMar SOAP calls confirm availability.

4

Review Queue

Production approves drafts before placement.

5

PO Placement

Submit to vendor APIs, store confirmations.

6

Receiving + Risk

Checklists, due-date risk, write-back to Printavo.

Rules engine
flow:
  on(order.status == "Approved - Pending Materials") {
    items = expandLineItems(order)
    grouped = groupBy(items, "vendor")
    for (vendor, lines) in grouped {
      stock = vendorStockCheck(vendor, lines)
      draft = buildPO(vendor, stock.fulfillable)
      if (draft.total < $250) hold(draft)
      else queueForReview(draft)
    }
    flagRisk(order, expectedDates)
  }

Rules are versioned and editable per workspace. Disabled rules retain audit history.

System diagram
  ┌──────────┐    GraphQL    ┌──────────────┐
  │ Printavo │ ─────────────▶ │  Sync Worker │
  └──────────┘                └──────┬───────┘
                                     ▼
                              ┌──────────────┐
                              │ Rules Engine │
                              └──────┬───────┘
                  ┌──────────┬──────┴──────┬───────────┐
                  ▼          ▼             ▼           ▼
              ┌───────┐  ┌───────┐    ┌────────┐  ┌────────┐
              │  S&S  │  │SanMar │    │Review  │  │ Risk   │
              │ REST  │  │ SOAP  │    │ Queue  │  │ Engine │
              └───┬───┘  └───┬───┘    └────┬───┘  └────┬───┘
                  └────┬─────┘             │           │
                       ▼                   ▼           ▼
                ┌─────────────┐      ┌──────────┐  ┌─────────┐
                │ PO Placed   │ ───▶ │Receiving │─▶│Printavo │
                │ + Tracking  │      │Checklists│  │Write-back│
                └─────────────┘      └──────────┘  └─────────┘

Deterministic

Same input always produces the same draft POs. Every decision logged.

Override-friendly

Production can edit, split or reject any draft before placement.

Vendor-aware

Lead times, cutoffs and success rates inform routing automatically.