Workflow definition

Warnings

A step can succeed and still have something to say. Warnings are per step, they never fail a run, and they are usually the first sign of a chain drifting.

per stepnever fail a runworth surfacing
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

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

SituationTypically
A result was clippedA step returned more than a run carries.
A value was not the shape expectedA template read something that was not there.
A service answered partiallyPart of the work was done.
A setting was not honouredThe 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.