HQ · OPERATIONS PLATFORM · 15-STORE ECOMMERCE GROUP

Three automations running unattended

Scheduled jobs written in JavaScript/TypeScript, kept in GitHub. Every one is built to stop safely, not guess.

▶ Live replay of each job with sample orders and posts

← hazzelmay.hazzahub.com
1

Supplier auto-buy

A paid customer order is bought from the supplier automatically
Runs hourly
Schedule
Every hour at :44One job, its own minute
Read
Paid orders to buyPayment captured only
Safety check
Supplier variant confirmed by a personNo guessing the product
Safety check
Never at a lossLanded cost vs price, at today's exchange rate
pass
Act
Place the supplier orderMax 10 per store per run
fail
Stop
"Needs you" listOne attempt, then a person decides

What I coded

  • The checks, the cost and profit maths
  • The supplier API order call

Safe to run unattended

  • Buys only on captured payment, confirmed variant and a profit
  • One automatic attempt per order; any refusal waits for a person
  • Capped at 10 buys per store per run
2

Nightly supplier stock check

Hides products the supplier no longer sells, without false alarms
Every 2h · 3–8am Manila
Schedule
Every 2 hours, 3–8amQuiet hours only
Batch
160 listings dueEach read about once a day
Queue
One supplier call per secondShared across all of HQ
Safety check
Gone 3 times over 24h?One error is not "gone"
yes
Act
Hide the productMax 5 per store per run
no
Keep
Keep it liveNote the answer, check again

What I coded

  • The shared call queue and batching
  • The rules for what counts as "gone"

Safe to run unattended

  • Built after a rate-limit wrongly hid 413 products across 7 stores
  • 3 "doesn't exist" answers over 24 hours before anything is hidden
  • At most 5 hidden per store per run, only in quiet hours
3

Social publishing with AI checks

Approved posts go out to Facebook and Instagram at their time slot
Every 15 min
Schedule
Every 15 minutesPosts whose slot has arrived
Claude API
AI pre-check in reviewFlags issues before a person decides
Human approval
Approved by a personNothing posts without it
image
Publish
Facebook + InstagramResult saved on the post
reel
Async
Upload → wait → publishStatus checked 2s up to 8s
error
Stop
3 attempts, then it stopsHolds the error for a person

What I coded

  • The scheduler and the per-platform routing
  • The async Reels flow and the Claude API step

Safe to run unattended

  • Claude pre-checks each post in review, then a person approves it
  • 3 failed attempts and the post stops retrying and waits for a person
  • A broken account connection sends one alert per store per day
Hazzel May Bastida · hazzelbastida@gmail.comDiagrams of live HQ jobs. Code and keys are private.