Андрій Демиденко

    Андрій Демиденко

    7 months ago
    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
    Kevin Kho

    Kevin Kho

    7 months ago
    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
    Андрій Демиденко

    Андрій Демиденко

    7 months ago
    Could you tell this a little more in detail?
    Kevin Kho

    Kevin Kho

    7 months ago
    If you have:
    with Flow(...) as flow:
        persist = Parameter("persist", False)
    and then in your task
    @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?
    Андрій Демиденко

    Андрій Демиденко

    7 months ago
    Yeah. Thank you vey much))