Hi! New to prefect and have a quick question regar...
# ask-community
k
Hi! New to prefect and have a quick question regarding multiple flows. If i have a daily task and a weekly task that is the summary of the daily, should i start 2 local agents and register 2 flows? If the weekly runs every Monday for the previous sun-sat, should i set upstream even though it doesn’t require the same day’s daily task to finish running? thanks in advance.
n
Hi @KhTan - you should still only need 1 agent but you will want to register both flows with the appropriate schedules 🙂
k
Thank you @nicholas could i register both flows to the same project like this:
with Flow('daily',
       
schedule=daily_schedule
       
) as flow:
flow.register(project_name='first_prefect')
with Flow('weekly',
       
schedule=weekly_schedule
       
) as flow:
flow.register(project_name='first_prefect')
and for a flow, if after starting server and local agent and registering the project, the dashboard doesn’t recognize the registered flow or the agent, what could be the reasons? the flow could run locally, but not on linux vm - it will show a localhost:8080 url that returns 404 error. the prefect ui is visible on localhost:8080 itself but not showing the running flow.
k
You can do that but I suggest
with Flow(…) as flow1:
....
flow1.register()
with Flow(…) as flow2:
....
flow2.register()
🙏 1
Is your agent and server on the same machine?
Also just to make sure you know, Cloud has 10000 free task runs every month, which is a lot easier to get started with
upvote 1
a
@KhTan Regarding this question:
if after starting server and local agent and registering the project, the dashboard doesn’t recognize the registered flow or the agent, what could be the reasons?
Did you switch the backend to server? It looks like maybe you registered your agent and flows to Prefect Cloud, and you look into Server UI, or vice versa. Here is how you can do it (NOT recommended when you’re getting started):
Copy code
prefect backend server
Or if you want to use Prefect Cloud instead (recommended when you’re getting started):
Copy code
prefect backend cloud
And here is getting started guide that may be helpful: https://docs.prefect.io/orchestration/getting-started/set-up.html#server-or-cloud
🙏 1