Sorting website form enquiries with an LLM that can only answer from a list
Contact forms collect everything: real sales leads, support questions, partnership pitches, job applications and a steady drip of spam. Someone has to read each one and decide where it goes. An LLM can do that sorting, but if you let it answer freely you get categories like "Potential Sales Inquiry (High Value)" one day and "sales lead" the next, and your spreadsheet filters stop working. So I built a small n8n workflow where the model gets a fixed list of category ids and may answer with one of them or null. Anything else is treated as a failure. The category list lives in one Code node called Settings (edit me), something like sales_inquiry, support, partnership, job_application, spam, other, each with a short description and a priority. The prompt and the check both read from that node, so you can't end up with a prompt that mentions a category the check doesn't know. An HTTP 500…