In this article
Task retry protects execution progress but does not undo an external operation that completed before the failure became visible.
The result was published before the exception
A scoring task uploads a report to an external service, then fails while recording a later artifact. A retry sends the report again. The service now has duplicate entries even though Metaflow eventually exposes a successful task result. This is a partial-completion problem across systems, not proof that the scheduler executed an impossible sequence.
Identify every external mutation in the step. A database insertion, publication request and mutable storage overwrite can each have different replay behavior. Reading an immutable input is a different kind of operation.
Retry operates at a task boundary
The retry reference describes repeating failed tasks and explicitly cautions about operations that cannot be retried safely. A repeated Python function can reach the same external request again; there is no implied rollback of that request.
Choose the retry policy together with the publication contract. Disabling retries may avoid automatic repetition, but it does not resolve uncertainty about whether the initial request completed. Manual reruns can encounter the same ambiguity.
Visible artifacts are not an external transaction log
The failure handling guide explains which task results are visible after retries. That artifact view should not be interpreted as a complete inventory of external effects from earlier attempts. A discarded attempt can still have changed another service.
Connect the report to a logical operation identity, then make publication accept repeated delivery according to the destination’s actual API. Terminal request consistency provides a related distinction between a logical outcome and transport-level observations.
Record attempts without changing logical identity
The current API exposes the task path and retry count. These help diagnose execution attempts. They do not automatically provide a suitable business-level deduplication key for every destination or for later resumed runs.
Keep the logical report identity stable where repeated publication should mean the same operation. Store attempt metadata separately. If each retry invents a new report identity, a destination cannot recognize duplicates merely because the underlying content looks similar.
Exercise the ambiguous failure window
Test a controlled failure after the destination accepts publication but before the step completes. Verify the destination’s resulting state after retry and inspect how the final artifact refers to it.
Also distinguish publication success from stream success accounting when the report summarizes API work. Repeating a workflow task must not silently add the same completed requests to an aggregate twice or convert missing evidence into successful observations.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.