I see in the v2 UI an option to add tags to a flow...
# prefect-cloud
j
I see in the v2 UI an option to add tags to a flow run in the Custom Run screen. Is it possible append these tags to a specific run from the flow code itself? I'm thinking of using this to tag runs if a user provides a backfilling window. This can be useful to separate all backfills from live loads of data for example.
n
hi @Jacob Blanco ! what about using an
on_running
hook to append runtime context as tags like this
Copy code
» python flows/proofs/tag_me.py
23:34:23.697 | INFO    | prefect.engine - Created flow run 'happy-otter' for flow 'f'
23:34:23.820 | INFO    | prefect.engine - Running hook 'tag_me' in response to entering state 'Running'
23:34:23.966 | INFO    | prefect.engine - Hook 'tag_me' finished running successfully
23:34:24.048 | INFO    | Flow run 'happy-otter' - got backfill='squirrels'
23:34:24.158 | INFO    | Flow run 'happy-otter' - Finished in state Completed()
image.png
🦦 2
🤝 1
🐿️ 1
j
Nice this is cool. It would be good to have this integrated into our data engineering libraries so that data-scientists don't need to add this on-running parameter every time. Let me try and see how far I get.
👍 1