Is there a way to not run some tasks on scheduled ...
# prefect-community
Is there a way to not run some tasks on scheduled flows, but run it on non-scheduled flows?
assuming this is for Prefect 2 you could do something like this
Copy code
def test_flow():
    flow_run = prefect.context.get_run_context().flow_run

    if flow_run.auto_scheduled == False:
This would only run
if the flow run wasn't automatically scheduled, i.e it was triggered manually or through some other api call like create_flow_run_from_deployment()
@Mason Menges this is for Prefect 1
I think it's probably still doable in Prefect 1 it might just require some more lift, I haven't tried this before specifically so this would just be my thoughts on it but you may be able to leverage the context/config to do this specifically the scheduled_start_time since that defaults to Now for unscheduled runs, Another option might be to try setting a parameter for the flow that defaults to True, and you can set it to false when doing a manual run This is probably the more pythonic way of doing it but requires a tad bit more setup in the flow.
gratitude thank you 1