Runs and turns
Starting a run creates it; a request opens its first turn. A run has no natural end: every later request opens another turn, and each turn reads the earlier ones as its history. The newest turn is the run’s tip, and at most one turn of a run is running or waiting at a time.
Turn states
Failed attempts and recovery
When an attempt fails, the turn records the failure and becomes Failed. Each failure counts once, whatever caused it: an unsuccessful result, a step that ran out of attempts, or a lost worker. At the deployment’s limit, three failures by default, the turn becomes Unrecoverable.
A resumed turn runs the same version of the workflow it opened on, and continues from the first step that did not finish. A turn that stops making progress for an hour, by default, is treated as a lost attempt.
Editing, forking, cancelling and deleting
Edit, fork and resume answer with the turn they affected. Asked for with Accept: text/event-stream, they follow that turn to its end instead.
How long a run is kept
A run is Permanent unless it is started with ?persistence=Ephemeral. A permanent run is kept until its owner deletes it. An ephemeral run, with everything it recorded, is deleted after 30 minutes without activity by default. An organization admits ephemeral runs only where its AllowEphemeralRuns setting is on; otherwise the run is stored as permanent.