Hi everybody, Does anybody know how to make a one...
# ask-community
а
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
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
а
Could you tell this a little more in detail?
k
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()
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?
а
Yeah. Thank you vey much))