https://prefect.io logo
#prefect-community
Title
# prefect-community
d

Darin Douglass

05/18/2022, 6:56 PM
is there a way to have
create_flow_run
not base the new flow’s name off of the current flow without passing
run_name
?
i want the backend to generate a
run_name
for me, but if i pass any empty value,
create_flow_run
will override it with it’s
{current}-{flow.name}
value
this is especially noticeable with cyclic flows that restart themselves on run end. they’ll constantly be appending on their name: •
foo-bar
foo-bar-flowname
foo-bar-flowname-flowname
foo-bar-flowname-flowname-flowname
etc
it looks like i could delete/replace the
flow_run_name
from the context, but that feels a bit hacky/dangerous?
k

Kevin Kho

05/18/2022, 7:06 PM
Man that’s tricky. Maybe use the
RenameFlowRun
task inside the subflow and
flow-date
or something like that?
d

Darin Douglass

05/18/2022, 7:12 PM
i’ll likely use the date like your suggestion. however, on prefect’s side replacing the default value to be some well-known sentinel and checking against that should be backwards compatible and allow for
run_name=None
to mean “backend make it for me please”
k

Kevin Kho

05/18/2022, 7:15 PM
@Marvin open “create_flow_run should name flows with the adjective-animal combination”
d

Darin Douglass

05/18/2022, 7:17 PM
🥳
fwiw
prefect.context["flow_run_name"] = None
does work
k

Kevin Kho

05/18/2022, 7:38 PM
Yo…that’s clever!
5 Views