﻿# ZenML after dependencies: ordering a publisher does not pass it the validated model

Use ZenML after for explicit execution order while passing model and validation artifacts separately so publication does not rediscover a different latest artifact.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-zenml-after-control-dependency-not-data-reference/
Language: en

## Validation finishes before the wrong model is published

A pipeline validates a model, then schedules a publishing step after validation. The publisher independently looks up the latest model from storage. Another candidate appears between those operations, so publication can select a different artifact even though the requested execution order was respected.

The missing contract is data identity. Running after a validator establishes timing, but the publisher must still identify which model was validated and whether the validation outcome permits publishing that exact artifact.

## Data dependencies already impose order

The [advanced pipeline guide](https://docs.zenml.io/concepts/steps_and_pipelines/advanced_features) explains execution ordering from data dependencies and the explicit after parameter for additional ordering. Use these mechanisms for their respective purposes rather than assuming a control edge automatically carries an output value.

For this pipeline, make the model artifact an explicit publisher input. Include the validation result or eligibility decision according to the application's contract. The publisher should not need to infer the intended candidate from a mutable global latest reference.

## Artifact lineage expresses the value relationship

The [artifact guide](https://docs.zenml.io/concepts/artifacts) describes outputs consumed by later steps and the lineage relationships they create. A deliberate artifact edge records which value crosses the boundary. That evidence is stronger than a comment saying the publisher is supposed to use whatever the validator just checked.

Connect the candidate's components using an [artifact manifest](/journal/tokenizer-artifact-release-manifest/). A validation decision about weights alone may be insufficient if the deployed tokenizer or preprocessing configuration differs from the tested combination.

## Execution mode still matters

The [execution guide](https://docs.zenml.io/concepts/steps_and_pipelines/execution) distinguishes static graph scheduling from dynamic execution forms. Inspect the actual pipeline mode when reviewing dependencies. The conceptual requirement remains stable: wait for the relevant operation and consume the intended value under the supported API.

Ordering also does not make an external publication atomic. If the publication step performs several external mutations, failure between them needs its own handling. A correctly ordered start does not establish successful completion of every external effect.

## Test a competing candidate explicitly

Create a controlled example in which the storage location called latest changes after validation. Verify that the publisher still uses the explicitly supplied validated artifact, or deliberately rejects the mismatch under the chosen application contract.

[Terminal request consistency](/journal/provider-terminal-request-record-consistency/) offers a related distinction between ordering observations and establishing a logical final outcome. Clear control edges and clear data edges complement each other; together they make it possible to explain which model was actually validated and published.
