Backbone of the Oral Draw system.
This function is the backbone of the Oral Draw system. It runs on a schedule (every 5 minutes by default) and processes sessions whose deadline has passed:
- If volunteers signed up → picks one at random, marks the session as
picked, and saves the winner's name and user ID - If nobody signed up → marks the session as
failed - Sessions that are already
picked,failed, orlockedare ignored
| Variable | Description |
|---|---|
APPWRITE_ENDPOINT |
Appwrite API endpoint (e.g. https://cloud.appwrite.io/v1) |
APPWRITE_PROJECT_ID |
Your Appwrite project ID |
DATABASE_ID |
Your Appwrite database ID |
APPWRITE_API_KEY |
API key with databases.read, databases.write, rows.read, rows.write scopes |
- Node.js 21 or higher
- Appwrite Cloud (free tier is sufficient)
- A
sessionsandsignupscollection — see the main repo README for the full schema
See Option A, B, or C in the main README for deployment instructions.
- The function is stateless; all state lives in the Appwrite database
- Safe to run frequently — sessions that have already been processed are skipped