
5 Ways to Use the New Metaflow Tags
Metaflow has supported a limited form of tagging via the run --tag
option since its initial open-source release. Thus far it hasn't been possible to mutate tags after a run has completed, which has limited the usefulness of tagging.
We are excited to announce that this restriction has been lifted in the latest Metaflow release 2.7.0 🎉 You are now able to mutate tags freely, which opens up a vast landscape of new use cases for tagging. This article features five such prototypical use cases which have proven to work well at Netflix that has actively leveraged mutable tags for years.
To benefit from mutable tags, make sure your Metaflow version is at least 2.7.0. If you use the metadata service, upgrade the service to the latest version as well. No database migrations are required.
Basic Tagging
Let's start with a basic use case that is familiar from many other tools: Manually attaching tags as human-readable annotations to objects, in our case to Metaflow runs. In this case, tags are used to organize, find, and share results.
In the illustrations below, gray boxes refer to Metaflow runs, 👀 to people taking actions, ⚙️ to production systems that work without human supervision, and yellow labels to tags.

Here's the idea:
- Run Metaflow runs as usual.
- Inspect results using
@card
, notebooks, and Metaflow GUI. - Use the new
tag add
command to attach tags to runs based on the analysis.
See the steps in action:
Programmatic Tagging
Tags allow you to express opinions about results of your and your colleagues' work, and, importantly, change those assessments at any time. In contrast to runs and artifacts that represent immutable facts (history shouldn't be rewritten), the way how you interpret those facts may change over time, which is reflected in tags.
Tagging doesn't have to happen manually. This example shows how to use the tagging methods in the Client API to attach tags to runs automatically. Later, after you have done deeper analysis of the results, you can remove inaccurate tags either via the same API or with the tag remove
command on the command line.

In the video below, we use a code snippet like this
from metaflow import Flow, current
run = Flow(current.flow_name)[current.run_id]
run.add_tag('promising_model')
to attach a tag, promising_model
, to the currently executing run programmatically. After we have iterated on the model for a while, we analyze the promising models in a notebook and use the Run.remove_tag
call to remove the tag from runs that don't deserve the label after a deeper investigation.
Take a look:
Conclusion
It is beneficial to allow people to change their minds about many things, including how they view a Metaflow run. This is now possible with mutable tags, which makes them a foundational building block for various workflows that involve a human in the loop. Hopefully these five use cases inspire you to design and deploy patterns that work well for your needs.
We'd love to hear from you and learn about your patterns, use cases, and pain points. Don't be a stranger - join the Metaflow Slack today!
Start building today
Join our office hours for a live demo! Whether you're curious about Outerbounds or have specific questions - nothing is off limits.
.png)