Work / Case study 04 of 04
A morning digest that has already read every idea
A daily Power Automate flow that has a language model classify each new improvement idea into structured JSON, then writes one digest email for the team.
- Dailyone digest email
- 2model calls with separate jobs
- JSONfixed picklists, no free text
- 01Daily scheduleYesterday’s submissions
- 02Sanitise fieldsSafe to embed in JSON
- 03Call 1: classifyOne idea at a time
- 04Call 2: write digestWhole set as HTML
- 05Team inboxOne card per idea
Problem
A team receives improvement ideas and requests through an intake tracker. Triage meant someone reading every submission to decide what kind of work it was, how urgent it was, and what to ask the person who submitted it. That chore came back every time new ideas arrived.
Process
For each idea, the job is three decisions and a short brief:
- Classify with exactly one category, one sub-category and one of four priority levels, chosen from fixed picklists. The model may not invent values.
- Brief leadership with a short summary, a difficulty rating with a one-sentence reason, and only the questions the submitter can answer. The model is told about the team’s existing solutions, so it doesn’t ask things the developers already know.
- Hand off as one email to the team, with one card per idea.
Build
A scheduled cloud flow collects the previous day’s submissions and loops over them. Each idea’s fields are cleaned and sent to a language model, which must return raw JSON in a fixed shape: category, sub-category, priority, reasoning and an analysis block. Because the shape is fixed, the flow can merge the result with the original row without parsing free text. The reasoning field makes every classification explainable.
A second call receives the whole set and only handles presentation. It follows an email-safe HTML template, repeats one card per idea, colours the priority badge and adds a short greeting with the day’s count. Splitting judgement from presentation keeps each prompt small, and the digest call never needs to know the taxonomy.
What I learned
Most of the debugging was about text, not AI. Free-text fields, and even the stored instructions, contained quotes and line breaks that broke hand-built JSON request bodies. One version failed with an HTTP 400 until the quotes were escaped. Sanitising inputs fixed it. Building request bodies with a JSON-aware expression instead of string concatenation is the more durable fix.
Screens use demo or synthetic data. Names, identifiers and internal systems are invented, generalised or blurred. Numbers are approximate.

