https://prefect.io logo
j

jars

09/17/2020, 6:08 PM
Prefect Cloud gives our Flow Runs cute names like beautiful-cricket, industrious-turkey, etc. Is this name accessible inside of the Flow's execution? We'd like to tag some external resources w/ this name so we could easily know which Flow made those resources for debugging.
j

Jeremiah

09/17/2020, 6:09 PM
Hi @jars you should be able to access the name in
prefect.context.get('flow_run_name')
during runtime
For a full list of context variables please see this doc.
j

jars

09/17/2020, 6:09 PM
amazing, thx!!
j

Jeremiah

09/17/2020, 6:10 PM
In addition, keep an eye on this PR which will allow you to customize the name however you want.
👌 you got it! Let us know if that doesn’t work for any reason
If it helps your use case, note that names are not guaranteed to be unique (though there are many of them, so you won’t see repeats for a while!).
flow_run_id
will be unique.
j

jars

09/17/2020, 6:13 PM
Appreciate that, it will just be for informational purposes. We won't rely on it for uniqueness. Thank you!
👍 1
@Jeremiah; it looks like we don't get the cute run name when using
flow_run_name
... This variable seems to be populated with the
flow_run_id
😛
Nevermind, it totally works!
👍 1
p

Pedro Machado

09/18/2020, 6:49 PM
I have a slightly different use case for meaningful flow run names that are generated by the scheduler when there are many clocks with parameters. Not sure if this would also help you, Jordan https://github.com/PrefectHQ/prefect/issues/3010
j

jars

09/18/2020, 8:39 PM
Thanks Pedro!