Unit 04.00: What actually needs to travel between steps
State is what survives from one step to the next. Deciding what goes in it is a design decision, not an accumulation.
Two questions per field
Could it be written down and read back? And would resuming be wrong without it?
The table below sorts seven candidates.
CANDIDATE CARRY? WHY
the original request yes needed to resume
invoice id and contract id yes small, and they re-fetch the rest
full text of both documents no large; the ids retrieve it again
the decision so far yes resuming is wrong without it
every intermediate draft no only the current one matters
the API credential no a secret; not state
attempts, already-acted flags yes resuming is wrong without them
4 of 7 travel
The credential fails both tests in the way that matters: it could technically be serialised and must not be, because state gets written to a store and a store is a place secrets then live.
The document text is the interesting case. It serialises fine and resuming works without it, because the ids re-fetch it. Carrying it anyway is the most common way a state object becomes large enough to be a problem.
The mistake this prevents
The mistake is putting the whole response of every step into state because it might be useful. State is passed to every subsequent step and written at every checkpoint, so "might be useful" is paid for repeatedly.
Takeaway
Carry what resuming requires and nothing else: ids over contents, never credentials, nothing that cannot be written down.
