https://prefect.io logo
Title
m

Madison Schott

06/29/2022, 4:01 PM
Is there a way to rename pipelines? Or "retire" them? We have the old
data_pipeline_prod
that we want to somehow label that it is deprecated? And then change the one with test in its name to the new
data_pipeline_prod
? Or any suggested ways to do this?
j

James Sopkin

06/29/2022, 4:06 PM
Could you register your
data_pipeline_test
with the flow name of
data_pipeline_prod
and the prod project? Or do you need to keep the deprecated pipeline?
Otherwise, I believe there is a task that can rename flows called RenameFlowRun() https://github.com/PrefectHQ/prefect/blob/master/src/prefect/tasks/prefect/flow_run_rename.py
m

Madison Schott

06/29/2022, 4:18 PM
Ideally I'd like to keep the old one so we have that history
Oh cool, I'll check that out!
so do I import this and then run this task within an already existing flow?
meaning I need to redploy the flow to include the task that renames?
an answer to the above questions would be appeciated 🙂
j

James Sopkin

06/30/2022, 8:35 PM
Hi Madison, sorry, I don't monitor this channel as closely as Anna and Kevin do, I was just subbing in for them for a few days. I went and testing the flow_run_name method. A flow run can be renamed either by calling the FlowRunRename task in the flow and passing in the flow_run_id and new name
with Flow("flow") as flow:
   FlowRunRename({id}, "new_name")
or by making running a mutation query in the interactive api
mutation {
  set_flow_run_name(input: {flow_run_id:{id}, name: "new_name"}) {
    success
  }
}
Unfortunately, this would only rename a single flow run, but not the flow itself. I believe it is possible to rename flow projects, but not rename a flow.
I would recommend registering the test pipeline to the prod flow. The prod history will be maintained in the previous versions. Other than that, we could open an issue/feature request
m

Madison Schott

06/30/2022, 8:57 PM
Ah so it doesn't rename the entire flow? Just one run of it? (the first option)
I was able to rename the project on the UI
hmm I included it in the flow but it doesn't look like the task is showing up on the UI
j

James Sopkin

06/30/2022, 9:03 PM
I wrote a simple flow called test_rename_flow and renamed the flow to new_name
m

Madison Schott

06/30/2022, 9:07 PM
Ah so it's just that one run? Instead of the random animal name?
j

James Sopkin

06/30/2022, 9:09 PM
yep
👍 1
m

Madison Schott

06/30/2022, 9:10 PM
Darn ok thanks
👍 2