<#1362 Artifacts and Artifact-Triggers> Pull reque...
# flyte-github
a
#1362 Artifacts and Artifact-Triggers Pull request opened by kumare3 Summary Stacked on
artifacts
. Adds the third
Trigger
automation type alongside
Cron
and
FixedRate
— fire a run when a new version of a named artifact is created: retrain = flyte.Trigger( name="retrain-on-new-model", automation=flyte.OnArtifact(name="customer_model"), # any new version inputs={"model": flyte.TriggeredArtifact, "threshold": 0.5}, ) @env.task(triggers=[retrain]) async def consumer(model: File, threshold: float = 0.5) -> str: ... •
OnArtifact(name, version=None)
— watch an artifact by name; a version pin fires only on exactly that version •
flyte.TriggeredArtifact
sentinel binds the triggering artifact's value to one task input (the artifact-trigger analogue of
TriggerTime
); other inputs keep their registered defaults, offloaded exactly as schedule triggers do today • Serde emits
TriggerAutomationSpec(TYPE_ARTIFACT, ArtifactTrigger{artifact_name, version, input_arg})
with the sentinel key as
input_arg
, validated against the task interface; no kickoff context key is emitted — the backend fire step (leaseworker plugin) injects the real literal into the offloaded inputs • Cross-validation at construction: at most one sentinel, sentinel requires
OnArtifact
,
TriggerTime
rejected on artifact triggers •
flyte get trigger
/ rich repr render
on artifact: name@version -> input
• Runnable example:
examples/triggers/artifact_trigger.py
Dependencies • Protos: flyteorg/flyte#7749 (
TYPE_ARTIFACT
+
ArtifactTrigger
). CI will fail on the new serde tests until a flyteidl2 release carries it and the pin is bumped — developed against a local wheel build. • Backend stack: unionai/cloud#17381–#17385. E2E-verified on devbox: deploy → producer publishes a new version → downstream run fires with the artifact bound to
model
and
threshold=0.5
from the trigger defaults; republishing the same version does not re-fire. 🤖 Generated with Claude Code flyteorg/flyte-sdk