Skip to main content

Inspecting Events

Events provide an additional layer of observability in production systems. By following a trail of events, you can inspect what was triggered, when, and by whom.

Accessing events through Client API

You can inspect the event(s) with the Client API that exposes the MetaflowTrigger object for every event-triggered run. For instance, we can inspect the event that triggered a production run ModelRefreshFlow/argo-modelrefreshflow-rlpgc:

from metaflow import namespace, Run

Remember that namespace(None) sets the global namespace which is required to inspect production runs e.g. in a notebook. This will print out metadata about the event:

timestamp=datetime.datetime(2023, 5, 15, 19, 50, 43),

Find a description of all fields in the related API documentation.

Dealing with multiple triggers

If a run was triggered by multiple events, you can inspect specific MetaflowEvent by name:


Or, if a run was triggered by multiple flows when using @trigger_on_finish, you can inspect a specific triggering Run by its flow name:


Following a trail of runs

When flows are connected with @trigger_on_finish, you can use MetaflowTrigger to follow a chain of triggered runs. Consider this chain of flows:

ETLFlow → TrainingFlow → PredictionFlow

We can walk backwards from the latest run of PredictionFlow back to the triggering run of ETLFlow:

etl_run = Flow('PredictionFlow')

Events in the Metaflow UI

If you have deployed the Metaflow GUI, you can view metadata about triggers right in the UI. The circles with arrows inside indicate event-triggered runs: