AI workflow failure: how do you know whether the model, prompt, data, or API is at fault?
A production diagnostic playbook using traces, replay, and one-variable tests to separate model, prompt, data, API, and orchestration failures.

To determine whether an AI workflow failed because of the model, prompt, data, or API, do not begin by switching models or rewriting the prompt. Preserve one reproducible execution, split its trace into layers, and change exactly one variable per replay. If the request never reached the model, the model is not the cause. If the model returned the right result but parsing or the destination API failed, prompt work will not solve the incident.
A reliable diagnostic process has four steps: locate the first failure → distinguish technical failure from quality failure → replay a frozen input → run controlled tests for each hypothesis. Production also needs a fifth category beyond the four in the question: workflow orchestration and state. Mapping, branching, queues, timeouts, retries, parsers, and state persistence can break a run even when both the model and APIs behave correctly.
Error taxonomy
Define failure by layer before investigating
An HTTP 500, schema-invalid JSON, and a low-quality answer are different incidents.




