I define the Flow that is started with multiple s...
# ask-community
a
I define the Flow that is started with multiple starttime and at the specified time, i wanna to run the specified task. how to do that? tks
k
So for example you have a Flow that starts at 1 pm but you have a specific task that you want to start at 6 pm? and then continue on with the rest of the flow? Did I understand right?
a
yes ! thats right
k
use the
StartFlowRun
task with
wait=True
and add a
scheduled_start_time
a
plz give me some example for that! many thanks
k
Docs here . You need to name that specific task into it’s own Flow because you can only schedule Flows, not tasks
Copy code
start = StartFlowRun(flow_name=.., project_name=..., wait=True)

@task
def get_time():
    # four hours later
    return datetime.datetime.now() + timedelta(hours=4)

with Flow(...) as flow:
    time = get_time()
    start(scheduled_start_time=time)