-
-
The table camera page; one laptop can watch several tables, each in its own tab
-
Joining the queue from the phone after scanning the TV's QR code, no app to install
-
The counter tablet: every table, the board, and staff tools to fix any call
-
A player's phone during a game: the last shot and whose turn it is
-
The whole backend is one n8n workflow (56 nodes) that also serves the app
-
The bar TV after a shot: the camera photo, the AI's call, the score and a tip
-
A disputed foul: play pauses and both players answer on their phones
-
A page for every bar: its tables, its queue and events to sign up for
-
The player app: the best table near you, the wait, and your rating
-
The bar app: start a game, open the bar TV, post an event
Inspiration
In most bars the pool queue is coins lined up on the rail or a name on a chalkboard. People get skipped, nobody knows how long the wait is, and when two players disagree about which ball was hit first, the louder one wins. We wanted a bar to run its tables fairly with what it already has: a TV, a phone, and a camera.
What it does
- Fair queue. Players scan the QR code on the bar TV, put their name on the board and get an email when their table is free. One tap checks them in. Winner stays on, up to three wins in a row while others wait.
- AI referee. A phone or webcam above the table sends photos of each shot to n8n; one laptop can watch several tables, each in its own tab. An AI vision model says which balls went in, which ball was hit first and whether the cue ball dropped. Plain code turns that into a 0-100 shot score with a tip and applies the 8-ball, 9-ball or 10-ball rules: turns, solids and stripes, fouls, ball in hand, the winner and Elo ratings. If the AI is unsure about a foul, play pauses and the players confirm on their phones; staff can correct any call from the counter tablet.
- For the bar. A TV screen with the live game, the photo and the AI's call after every shot and tonight's ratings, plus "Ask the referee", an AI agent that answers rules and queue questions from the house rules and the live board.
Why a bar would use it
- Staff stop running the queue by hand. Names, calls, check-ins and "who hit first" arguments are handled by the app; staff only step in when players disagree.
- Tables don't sit empty: a called player has 3 minutes to check in, then the next name on the board is called.
- Regulars come back for their rating, the ranks and the bar's events.
- It runs on what a bar already has (a TV, a phone or webcam, a laptop), and the AI costs about 0.2 US cents a shot.
How we built it
- One n8n workflow (56 nodes) is the whole backend and also serves the app: webhooks for the app, the camera, email buttons and questions; a rules engine in Code nodes with state in workflow static data; Anthropic image analysis and AI Agents on n8n's AI credits; Gmail from a background sub-workflow.
- The AI only describes what it sees. The score and every rule are code, so the same shot always gets the same ruling.
- Two apps served by the workflow itself: a player app for phones, and a bar app with the counter tools, the bar TV and the table camera.
- Branching: a Switch node sends every request (app, camera, email button, question) down its own branch; an If node decides whether emails go out, and they are sent from a background sub-workflow so nobody waits on Gmail.
- Error handling: if the AI call fails or its answer can't be read, the camera page says so in plain words and offers "Send a missed shot"; a shot the AI is unsure about pauses play for the players to confirm, and staff can undo any call.
- AI: an Anthropic image-analysis node reads each shot, and two AI Agents write the TV commentary and answer players' questions from the house rules and the live board.
Choosing the AI model
We didn't want to guess which model should referee, so we built a test inside n8n: 184 real shots cut from 10 public overhead pool videos, each labelled frame by frame, sent to 6 vision models through a second n8n workflow on n8n's AI credits, and scored exactly the way the live referee reads an answer.
- Claude Haiku 5.5 came out as the most cost-effective: at least as accurate as models up to ten times its price, at about 0.2 US cents a shot, so that is what Loopool uses. The whole test cost about $1.50 of n8n's AI credits.
- Seeing that a ball dropped is the easy part; naming it is the hard part. From above a ball is about 20 pixels wide, so models go by colour.
- Telling the model the table's ball colours made its calls clearly more accurate, so the camera page now asks for them.
Challenges we ran into
- Lost updates. n8n saves workflow state when a run ends. A shot spends about 15 seconds waiting for the AI, so a player joining or voting during that wait was overwritten when the shot finished. Now the AI run only reads, then hands the scored shot to a short run of its own (/pool-apply) that applies it to the current state.
- Shot detection on busy tables. The camera page decides when a shot starts and ends from how much of the picture changes. Our first rule scaled with the background movement the camera measured at startup, and on drill videos with an arm over the table it missed many shots. We replayed 10 hand-labelled videos through a copy of the detector, compared rules, and switched to fixed start and end levels, which caught far more; a "Send a missed shot" button covers the rest.
- n8n serves webhook pages in a sandbox that blocks browser storage, so a player's ticket rides in the page address instead.
Accomplishments that we're proud of
- A complete loop running on n8n Cloud: join, get called, check in, play with the AI referee, settle a disputed foul, update ratings.
What we learned
- Measure before choosing a model: a cheap model plus one line of context beat an expensive one.
- Keep AI to the one job it's good at (describing a photo) and keep the rules in code.
How it scales
- One laptop can watch several tables, each in its own tab.
- Each bar sets up its own page in the bar app, and a group of bars can run the same workflow file for each venue.
- For busy venues the state moves from workflow static data to n8n Data Tables or Postgres; the rules engine stays the same.
What's next for Loopool
- Zoomed crops of the spots that changed, so a stripe's white band and the printed number are visible.
- A test set with real fouls (ours has almost none) and real game footage.
Outside services, models and media
n8n Cloud and its AI credits; Anthropic, OpenAI, Google and Alibaba Cloud models through those credits; Gmail; Google Fonts; qrcodejs (cdnjs). Public YouTube footage from The Billiard Room by Jason Creglia and Misha's Billiards was used for testing; excerpts appear in the demo video and a few screenshots, credited, and the videos themselves are not redistributed. The demo video's narration is an AI copy of a team member's own voice, made with their consent using the open-source VoxCPM2 model run locally; the background music is "Slow Stride" by isaiah658 (CC0) and the sound effects were made by the team. AI coding assistants helped write and test the code. No templates.