Skip to content

Instantly share code, notes, and snippets.

@anna-anisienia
Created August 27, 2020 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anna-anisienia/270223379a600b164fdd9970f08f14a8 to your computer and use it in GitHub Desktop.
Save anna-anisienia/270223379a600b164fdd9970f08f14a8 to your computer and use it in GitHub Desktop.
from prefect.tasks.prefect.flow_run import FlowRunTask
from prefect import Flow
from prefect.schedules import Schedule
from prefect.schedules.clocks import CronClock
schedule_parent_flow = Schedule(clocks=[CronClock("0 2 * * *")])
with Flow("MasterFlow", schedule=schedule_parent_flow) as flow:
staging_area = FlowRunTask(flow_name='staging_area',
project_name="InterFlow_Dependencies",
wait=True)
business_logic_layer = FlowRunTask(flow_name='business_logic_layer',
project_name="InterFlow_Dependencies",
wait=True)
data_mart = FlowRunTask(flow_name='data_mart',
project_name="InterFlow_Dependencies",
wait=True)
staging_area.set_downstream(business_logic_layer)
business_logic_layer.set_downstream(data_mart)
if __name__ == '__main__':
flow.register("InterFlow_Dependencies")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment