PRODUCTION SCENARIO
A team uses Claude to turn natural-language questions into SQL. An internal database engine can run EXPLAIN on a candidate query and return syntax errors and index warnings automatically.
Which workflow pattern should the team build around this validator?
Answering here is anonymous. Nothing is saved unless you sign in.
Show answer and explanation
Answer: Evaluator-optimizer, where the validator's output feeds the next generation call
In the evaluator-optimizer pattern one call generates while another evaluates and feeds back in a loop, and it fits best where the evaluation criteria are clear, which is what an EXPLAIN result gives. Prompt chaining passes the draft forward once and never sees the validator, so a bad query stays bad. Parallel voting returns the most popular candidate rather than the one the database accepts. Orchestrator-workers splits a task into pieces, but one query needs iteration, not decomposition.