Architectural guidance for strict 1:1 mapping of agent and workflow instances; scheduling #3913
Replies: 1 comment
-
Hi @alex04103 ! First off, I think your use case sounds really interesting - if you ever would consider writing a blog post on it, I think that could be really fun for folks! To your questions: For specifying flow / agent relationships, labels are definitely the way to go; labels can be any string, so whether it's UUIDs or a simple name is up to you - agents that have a superset of your flow's labels will be able to run them. Now, it appears that the only thing that changes from flow to flow is the For your larger question about |
Beta Was this translation helpful? Give feedback.
-
Hello everybody,
currently I am exploring Prefect for automation of various IT processes. To start with, I am implementing a solution for backup of a minecraft server, being very manageable, as it consists only of a few distinct steps.
The current architectural approach is as follows:
idempotency_key=flow.serialized_hash()
to bump Workflow version if any parameter has been changedThe idea behind this is to allow different minecraft server deployments to have the same workflow structure and tasks, but with different parameters - basically, to create reusable workflows. Registration is meant to provide insight into the process and to allow monitoring and manual workflow execution.
I recognize that this may not be the most common arrangement of agents and workflows, but to me a still a very useful one.
My primary question is what would be the best way to map Agents and per-Agent Workflows 1:1 to each other? I have seen that a
host
label is added to Agents (and probably workflows?) automatically, which would be the most basic mapping approach. It shall be strictly avoided to mix non-paired Agents and Workflows, so I also considered generating a UUID for this 1:1 match. Is there any definite approach to do this?In addition, I am somewhat unsure which role the Prefect server plays in Cron scheduling. Its clear that the schedule itself is defined as part of the workflow (instance) - which is desirable, as it tightly coupled to the concrete k8s-managed application. I have already observed that the core library is able to work completely independent of any server, just executing the flow as scheduled.
How does this differ when the workflow is not
run()
, but registered to the server, followed by start of the local Agent waiting for work to do?I'd highly appreciate any advice 😃
For reference, I've also attached the structurally very simple code:
Beta Was this translation helpful? Give feedback.
All reactions