Quick overview
This workflow runs limited Shopify drops by collecting waitlist entries via webhooks, scoring and filtering bots with OpenAI, drawing size-based winners with weighted randomness, sending expiring claim links via WhatsApp or Gmail, and continuously sweeping expiries while tracking everything in Google Sheets and notifying Slack.
How it works
- Receives waitlist signups via a POST webhook, normalizes the entry, and checks in Google Sheets whether the selected drop and size are currently open.
- Looks up prior entries and member history in Google Sheets and pulls Shopify customer order counts to calculate loyalty weight and bot-risk signals.
- Uses rules and, for borderline cases, OpenAI (gpt-4o-mini) to classify entries as accepted, review, or rejected, then saves the result to the Entries sheet and returns a JSON confirmation.
- Every 5 minutes, checks Google Sheets for drops that have closed, loads stock by size, performs a seeded weighted draw to assign invited winners and backup reserves, and sends WhatsApp Cloud API templates or Gmail messages (with signed, expiring claim links) to each entrant.
- Updates entry and member status in Google Sheets, marks the drop as drawn, and posts a draw summary with an audit code to Slack.
- When a winner clicks the claim-link webhook, verifies the signed token and expiry, creates a Shopify draft order, updates the entry with invoice URL and payment deadline, and redirects the fan to Shopify checkout.
- Every 10 minutes, sweeps Entries in Google Sheets to expire unclaimed invites, detect paid vs unpaid Shopify draft orders, delete unpaid drafts, and promote the next eligible backup to invited status with a new claim deadline.
Setup
- Create a Google Sheets file with Drops, Drop Stock, Entries, and Members tabs and replace all REPLACE_WITH_GOOGLE_SHEET_ID placeholders and required column names used by the workflow.
- Add Shopify Admin API credentials (HTTP Header Auth) for your store and ensure the app has permissions to read customers and read/write draft orders, then set your shop domain in Set Drop Config.
- Add a WhatsApp Cloud API token (HTTP Header Auth) and set wa_phone_number_id plus approved templates (drop_invite, drop_reserve, drop_next, drop_teaser) in Set Drop Config.
- Connect OpenAI credentials (for gpt-4o-mini), a Gmail account (for fallback email sends), and Slack credentials, then set the target Slack channel ID.
- Update Set Drop Config with your n8n domain for claim_webhook, change the secret used to sign claim links, and configure your website form to POST to the drop-join webhook and link winners to the drop-claim webhook.