for (const step of run.data.steps) {
if (step.warnings?.length) console.warn(step.id, step.warnings);
}for step in run.data["steps"]:
if step.get("warnings"):
print(step["id"], step["warnings"])What produces one
| Situation | Typically |
|---|---|
| A result was clipped | A step returned more than a run carries. |
| A value was not the shape expected | A template read something that was not there. |
| A service answered partially | Part of the work was done. |
| A setting was not honoured | The step asked for something the service does not do. |
A warning is the thing that explains a later failure
A step that clipped its output succeeds; the step reading it fails two steps later on a value that is not there. Reading warnings is how that becomes one problem instead of two.
Surface them in the run
const problems = run.data.steps
.filter((s) => s.warnings?.length)
.map((s) => `${s.id}: ${s.warnings.join("; ")}`);
if (problems.length) notify(problems);problems = [f"{s['id']}: {'; '.join(s['warnings'])}" for s in run.data["steps"] if s.get("warnings")]
if problems:
notify(problems)runStep() reports them too
Testing a step shows its warnings before the chain is deployed — which is the cheapest place to notice one.
They are not errors
error is a step that failed. warnings is a step that worked and has a reservation. Treating one as the other makes a run look broken or makes a real problem invisible.