Validate at the boundary
The single most effective structural change to an automation is checking the input before anything acts on it, rather than discovering the problem four steps later.
Why this matters more here than in ordinary code. A flow that fails at step one has done nothing. A flow that fails at step five has done four things, and the previous lesson established that partial completion is where the damage lives. Validating first converts most partial failures into clean ones.
What to check at the boundary.
Required fields are present. Not merely defined, but actually populated, because an empty string is present and useless.
Types are what you expect. A number that arrived as text will silently break arithmetic later, or worse, will concatenate.
Values are in range. A quantity of negative four, a date in 1900, a price of zero. These pass every structural check and are wrong.
Identifiers resolve. If the payload references a customer, does that customer exist? Discovering that at step six means five steps ran against a record that is not there.
And the payload is the shape you expected at all, which catches the case where an upstream service changed and you are now receiving something different.
What to do when validation fails. Stop, record the input that failed and why, and notify someone. The temptation is to continue with a default value, and that is how bad data enters systems quietly. A flow that halts loudly on unexpected input is behaving correctly.
The practical shape. First step after the trigger is a validation branch. Everything else lives on the valid path. This costs one step and prevents most of the expensive failures.

