Hi everybody,
Does anybody know how to make a one-time artifact for a flow run? Love this feature but it is a little pain to delete them)) I would really appreciate to hear your experience.
Thank you in advance
k
Kevin Kho
02/23/2022, 4:10 PM
Hey, you can write it based on a parameter input to your Flow, just get the parameter value using
prefect.context.parameters
inside a Flow
а
Андрій Демиденко
02/23/2022, 6:56 PM
Could you tell this a little more in detail?
k
Kevin Kho
02/23/2022, 7:03 PM
If you have:
Copy code
with Flow(...) as flow:
persist = Parameter("persist", False)
and then in your task
Copy code
@task
def some_task():
if prefect.context.parameters["persist"] == True:
create_artifact()
Kevin Kho
02/23/2022, 7:03 PM
So now you can do a quick run in the UI and set the parameter
persist
to True and it’s a one time thing. Does that make sense?
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.