Prefect In An AI Agent Backend

Version 58 | Created: 2026-09-27 | Updated: 2026-11-07 13:46 UTC
- 1. Purpose
- 2. Summary
- 3. Taxonomy and its Hierarchy
- 4. Backend Composition
- 5. Benchmarking
- 6. Strength
- 7. Application
- References
- Appendix A. Terminology
- Appendix B. What Prefect Does In An Agent Backend
- Appendix C. How An Event Trigger Is Done In Prefect
- Appendix D. Agent Frameworks In Use As Of September 2026
- Problem Statement: No account exists of how a Prefect workflow is used to build an AI agent or an AI orchestrator, or of where using it creates a strength.
- Goal: Split the frontend and backend roles of an AI orchestrator and an AI agent, and state what Prefect can specially do for the backend role and how it does it, so as to produce the benchmarking material a manager or a designer consults.
- Non-Goal: Designing an agent's prompt and its tools is not covered, the implementation Python code is not given, and no comparison is made with orchestrators other than Prefect (Airflow, Temporal, Dagster and the like).
An AI agent backend carries three responsibilities that decide what starts a run, how many calls run at once, and what ran. Those three together are the orchestrator [1], and Prefect is the product that carries them. Wrapping a tool call as a task puts the point a stopped run resumes from and the retry of a failed step on Prefect as well, while the LLM call that picks the next action and the Python code inside a tool stay with the agent framework. Fig 1 draws where the orchestrator sits inside the backend. An agent framework does the work inside one run only, so without Prefect the backend engineer implements those three in Python code. Six of the ten functions in Table 3 β suspension, idempotent rerun, declared rate limiting, per-step observability, one admission path and ML pipeline integration β together with orchestrator scope, access control and inbound events make the nine criteria a benchmarking sheet compares products on.
The frontend keeps its three roles when Prefect is used and gains one duty: the answer a paused run waits for arrives through the frontend. The agent framework the comparison is made against is LangGraph, chosen because its checkpointer and its node retry policy, the two entries the Without Prefect column of Table 3 rests on, are stated in vendor documentation [2]; the other frameworks in use are listed in Appendix D. Appendix B lists the nine things Prefect does inside an agent backend and the three it leaves to the agent framework and the API server, and Appendix C shows how the event trigger among them is attached.
The frontend's work ends once it has put the user's request into the form the backend accepts, and the backend takes over at the first LLM call, so the backend runs the reasoning loop. Ten responsibilities split across the two layers, three on the frontend and seven on the backend, of which admission, throughput and record are the orchestrator. The seven are ordered by the scope each one has to hold: one step, one run, or every run at once.
Scope is what decides who carries a responsibility. A framework runs inside one graph run, so it covers the one-step and one-run responsibilities; the orchestrator is the part that carries the three every-run responsibilities, namely admission, throughput and record. The ten roles, the layer of each, and what each one decides are drawn in Fig 1.
LAYER ROLE WHAT THE ROLE DECIDES SCOPE PART
Frontend > Intent What the user asked, in the backend's form one request
Approval The answer a paused run is waiting for one run
Presentation What the user sees of the result one request
| one request crosses the boundary
v
Backend > Reasoning Which action the LLM picks next one step --+
Tool execution The action actually carried out one step |
State The point a stopped run resumes from one run | Agent
Recovery Which failed step is retried, and how often one run --+
Admission What starts a run: request, schedule, event every run --+
Throughput How many calls run at once, and how fast every run | Orchestrator
Record What ran, when, and with which result every run --+
Fig 1. The three frontend roles and the seven backend responsibilities ordered by scope, four of them the agent and three the orchestrator
Each time the scope widens, one more place is needed for the state that has to outlive the previous scope. One-step scope needs nothing beyond the process, one-run scope needs a store the process can die without losing, and every-run scope needs a service that outlives every process and reports which runs there were.
Table 1. Each role, the part that holds it, and what settles it
| # | Role | Part | Scope | Settled by |
|---|---|---|---|---|
| 1 | Intent | Frontend | One request | The request schema the backend accepts |
| 2 | Approval | Frontend | One run | The input form that carries the answer a paused run waits for |
| 3 | Presentation | Frontend | One request | The stream or page the user reads |
| 4 | Reasoning | Agent | One step | The LLM call and the tool choice that call returns |
| 5 | Tool execution | Agent | One step | The Python function the chosen tool names |
| 6 | State | Agent | One run | The checkpoint a resumed run reads |
| 7 | Recovery | Agent | One run | The retry count, and the finished steps a rerun skips |
| 8 | Admission | Orchestrator | Every run | The deployment and the request, schedule or event that starts it |
| 9 | Throughput | Orchestrator | Every run | The concurrency limit and the call rate |
| 10 | Record | Orchestrator | Every run | The run history each step writes |
No agent framework carries the three orchestrator rows, so a design names a product on those rows and writes Python code on the others.
π³ Prefect carries all three orchestrator roles β #8 Admission, #9 Throughput and #10 Record β and, once a tool call is wrapped as a task, the retries and the result caching of #6 State and #7 Recovery as well. It does not carry #4 Reasoning or #5 Tool execution, which is why the LLM call that picks the next action and the Python code inside a tool stay with the agent framework.
The two compositions run the same reasoning loop and differ in where that loop lives. Without Prefect the loop runs inside the process that answered the request; with Prefect the loop is a flow that a worker starts on the infrastructure its work pool names, and the request only asks for that flow to start. The two are drawn in Fig 2.
WITHOUT PREFECT WITH PREFECT (self-hosted)
[ HTTP request ] [ HTTP request ] [ Schedule ] [ Event ]
| | | |
v +-------+-------+------------+
[ Web process ] |
| v
+--> agent loop, in-process [ Prefect Server ]
+--> RetryPolicy on a node API, UI, scheduler,
+--> checkpointer -> DB events and automations
| |
v v run queued in a work pool
[ Response ] [ Worker polls the pool ]
|
written by hand beside the web process: v
cron or a queue, for schedules [ Flow: the agent loop ]
a semaphore, for the call rate |
a log table, for the run history +--> Task per tool call
a guard, so a rerun skips done work | retries, cache, rate limit
+--> pause or suspend for input
+--> checkpointer -> DB
|
v
[ Response, and a run record ]
Fig 2. The same backend without Prefect and with a self-hosted Prefect Server
An agent framework covers the four inner responsibilities of Fig 1 and leaves the orchestrator's three to the backend engineer. A checkpointer saves a snapshot of the graph state at every super-step under a thread id, which is what lets a stopped run resume and what lets a human interrupt, inspect and approve a step, and a retry policy attached to a node retries it with exponential backoff [2]. The backend engineer then writes and maintains a scheduler, a semaphore and a log table.
Prefect fills the same three with a server and a worker, and the agent loop becomes a flow whose tool calls are tasks. A deployment states where, when and how the flow runs, which turns the loop into an entity the API manages, triggered by a schedule, the UI, an automation or the REST API, while a work pool names the infrastructure and a worker polls the pool and starts the run on it [3]. The self-hosted server carries the API, the UI, scheduling, work pools, and the events and automations engine [4]. The official integration between Prefect and Pydantic AI wraps the tools as tasks, so the backend engineer does not write that Python code: tools become tasks automatically, each with its own retries, its own cached result and its own line in the run history [5]. This is where #6 State and #7 Recovery of Table 1 come onto Prefect alongside the orchestrator rows.
A benchmarking sheet compares two things. Table 2 holds the criteria products are compared on, with Prefect's answer to each, and Table 3 holds the difference between a backend with Prefect and the same backend without it.
The nine rows of Table 2 are the criteria a benchmarking sheet compares products on, and the Prefect column holds Prefect's answer to each.
Table 2. The benchmarking criteria, with Prefect's answer to each
| # | Criterion | Criterion details | Prefect |
|---|---|---|---|
| 1 | Orchestrator scope | Which of admission, throughput and record the product carries | Admission, throughput and record |
| 2 | Suspension | What a run waiting for a person holds open | Nothing, the process exits |
| 3 | Idempotent rerun | What a rerun does with work already done | The previous result, loaded |
| 4 | Rate limiting | How the call rate is bounded | Declared, in any Python code |
| 5 | Per-step observability | How far down a failure is located | The one tool call |
| 6 | One admission path | How many Python code paths the triggers need | One deployment |
| 7 | ML pipeline integration | Whether the same product also runs the retraining and deployment pipelines | It does |
| 8 | Access control | What guards the API and the UI | Nothing in the open source server |
| 9 | Inbound events | How an outside system starts a run | A Cloud webhook, or a relay |
A row the product does not answer is filled by the backend engineer in Python code.
Ten functions are needed in either composition, and Table 3 sets out what holds each one on each side. The Without Prefect column is the composition that uses only an agent framework, and the With Prefect column is that same framework with Prefect added on top of it. An agent framework is the Python library a backend engineer writes the LLM call and tool selection loop into, and this document uses LangGraph as that framework [2].
Table 3. The same function in each composition
| # | Function | Without Prefect | With Prefect |
|---|---|---|---|
| 1 | Step retry | A retry policy on a node, inside one graph run | retries and retry_delay_seconds on every task |
| 2 | Resume after a crash | The checkpointer replays the thread from its last super-step | The framework's checkpointer, and the run state the Prefect server holds |
| 3 | Human approval | An interrupt, and a resume call the backend engineer routes | pause_flow_run with wait_for_input, answered by API |
| 4 | Where a run executes | The web process that answered | A work pool, with a worker polling it |
| 5 | Suspension | The web process holds the thread and waits for the person | suspend_flow_run exits, and the run starts again when the input arrives |
| 6 | Idempotent rerun | The backend engineer writes the skip condition into the node | Result caching loads the previous result instead of running again |
| 7 | Rate limiting | The backend engineer writes a semaphore to bound the calls | A global concurrency limit and a rate limit |
| 8 | Per-step observability | The backend engineer builds a log table and writes each step to it | Every flow run and task run, in the server's UI |
| 9 | One admission path | The backend engineer connects each trigger to the run by hand | One deployment, on a request, a schedule or an automation |
| 10 | ML pipeline integration | The backend engineer runs retraining and deployment on a separate scheduler | Retraining, deployment and the agent run as flows on one server, each able to start the next |
Nine of the ten rows are met by the Prefect API calls and settings named in the With Prefect column alone, and #2 uses the agent framework's checkpointer alongside them. The framework keeps a part in all ten rows: what Prefect wraps is that framework's loop and its tool code, and the framework side is what decides where a run pauses, which results may be cached, and what counts as one step.
In rows #5 to #10 of Table 3 the agent framework does not do the work itself. The backend engineer fills those rows with Python code written by hand, or leaves them undone. Those six rows are what separates one product from another on a benchmarking sheet, and the six are listed below under the same names, each with what Prefect does in its place.
- Suspension:
pause_flow_runkeeps the flow alive while it waits, andsuspend_flow_runexits so the infrastructure can be taken down, with the run started again when the input arrives [6]. A HITL step that waits a day occupies no process at all. - Idempotent rerun: Prefect's transactional orchestration loads the previous result instead of running again when the context is identical [5]. Under that idempotency a retried agent run does not pay the LLM twice for the same tool call.
- Rate limiting: a global concurrency limit bounds how many calls are in flight, and a rate limit paces them by a slot decay per second [7]. Both work in Python code outside a flow, so a tool never wrapped as a task stays bounded too.
- Per-step observability: each tool call is a task, so each one appears in the run history and is retried on its own [5]. The failure report carries which tool call failed on which input, not only that an agent run failed.
- One admission path: one deployment answers an interactive request, a nightly schedule and an event-driven automation [3]. The overnight batch and the chat request run the same Python code rather than two copies.
- ML pipeline integration: retraining, deployment and the agent run as flows on one server, and the state of a finished flow starts the next [8]. Retraining and the agent need not sit in two systems with a bridge written between them.
Prefect is favourable for a backend whose agent run continues after the HTTP response has gone out, and unfavourable for one whose run ends with that response. The HTTP response here is the backend's reply to one frontend request: sending it closes that request's connection, and the web process that took the request moves on to the next one. The three conditions below decide which case a design is in.
- Assumption: the backend may own a process of its own. A worker is a client-side process that polls a work pool and starts runs on infrastructure [3], so a deployment target that forbids a long-lived process cannot host the worker and the composition of Fig 2 does not hold.
- Breaking condition: authentication. The open source server carries no users and no authentication, so anyone who reaches the UI or the API has full access to the server [4]; a self-hosted server therefore sits inside a private network or behind an authenticating proxy. Webhooks are a Prefect Cloud feature [4], so a self-hosted backend that must start runs from an outside system must write the endpoint that relays those events to the API.
- Exclusion: an agent whose run is one LLM call and whose result nobody looks up later. The server and the worker are two components to operate, and a run that ends with the HTTP response leaves them no state to hold.
[1] GitHub. What is Workflow Orchestration?.
[2] LangChain. Checkpointers. LangGraph documentation.
[3] Prefect. Deployments. Prefect 3 documentation.
[4] Prefect. Cloud vs OSS feature comparison.
[5] Pydantic. Durable execution with Prefect. Pydantic AI documentation.
[6] Prefect. How to write interactive workflows. Prefect 3 documentation.
[7] Prefect. How to apply global concurrency and rate limits. Prefect 3 documentation.
[8] Prefect. Define event triggers. Prefect 3 documentation.
[9] LangChain. The best AI agent frameworks in 2026.
[10] Prefect. The only orchestrator built for AI agents.
- Agent framework: the Python library a backend engineer writes the LLM call and tool selection loop into, such as LangGraph.
- Automation: the Prefect rule that starts a preset action when a matching event arrives.
- Checkpointer: the component that saves graph state at each step so that a stopped run resumes from it.
- Deployment: a flow with where, when and how it runs attached, which makes it an entity the API manages.
- FDC (Fault Detection and Classification): the fab system that watches equipment sensor traces and raises an alarm when one leaves its limits.
- Flow: the function Prefect treats as one run.
- HITL (Human In The Loop): a run that waits for a person's input before it continues.
- Idempotency: the property that running again with the same input leaves the same result and the same side effects as running once.
- Jinja: the template syntax Prefect substitutes event values into a flow's parameters with.
- K8s (Kubernetes): the container platform a work pool can run flow runs on.
- Orchestrator: the part of a backend that carries every run rather than one: what starts a run, how many calls run at once, and what the run history keeps.
- Prefect Server: the self-hosted orchestration backend holding the API, the UI, the scheduler, and events and automations.
- RAG (Retrieval Augmented Generation): answering with documents retrieved at query time and handed to the LLM beside the question.
- Rate limit: the ceiling on how many calls may leave within a span of time.
- Result caching: loading a previous result for an identical input instead of executing again.
- Super-step: the execution unit a graph saves one state snapshot for.
- Task: the unit inside a flow that Prefect retries, caches and records on its own.
- Thread: the unit a checkpointer collects one conversation's state under.
- VM (Virtual Metrology): predicting a measurement from process sensor data instead of measuring it.
- Work pool: the Prefect setting that names the infrastructure flow runs execute on.
- Worker: the client-side process that polls a work pool and starts each scheduled run on that infrastructure.
Each item below is something Prefect does inside an agent backend, and the parenthesis at the end names the Table 3 function the item belongs to.
- Durable execution: it caches LLM and tool calls per task, and resumes from that point on a failure (#2 Resume after a crash, #6 Idempotent rerun).
- Retry and timeout: it applies a retry policy and a timeout per call, against an LLM API outage or a tool error (#1 Step retry).
- Event trigger: it runs an agent automatically when an event such as an FDC alarm or a drift detection arrives (#9 One admission path).
- Scheduling: it runs the regular analysis and report agents on a schedule (#9 One admission path).
- Distributed execution: it distributes runs to K8s nodes or GPU workers (#4 Where a run executes).
- Observability: it tracks run history, logs and state in the UI (#8 Per-step observability).
- Human-in-the-loop waiting: with
pause_flow_runit stops until the approval arrives, then resumes (#3 Human approval, #5 Suspension). - ML pipeline integration: it operates retraining, deployment and agent execution together (#10 ML pipeline integration).
- Rate limiting: it bounds the calls in flight and the calls per second by declaration, against an LLM API rate limit (#7 Rate limiting).
What it does not do itself: the LLM inference logic, memory and RAG, and real-time conversation serving are carried by the agent framework and the API server.
The trigger is set up in two steps. emit_event publishes the event, and a DeploymentEventTrigger or an automation receives it and runs the flow [8].
1. Emit the event β on the FDC system or the collector side.
from prefect.events import emit_event
emit_event(
event="fdc.alarm.raised",
resource={"prefect.resource.id": "tool.ETCH01.TG1"},
payload={"wafer_id": "W123", "sensor": "RF_power", "severity": "high"},
)2. Run the agent flow from a trigger
from prefect import flow
from prefect.events import DeploymentEventTrigger
@flow
def fdc_agent(tool_id: str, wafer_id: str, sensor: str):
... # agent analysis, then the report and the notification
if __name__ == "__main__":
fdc_agent.serve(
name="fdc-agent",
triggers=[
DeploymentEventTrigger(
expect={"fdc.alarm.raised"},
match={"prefect.resource.id": "tool.*"},
parameters={ # Jinja injects the event values into the flow parameters
"tool_id": "{{ event.resource.id }}",
"wafer_id": "{{ event.payload.wafer_id }}",
"sensor": "{{ event.payload.sensor }}",
},
)
],
)Table 4. Trigger types
| # | Type | Use | Setting |
|---|---|---|---|
| 1 | Reactive | Runs as soon as the event occurs | The default |
| 2 | Threshold | Runs once N have accumulated, such as three alarms within ten minutes | threshold=3, within=timedelta(minutes=10) |
| 3 | Proactive | Runs when the event does not arrive, such as collection having stopped | posture="Proactive" |
| 4 | Compound / Sequence | Runs on a combination or an order of several events | CompoundTrigger, SequenceTrigger |
| 5 | Flow state | Runs in sequence after another flow completes or fails | expect={"prefect.flow-run.Completed"} and the like |
External systems
- Prefect Cloud: a webhook takes an outside HTTP request as an event directly.
- Self-hosted (OSS): with no webhook, a FastAPI endpoint or a Kafka or MQ consumer calls
emit_eventto turn the request into an event.
Fab application
- An FDC alarm, reactively, to the cause analysis agent
- Three VM error excursions within ten minutes, on threshold, to the retraining flow
- Sensor data unreceived for thirty minutes, proactively, to the equipment check notice
- Retraining completed, on flow state, to the validation agent and the report
The framework this document compares against is #1 LangGraph, and chapter 2 says why it was chosen. Each date is the product's public announcement [9].
Table 5. Agent frameworks and when each was first announced
| # | Framework | Framework details | Announced |
|---|---|---|---|
| 1 | LangGraph | Holds state as a graph. The default where an audit trail and human approval are needed | 2024-01 |
| 2 | CrewAI | Binds several role-playing agents into a team. Fastest to a prototype | 2024-01 |
| 3 | OpenAI Agents SDK | The model drives the loop. The least extra work if the work is GPT-centred | 2025-03 |
| 4 | Google ADK | Strong on multimodal. Announced at Google Cloud NEXT 2025 | 2025-04 |
| 5 | Claude Agent SDK | The agent harness behind Claude Code, renamed from the Claude Code SDK | 2025-09 |
| 6 | Microsoft Agent Framework | Graph based. The choice in an Azure and .NET environment | 2026-04 |
| 7 | Pydantic AI | Type-safe Python. V2 carries durable execution | 2026-06 |
#7 Pydantic AI and Prefect are two products used separately, and a package that joins them is published [5]. Installing that package runs an agent written with Pydantic AI as a Prefect flow and makes that agent's tools Prefect tasks, so the wrapping Python code does not have to be written by hand. Neither product has absorbed the other, and neither uses the other inside itself.
Of the seven, #7 Pydantic AI is the only one with a package dedicated to that join; for the others the backend engineer writes the wrapping. Prefect treats a flow as a Python function, so it runs Pydantic AI, LangGraph and any other Python agent framework [10].
Version 58 | Created: 2026-09-27 | Updated: 2026-11-07 13:46 UTC
- 1. Purpose
- 2. Summary
- 3. Taxonomy and its Hierarchy
- 4. Backend Composition
- 5. Benchmarking
- 6. Strength
- 7. Application
- References
- Appendix A. Terminology
- Appendix B. What Prefect Does In An Agent Backend
- Appendix C. How An Event Trigger Is Done In Prefect
- Appendix D. Agent Frameworks In Use As Of September 2026
- Problem Statement: AI Agent μ AI Orchestrator λ₯Ό ꡬμΆνλ λ° Prefect workflow λ₯Ό νμ©νλ λ°©μκ³Ό, κ·Έκ²μΌλ‘ κ°μ μ λ§λ€μ΄ λ΄λ λ°©μμ΄ μλ€.
- Goal: AI Orchestrator μ AI agent μ frontend μ backend μν μ κ°λ₯΄κ³ , Prefect κ° backend μ μν μ λν΄ νΉλ³ν 무μμ μ΄λ»κ² ν μ μλμ§λ₯Ό μ μ΄, manager λλ designer κ° μ°Έκ³ νλ benchmarking μλ£λ₯Ό λ§λ λ€.
- Non-Goal: Agent μ prompt μ tool μ μ€κ³νλ λ°©λ²μ λ€λ£¨μ§ μκ³ , ꡬν Python code λ μ£Όμ§ μμΌλ©°, Prefect λ°μ orchestrator (Airflow, Temporal, Dagster λ±) κ³Ό λΉκ΅νμ§ μλλ€.
AI agent backend μλ 무μμ΄ μ€νμ μμνλκ°, νΈμΆμ ν λ²μ λͺ κ°κΉμ§ λ리λκ°, 무μμ΄ λμλκ°λ₯Ό μ νλ μΈ μ± μμ΄ μλ€. μ΄ μ μ λ¬Άμ΄ orchestrator λΌ λΆλ₯΄λ©° [1], Prefect κ° μ΄ μ μ λ§‘λ μ νμ΄λ€. Tool νΈμΆμ task λ‘ κ°μΈλ©΄ λ©μΆ μ€νμ΄ λ€μ μμνλ μ리μ μ€ν¨ν λ¨κ³μ μ¬μλκΉμ§ Prefect κ° ν¨κ» μ§μ§λ§, LLM μ λΆλ¬ λ€μ λμμ κ³ λ₯΄λ μΌκ³Ό tool μμ Python code λ agent framework μ λ¨λλ€. Orchestrator κ° backend μμ μ΄λμ λμ΄λμ§λ Fig 1 μ κ·Έλ Έλ€. Agent framework λ ν μ€ν μμ μΌλ§ νλ―λ‘, Prefect κ° μμΌλ©΄ μ΄ μ μ backend μμ§λμ΄κ° Python code λ‘ μ§μ ꡬννλ€. Table 3 μ μ΄ κΈ°λ₯ κ°μ΄λ° μ¬μ― β suspension, idempotent rerun, μ μΈμΌλ‘ λλ rate limiting, per-step observability, one admission path, ML pipeline integration β μ orchestrator scope μ access control κ³Ό inbound events λ₯Ό λν μνμ΄ benchmarking μλ£κ° μ νμ 견주λ νλͺ©μ΄λ€.
Prefect λ₯Ό μ¨λ frontend μ μΈ μν μ κ·Έλλ‘μ΄κ³ , ν μΌμ΄ νλ λ λΆλλ€. λ©μΆ μ€νμ΄ κΈ°λ€λ¦¬λ λ΅μ frontend κ° λ°μ backend λ‘ λκΈ΄λ€. λΉκ΅ λμμΌλ‘ μΌμ agent framework λ LangGraph λ€. Table 3 μ Without Prefect μ΄μ΄ κ·Όκ±°λ‘ μΌλ checkpointer μ node μ λΆμΈ retry policy λ₯Ό vendor λ¬Έμμμ νμΈν μ μμ΄ κ³¨λμΌλ©° [2], μ§κΈ μ°μ΄λ λ€λ₯Έ framework λ Appendix D μ μ μλ€. Appendix B κ° Prefect κ° agent backend μμ νλ μν κ°μ§μ, agent framework μ API server μ λ¨κΈ°λ μ
μ μ κ³ , Appendix C κ° κ·Έ κ°μ΄λ° event trigger λ₯Ό μ΄λ»κ² λΆμ΄λμ§ λ³΄μΈλ€.
Frontend λ μ¬μ©μμ μμ²μ backend κ° λ°λ ννλ‘ λ§λλ λ°κΉμ§ νκ³ , 첫 LLM νΈμΆλΆν°λ backend κ° νλ€. κ·Έλμ μΆλ‘ loop λ backend κ° λλ¦°λ€. μ΄ κ°μ§ μν μ΄ λ μΈ΅μ κ°λ € frontend μ μ , backend μ μΌκ³±μ΄ λμ΄λ©°, κ·Έ μΌκ³± κ°μ΄λ° admission κ³Ό throughput κ³Ό record κ° orchestrator λ€. μΌκ³±μ κ° μ± μμ΄ λ§‘λ λ²μ β ν λ¨κ³, ν μ€ν, λͺ¨λ μ€ν β μ μμλ‘ λμ΄μ λ€.
λκ° μ΄λ μ± μμ μ§λμ§λ λ²μκ° μ νλ€. Framework λ ν graph μ€ν μμμλ§ λλ―λ‘ ν λ¨κ³ λ²μμ ν μ€ν λ²μμ μ± μμ μ§λ€. Orchestrator λ λͺ¨λ μ€ν λ²μμ μΈ μ± μ, κ³§ admission κ³Ό throughput κ³Ό record λ₯Ό μ§λ μͺ½μ΄λ€. μ΄ μν κ³Ό κ°κ°μ μΈ΅, κ·Έλ¦¬κ³ κ° μν μ΄ μ νλ κ²μ Fig 1 μ κ·Έλ Έλ€.
LAYER ROLE WHAT THE ROLE DECIDES SCOPE PART
Frontend > Intent What the user asked, in the backend's form one request
Approval The answer a paused run is waiting for one run
Presentation What the user sees of the result one request
| one request crosses the boundary
v
Backend > Reasoning Which action the LLM picks next one step --+
Tool execution The action actually carried out one step |
State The point a stopped run resumes from one run | Agent
Recovery Which failed step is retried, and how often one run --+
Admission What starts a run: request, schedule, event every run --+
Throughput How many calls run at once, and how fast every run | Orchestrator
Record What ran, when, and with which result every run --+
Fig 1. The three frontend roles and the seven backend responsibilities ordered by scope, four of them the agent and three the orchestrator
λ²μκ° ν λ¨κ³ λμ΄μ§λ©΄, μ λ²μκ° λλ λ€μλ λ¨μμΌ νλ μνλ₯Ό λ μλ¦¬κ° νλ λ μμ΄μΌ νλ€. ν λ¨κ³ λ²μλ process μμμ λλκ³ , ν μ€ν λ²μλ process κ° μ£½μ΄λ λ΄μ©μ΄ λ¨λ μ μ₯μλ₯Ό μ°λ©°, λͺ¨λ μ€ν λ²μλ process κ° λͺ¨λ λλ λ€μλ λλ©΄μ μ΄λ€ μ€νμ΄ μμλμ§ μλ € μ£Όλ service λ₯Ό μ΄λ€.
Table 1. Each role, the part that holds it, and what settles it
| # | Role | Part | Scope | Settled by |
|---|---|---|---|---|
| 1 | Intent | Frontend | One request | Backend κ° λ°μλ€μ΄λ μμ² schema |
| 2 | Approval | Frontend | One run | λ©μΆ μ€νμ΄ κΈ°λ€λ¦¬λ λ΅μ λ°λ input form |
| 3 | Presentation | Frontend | One request | μ¬μ©μκ° μ½λ stream λλ page |
| 4 | Reasoning | Agent | One step | LLM νΈμΆκ³Ό κ·Έ νΈμΆμ΄ λλ €μ£Όλ tool μ ν |
| 5 | Tool execution | Agent | One step | κ³ λ₯Έ tool μ΄ κ°λ¦¬ν€λ Python ν¨μ |
| 6 | State | Agent | One run | λ€μ μμν μ€νμ΄ μ½λ checkpoint |
| 7 | Recovery | Agent | One run | μ¬μλ νμ, κ·Έλ¦¬κ³ μ¬μ€νμ΄ κ±΄λλ°λ μ΄λ―Έ λλ λ¨κ³ |
| 8 | Admission | Orchestrator | Every run | Deployment μ κ·Έ deployment λ₯Ό μΌλ μμ²Β·scheduleΒ·event |
| 9 | Throughput | Orchestrator | Every run | λμ μ€ν μνκ³Ό νΈμΆ μλ |
| 10 | Record | Orchestrator | Every run | λ¨κ³λ§λ€ μμ΄λ μ€ν κΈ°λ‘ |
μ΄λ agent framework λ orchestrator μΈ νμ μ§μ§ μμΌλ―λ‘, design μ κ·Έ μΈ νμ μ ν μ΄λ¦μ μ κ³ λλ¨Έμ§ νμ Python code λ‘ μ±μ΄λ€.
π³ Prefect λ orchestrator μ (#8 Admission, #9 Throughput, #10 Record) μ λΆμ, agent λ· κ°μ΄λ° #6 State μ #7 Recovery μ μ¬μλμ result caching μ tool μ task λ‘ κ°μ λ ν¨κ» μ§λ€. #4 Reasoning κ³Ό #5 Tool execution μ νμ§ λͺ»νλ€. LLM μ λΆλ¬ λ€μ λμμ κ³ λ₯΄λ μΌκ³Ό tool μμ Python code κ° agent framework μ λ¨λ κΉλμ΄λ€.
λ ꡬμ±μ κ°μ μΆλ‘ loop λ₯Ό λ리며, κ·Έ loop κ° μ΄λ process μμ λλμ§κ° κ°λ¦°λ€. Prefect κ° μμΌλ©΄ loop λ μμ²μ λ΅ν process μμμ λκ³ , Prefect κ° μμΌλ©΄ loop λ worker κ° work pool μ΄ κ°λ¦¬ν€λ infrastructure μμμ μμνλ flow μ΄λ©° μμ²μ κ·Έ flow λ₯Ό μμν΄ λ¬λΌκ³ μꡬν λΏμ΄λ€. λμ Fig 2 μ κ·Έλ Έλ€.
WITHOUT PREFECT WITH PREFECT (self-hosted)
[ HTTP request ] [ HTTP request ] [ Schedule ] [ Event ]
| | | |
v +-------+-------+------------+
[ Web process ] |
| v
+--> agent loop, in-process [ Prefect Server ]
+--> RetryPolicy on a node API, UI, scheduler,
+--> checkpointer -> DB events and automations
| |
v v run queued in a work pool
[ Response ] [ Worker polls the pool ]
|
written by hand beside the web process: v
cron or a queue, for schedules [ Flow: the agent loop ]
a semaphore, for the call rate |
a log table, for the run history +--> Task per tool call
a guard, so a rerun skips done work | retries, cache, rate limit
+--> pause or suspend for input
+--> checkpointer -> DB
|
v
[ Response, and a run record ]
Fig 2. The same backend without Prefect and with a self-hosted Prefect Server
Agent framework λ Fig 1 μ μμͺ½ λ€ μ± μμ μ§κ³ orchestrator μ μ μ backend μμ§λμ΄μκ² λ¨κΈ΄λ€. Checkpointer λ graph μνμ snapshot μ super-step λ§λ€ thread id μλ μ μ₯νμ¬ λ©μΆ μ€νμ λ€μ μμνκ² νκ³ μ¬λμ΄ ν λ¨κ³λ₯Ό λμ΄ λ€μ¬λ€λ³΄κ³ μΉμΈνκ² νλ©°, node μ λΆμΈ retry policy λ κ·Έ node λ₯Ό μ§μ backoff λ‘ λ€μ μλνλ€ [2]. κ·Έλ¬λ©΄ scheduler μ semaphore μ κΈ°λ‘μ© νλ₯Ό backend μμ§λμ΄κ° μ§μ λ§λ€κ³ μ΄μνλ€.
Prefect λ κ°μ μ μ server μ worker λ‘ μ±μ°κ³ , agent loop λ tool νΈμΆμ΄ task μΈ flow κ° λλ€. Deployment λ flow λ₯Ό μ΄λμΒ·μΈμ Β·μ΄λ»κ² λλ¦΄μ§ μ μ΄ loop λ₯Ό API κ° κ΄λ¦¬νλ λμμΌλ‘ λ°κΎΈκ³ , schedule κ³Ό UI μ automation κ³Ό REST API κ° κ·Έ deployment λ₯Ό μΌ λ€. Work pool μ΄ infrastructure λ₯Ό κ°λ¦¬ν€κ³ worker κ° κ·Έ pool μ μ΄ν΄ μ€νμ κ·Έ μμμ μμνλ€ [3]. Self-hosted server λ API, UI, scheduling, work pool, κ·Έλ¦¬κ³ event μ automation engine μ λ΄λλ€ [4]. Prefect μ Pydantic AI μ¬μ΄μ 곡μ ν΅ν©μ΄ tool μ task λ‘ κ°μΈλ μΌμ λμ ν΄ μ£Όλ―λ‘, backend μμ§λμ΄κ° κ·Έ Python code λ₯Ό μ°μ§ μλλ€. Tool μ΄ μλμΌλ‘ task κ° λμ΄, νΈμΆλ§λ€ μ¬μλ μ€μ κ³Ό cache λ κ²°κ³Όμ μ€ν κΈ°λ‘ ν μ€μ λ°λ‘ κ°λλ€ [5]. Table 1 μ #6 State μ #7 Recovery κ° Prefect μͺ½μΌλ‘ ν¨κ» μ€λ μλ¦¬κ° μ¬κΈ°λ€.
Benchmarking μλ£λ λ κ°μ§λ₯Ό 견μ€λ€. μ νμ 견주λ νλͺ©κ³Ό Prefect μ λ΅μ Table 2 μ μκ³ , Prefect λ₯Ό μΉμ ꡬμ±κ³Ό μΉμ§ μμ ꡬμ±μ μ°¨μ΄λ Table 3 μ μλ€.
Table 2 μ μν νμ΄ benchmarking μλ£κ° μ νμ 견주λ νλͺ©μ΄κ³ , Prefect μ΄μ Prefect μ λ΅μ΄ μ ν μλ€.
Table 2. The benchmarking criteria, with Prefect's answer to each
| # | Criterion | Criterion details | Prefect |
|---|---|---|---|
| 1 | Orchestrator scope | AdmissionΒ·throughputΒ·record κ°μ΄λ° μ νμ΄ μ΄λ κ²μ μ§λκ° | AdmissionΒ·throughputΒ·record λͺ¨λ |
| 2 | Suspension | μ¬λμ κΈ°λ€λ¦¬λ μ€νμ΄ λ¬΄μμ λΆλ€κ³ μλκ° | μμ. Process κ° λΉ μ Έλκ° |
| 3 | Idempotent rerun | μ¬μ€νμ΄ μ΄λ―Έ λλ μΌμ μ΄λ»κ² νλκ° | μμ κ²°κ³Όλ₯Ό λΆλ¬μ΄ |
| 4 | Rate limiting | νΈμΆ μλλ₯Ό 무μμΌλ‘ λ¬Άλκ° | Python code μ΄λμμλ μ μΈμΌλ‘ |
| 5 | Per-step observability | μ€ν¨ν μ리λ₯Ό μ΄λκΉμ§ μ’ν μ£Όλκ° | Tool νΈμΆ νλ |
| 6 | One admission path | Trigger λ§λ€ Python code κ²½λ‘κ° λͺ κ° νμνκ° | Deployment νλ |
| 7 | ML pipeline integration | κ°μ μ νμ΄ μ¬νμ΅Β·λ°°ν¬ pipeline λ ν¨κ» λ리λκ° | λλ¦Ό |
| 8 | Access control | API μ UI λ₯Ό 무μμ΄ μ§ν€λκ° | Open source server μλ μμ |
| 9 | Inbound events | μΈλΆ system μ΄ μ€νμ μ΄λ»κ² μμνλκ° | Cloud webhook, λλ relay |
μ νμ΄ λ΅νμ§ λͺ»ν νμ backend μμ§λμ΄κ° Python code λ‘ μ±μ΄λ€.
μ΄ κΈ°λ₯μ λ κ΅¬μ± λͺ¨λμ νμνλ©°, Table 3 μ΄ κ° κΈ°λ₯μ 무μμ΄ μ§λμ§ μμͺ½μ λλν μ λλ€. Without Prefect μ΄μ agent framework νλλ§ μ΄ κ΅¬μ±μ΄κ³ , With Prefect μ΄μ κ°μ framework μμ Prefect λ₯Ό λν ꡬμ±μ΄λ€. Agent framework λ LLM νΈμΆκ³Ό tool μ ν loop λ₯Ό backend μμ§λμ΄κ° Python code λ‘ μ¨ λ£λ library μ΄λ©°, μ΄ λ¬Έμλ LangGraph λ₯Ό κ·Έ μλ‘ λ λ€ [2].
Table 3. The same function in each composition
| # | Function | Without Prefect | With Prefect |
|---|---|---|---|
| 1 | Step retry | ν graph μ€ν μ, node μ λΆμΈ retry policy | Task λ§λ€ λΆλ retries μ retry_delay_seconds |
| 2 | Resume after a crash | Checkpointer κ° λ§μ§λ§ super-step λΆν° thread λ₯Ό λ€μ λλ¦Ό | Framework μ checkpointer, κ·Έλ¦¬κ³ Prefect server κ° λ³΄κ΄νλ μ€ν μν |
| 3 | Human approval | Interrupt, κ·Έλ¦¬κ³ backend μμ§λμ΄κ° μ§μ μ°κ²°νλ resume νΈμΆ | wait_for_input μ λ°λ pause_flow_run, API λ‘ λ΅ν¨ |
| 4 | Where a run executes | μμ²μ λ΅ν web process | Work pool, κ·Έλ¦¬κ³ κ·Έ pool μ μ΄νΌλ worker |
| 5 | Suspension | Web process κ° thread λ₯Ό λΆλ€κ³ μ¬λμ μ λ ₯μ κΈ°λ€λ¦Ό | suspend_flow_run μ΄ λΉ μ Έλκ°κ³ , μ
λ ₯μ΄ λΏμΌλ©΄ μ€νμ΄ λ€μ μμλ¨ |
| 6 | Idempotent rerun | Backend μμ§λμ΄κ° 건λλΈ μ‘°κ±΄μ node μμ Python code λ‘ μ§μ μ μ | Result caching μ΄ μμ κ²°κ³Όλ₯Ό λΆλ¬ λ€μ λμ§ μμ |
| 7 | Rate limiting | Backend μμ§λμ΄κ° semaphore λ₯Ό μ§μ λ§λ€μ΄ νΈμΆ μλ₯Ό λ¬Άμ | Global concurrency limit κ³Ό rate limit |
| 8 | Per-step observability | Backend μμ§λμ΄κ° κΈ°λ‘μ© νλ₯Ό λ§λ€μ΄ λ¨κ³λ§λ€ κ²°κ³Όλ₯Ό μ§μ μ μ | Server μ UI μ λ΄κΈ΄ λͺ¨λ flow run κ³Ό task run |
| 9 | One admission path | Backend μμ§λμ΄κ° trigger λ§λ€ μ€νμ μμνλ κ²½λ‘λ₯Ό μ§μ μ°κ²°ν¨ | μμ²Β·scheduleΒ·automation μ΄ μΌλ deployment νλ |
| 10 | ML pipeline integration | Backend μμ§λμ΄κ° μ¬νμ΅κ³Ό λ°°ν¬λ₯Ό λ°λ‘ λ scheduler λ‘ λλ¦Ό | μ¬νμ΅Β·λ°°ν¬Β·agent κ° ν server μμ flow λ‘ λκ³ , μλ‘λ₯Ό μΌ€ μ μμ |
μ΄ ν κ°μ΄λ° μνμ With Prefect μ΄μ μ ν Prefect μ API νΈμΆκ³Ό μ€μ λ§μΌλ‘ κ°μΆ°μ§κ³ , #2 λ§ agent framework μ checkpointer λ₯Ό ν¨κ» μ΄λ€. μ΄ ν λͺ¨λμμ framework κ° μ λͺ«μ λ§‘λλ€. Prefect κ° κ°μΈλ κ²μ΄ κ·Έ framework μ loop μ tool code μ΄κ³ , μ΄λμ λ©μΆμ§, μ΄λ κ²°κ³Όλ₯Ό cache ν΄λ λλμ§, 무μμ ν λ¨κ³λ‘ λ³Όμ§λ framework μͺ½μ΄ μ νλ€.
Table 3 μ #5 λΆν° #10 κΉμ§ μ¬μ― νμμ agent framework λ κ·Έ κΈ°λ₯μ μ€μ€λ‘ κ°μΆμ§ λͺ»νλ€. Backend μμ§λμ΄κ° Python code λ₯Ό μμΌλ‘ μ¨μ μ±μ°κ±°λ, κ·Έλλ‘ λΉμ λλ€. κ·Έ μ¬μ― νμ΄ benchmarking μλ£μμ μ νμ κ°λ₯Έλ€. μλμ κ·Έ μ¬μ―μ κ°μ μ΄λ¦μΌλ‘ λμ΄λκ³ , νλ§λ€ Prefect κ° λ¬΄μμ νλμ§ μ λλ€.
- Suspension:
pause_flow_runμ κΈ°λ€λ¦¬λ λμ flow λ₯Ό μ΄λ € λκ³ ,suspend_flow_runμ λΉ μ Έλκ° infrastructure λ₯Ό κΊΌ λ μ μκ² νλ©°, μ λ ₯μ΄ λΏμΌλ©΄ μ€νμ΄ λ€μ μμλλ€ [6]. ν루λ₯Ό κΈ°λ€λ¦¬λ HITL λ¨κ³κ° process λ₯Ό νλλ μ‘μ λμ§ μλλ€. - Idempotent rerun: Prefect μ transactional orchestration μ΄ context κ° κ°μ μ¬μ€νμ λ€μ λλ¦¬μ§ μκ³ μμ κ²°κ³Όλ₯Ό λΆλ¬μ¨λ€ [5]. κ·Έ idempotency μλμμ λ€μ μλν agent μ€νμ΄ κ°μ tool νΈμΆμ LLM λΉμ©μ λ λ² μΉλ₯΄μ§ μλλ€.
- Rate limiting: Global concurrency limit μ΄ ν λ²μ λλ νΈμΆ μλ₯Ό λ¬Άκ³ , rate limit μ΄ μ΄λΉ slot ν볡λμΌλ‘ νΈμΆ κ°κ²©μ λ²λ¦°λ€ [7]. λμ flow λ°μ Python code μμλ μ°μ¬, task λ‘ κ°μΈμ§ μμ tool λ μν μμ λ λ€.
- Per-step observability: Tool νΈμΆ νλκ° task μ΄λ―λ‘ νλμ© λ°λ‘ μ€ν κΈ°λ‘μ 보μ΄κ³ νλμ© λ°λ‘ λ€μ μλλλ€ [5]. μ€ν¨ λ³΄κ³ μ agent μ€νμ΄ μ€ν¨νλ€λ κ²λ§ λ¨μ§ μκ³ , μ΄λ tool νΈμΆμ΄ μ΄λ μ λ ₯μμ μ€ν¨νλμ§κ° ν¨κ» λ¨λλ€.
- One admission path: Deployment νλκ° λνν μμ²κ³Ό μΌκ° schedule κ³Ό event κΈ°λ° automation μ ν¨κ» λ΅νλ€ [3]. μΌκ° μΌκ΄ μ€νκ³Ό λν μμ²μ΄ λ λ²μ΄ μλλΌ κ°μ Python code λ₯Ό λλ¦°λ€.
- ML pipeline integration: μ¬νμ΅Β·λ°°ν¬Β·agent κ° ν server μμ flow λ‘ λκ³ , μ flow κ° λλλ©΄ κ·Έ μνκ° λ€μ flow λ₯Ό μΌ λ€ [8]. μ¬νμ΅κ³Ό agent λ₯Ό λ 체κ³μ λλμ΄ λκ³ κ·Έ λμ μλ Python code λ₯Ό λ°λ‘ μΈ μΌμ΄ μλ€.
Agent μ€νμ΄ HTTP μλ΅μ λ΄λ³΄λΈ λ€μλ μ΄μ΄μ§λ backend μλ Prefect κ° μ 리νκ³ , HTTP μλ΅κ³Ό ν¨κ» μ€νμ΄ λλλ backend μλ λΆλ¦¬νλ€. μ¬κΈ°μ HTTP μλ΅μ frontend κ° λ³΄λΈ μμ² νλμ backend κ° λλ €μ£Όλ λ΅μ΄λ©°, κ·Έ μλ΅μ 보λ΄λ©΄ μμ²μ connection μ΄ λ«νκ³ μμ²μ λ°μλ web process λ λ€μ μμ²μΌλ‘ λμ΄κ°λ€. μλ μΈ μ‘°κ±΄μ΄ design μ΄ μ΄λ κ²½μ°μ μλμ§λ₯Ό κ°λ₯Έλ€.
- Assumption: Backend κ° μ process λ₯Ό κ°μ§ μ μλ€λ κ²μ΄λ€. Worker λ work pool μ μ΄ν΄ μ€νμ infrastructure μμμ μμνλ client μͺ½ process μ΄λ―λ‘ [3], μ€λ λλ process λ₯Ό κΈμ§νλ λ°°ν¬ λμμμλ worker λ₯Ό λ μ μμ΄ Fig 2 μ ꡬμ±μ΄ μ±λ¦½νμ§ μλλ€.
- Breaking condition: μΈμ¦μ΄λ€. Open source server μλ μ¬μ©μλ μΈμ¦λ μμ΄ UI λ API μ λΏλ λꡬλ κ·Έ server μ λν μ 체 κΆνμ κ°λλ€ [4]. κ·Έλμ self-hosted server λ μ¬μ€λ§ μμ λκ±°λ μΈμ¦νλ proxy λ€μ λλ€. Webhook μ Prefect Cloud μ κΈ°λ₯μ΄λ―λ‘ [4], μΈλΆ system μμ μ€νμ μμν΄μΌ νλ self-hosted backend λ κ·Έ event λ₯Ό Prefect API λ‘ λ³΄λ΄λ endpoint λ₯Ό μ§μ λ§λ λ€.
- Exclusion: μ€νμ΄ LLM νΈμΆ νλλ‘ λλκ³ κ·Έ κ²°κ³Όλ₯Ό λ€μ μ무λ μ°Ύμ§ μλ agent λ€. Server μ worker λ μ΄μν κ΅¬μ± μμ λμ΄κ³ , HTTP μλ΅κ³Ό ν¨κ» λλλ μ€νμ κ·Έ λμ΄ λ§‘μ μνλ₯Ό λ¨κΈ°μ§ μλλ€.
[1] GitHub. What is Workflow Orchestration?.
[2] LangChain. Checkpointers. LangGraph documentation.
[3] Prefect. Deployments. Prefect 3 documentation.
[4] Prefect. Cloud vs OSS feature comparison.
[5] Pydantic. Durable execution with Prefect. Pydantic AI documentation.
[6] Prefect. How to write interactive workflows. Prefect 3 documentation.
[7] Prefect. How to apply global concurrency and rate limits. Prefect 3 documentation.
[8] Prefect. Define event triggers. Prefect 3 documentation.
[9] LangChain. The best AI agent frameworks in 2026.
[10] Prefect. The only orchestrator built for AI agents.
- Agent framework: LLM νΈμΆκ³Ό tool μ ν loop λ₯Ό backend μμ§λμ΄κ° Python code λ‘ μ¨ λ£λ library. LangGraph κ° κ·Έ μλ€.
- Automation: λ§λ event κ° λΏμΌλ©΄ 미리 μ ν λμμ μμνλ Prefect μ κ·μΉ.
- Checkpointer: Graph μνλ₯Ό λ¨κ³λ§λ€ μ μ₯ν΄, λ©μΆ μ€νμ΄ κ·Έ μ리μμ λ€μ μμνκ² νλ κ΅¬μ± μμ.
- Deployment: μ΄λμΒ·μΈμ Β·μ΄λ»κ² λ릴μ§κ° λΆμ flow. API κ° κ΄λ¦¬νλ λμμ΄ λλ€.
- FDC (Fault Detection and Classification): μ₯λΉ μΌμ trace λ₯Ό μ§μΌλ³΄λ€κ° νκ³λ₯Ό λ²μ΄λλ©΄ alarm μ λ΄λ fab μͺ½ system.
- Flow: Prefect κ° ν μ€νμΌλ‘ λ€λ£¨λ ν¨μ.
- HITL (Human In The Loop): μ¬λμ μ λ ₯μ κΈ°λ€λ¦° λ€μ μ΄μ΄ κ°λ μ€ν.
- Idempotency: κ°μ μ λ ₯μΌλ‘ λ€μ λλ €λ κ²°κ³Όμ λΆμ ν¨κ³Όκ° ν λ² λλ¦° κ²κ³Ό κ°μ μ±μ§.
- Jinja: Prefect κ° event κ°μ flow μ parameter μ λΌμ λ£λ λ° μ°λ template λ¬Έλ².
- K8s (Kubernetes): Work pool μ΄ flow μ€νμ μ¬λ¦΄ μ μλ container platform.
- Orchestrator: Backend κ°μ΄λ° ν μ€νμ΄ μλλΌ λͺ¨λ μ€νμ λ§‘λ μͺ½. 무μμ΄ μ€νμ μμνλκ°, νΈμΆμ΄ ν λ²μ λͺ κ° λλκ°, μ€ν κΈ°λ‘μ 무μμ΄ λ¨λκ°λ₯Ό μ§λ€.
- Prefect Server: API, UI, scheduler, κ·Έλ¦¬κ³ event μ automation μ λ΄μ self-hosted orchestration backend.
- RAG (Retrieval Augmented Generation): μ§λ¬Έ μμ μ μ°Ύμμ¨ λ¬Έμλ₯Ό μ§λ¬Έκ³Ό ν¨κ» LLM μ 건λ€μ΄ λ΅νλ κ².
- Rate limit: μ ν΄μ§ μκ° μμ λκ° μ μλ νΈμΆ μμ μν.
- Result caching: μ λ ₯μ΄ κ°μ λ λ€μ λμ§ μκ³ μμ κ²°κ³Όλ₯Ό λΆλ¬μ€λ κ².
- Super-step: Graph κ° μν snapshot νλλ₯Ό μ μ₯νλ μ€ν λ¨μ.
- Task: Flow μμμ Prefect κ° λ°λ‘ μ¬μλνκ³ cache νκ³ κΈ°λ‘νλ λ¨μ.
- Thread: Checkpointer κ° ν λνμ μνλ₯Ό λͺ¨μ λλ λ¨μ.
- VM (Virtual Metrology): κ³μΈ‘νλ λμ 곡μ μΌμ λ°μ΄ν°λ‘ κ³μΈ‘κ°μ μμΈ‘νλ κ².
- Work pool: Flow μ€νμ΄ μ΄λ infrastructure μμμ λμ§ κ°λ¦¬ν€λ Prefect μ€μ .
- Worker: Work pool μ μ΄ν΄ μμ λ μ€νμ κ·Έ infrastructure μμμ μμνλ client μͺ½ process.
μλ νλͺ©μ Prefect κ° agent backend μμ νλ μΌμ΄κ³ , νλͺ© λμ κ΄νΈλ κ·Έκ²μ΄ Table 3 μ μ΄λ function μΈμ§λ₯Ό κ°λ¦¬ν¨λ€.
- μ€λ¨λ μ리μμ λ€μ μμ: LLM νΈμΆκ³Ό tool νΈμΆμ task λ¨μλ‘ cache νκ³ , μ€ν¨νλ©΄ κ·Έ μ리λΆν° λ€μ μμνλ€ (#2 Resume after a crash, #6 Idempotent rerun).
- μ¬μλμ μ ν μκ°: νΈμΆλ§λ€ retry policy μ timeout μ 건λ€. LLM API μ₯μ μ tool μ€λ₯μ λμνλ€ (#1 Step retry).
- Event λ‘ μλ μ€ν: FDC alarm μ΄λ drift κ°μ§ κ°μ event κ° λΏμΌλ©΄ agent λ₯Ό μλμΌλ‘ μ€ννλ€ (#9 One admission path).
- μ ν΄μ§ λλ§λ€ μ€ν: μ κΈ° λΆμ agent μ report agent λ₯Ό schedule μ κ±Έμ΄ μ€ννλ€ (#9 One admission path).
- μ¬λ¬ node μ λλμ΄ μ€ν: K8s node λ GPU worker μ μ€νμ λλμ΄ λ³΄λΈλ€ (#4 Where a run executes).
- μ€ν κΈ°λ‘ λ³΄κΈ°: Flow run κ³Ό task run μ log μ μνλ₯Ό UI μμ λ°λΌκ°λ€ (#8 Per-step observability).
- μ¬λμ μΉμΈ κΈ°λ€λ¦¬κΈ°:
pause_flow_runμΌλ‘ μΉμΈμ΄ λΏμ λκΉμ§ λ©μ·λ€κ° λ€μ μμνλ€ (#3 Human approval, #5 Suspension). - ML pipeline κ³Ό ν 체κ³μμ μ΄μ: μ¬νμ΅κ³Ό λ°°ν¬μ agent μ€νμ ν¨κ» λλ¦°λ€ (#10 ML pipeline integration).
- νΈμΆ μλ μ ν: λμ νΈμΆ μμ μ΄λΉ νΈμΆ μλλ₯Ό μ μΈμΌλ‘ λ¬Άλλ€. LLM API μ rate limit μ λμνλ€ (#7 Rate limiting).
μ§μ νμ§ μλ μΌ: LLM μΆλ‘ logic, memory μ RAG, μ€μκ° λν serving μ agent framework μ API server κ° λ§‘λλ€.
λ λ¨κ³λ‘ νλ€. emit_event κ° event λ₯Ό λ΄λ³΄λ΄κ³ , DeploymentEventTrigger λλ automation μ΄ κ·Έ event λ₯Ό λ°μ flow λ₯Ό μ€ννλ€ [8].
1. Emit the event β FDC system μ΄λ collector μͺ½μμ νλ€.
from prefect.events import emit_event
emit_event(
event="fdc.alarm.raised",
resource={"prefect.resource.id": "tool.ETCH01.TG1"},
payload={"wafer_id": "W123", "sensor": "RF_power", "severity": "high"},
)2. Run the agent flow from a trigger
from prefect import flow
from prefect.events import DeploymentEventTrigger
@flow
def fdc_agent(tool_id: str, wafer_id: str, sensor: str):
... # agent analysis, then the report and the notification
if __name__ == "__main__":
fdc_agent.serve(
name="fdc-agent",
triggers=[
DeploymentEventTrigger(
expect={"fdc.alarm.raised"},
match={"prefect.resource.id": "tool.*"},
parameters={ # Jinja injects the event values into the flow parameters
"tool_id": "{{ event.resource.id }}",
"wafer_id": "{{ event.payload.wafer_id }}",
"sensor": "{{ event.payload.sensor }}",
},
)
],
)Table 4. Trigger types
| # | Type | Use | Setting |
|---|---|---|---|
| 1 | Reactive | Event κ° λΏμΌλ©΄ κ³§λ°λ‘ μ€ν | κΈ°λ³Έκ° |
| 2 | Threshold | Event κ° N λ² μμ΄λ©΄ μ€ν (μ: 10 λΆ μμ alarm 3 ν) | threshold=3, within=timedelta(minutes=10) |
| 3 | Proactive | Event κ° μ€μ§ μμΌλ©΄ μ€ν (μ: λ°μ΄ν° μμ§ μ€λ¨) | posture="Proactive" |
| 4 | Compound / Sequence | μ¬λ¬ event μ μ‘°ν©μ΄λ μμκ° λ§μΌλ©΄ μ€ν | CompoundTrigger, SequenceTrigger |
| 5 | Flow state | λ€λ₯Έ flow κ° λλκ±°λ μ€ν¨νλ©΄ μ΄μ΄μ μ€ν | expect={"prefect.flow-run.Completed"} λ± |
External systems
- Prefect Cloud: webhook μ΄ μΈλΆ HTTP μμ²μ κ·Έλλ‘ event λ‘ λ°λλ€.
- Self-hosted (OSS): webhook μ΄ μμΌλ―λ‘ FastAPI endpoint λ KafkaΒ·MQ consumer κ°
emit_eventλ₯Ό λΆλ¬ κ·Έ μμ²μ event λ‘ λ°κΎΌλ€.
Fab application
- FDC alarm β Reactive β μμΈ λΆμ agent
- VM μ€μ°¨ μ΄κ³Όκ° 10 λΆ μμ 3 ν β Threshold β μ¬νμ΅ flow
- μΌμ λ°μ΄ν° 30 λΆ λ―Έμμ β Proactive β μ₯λΉ μ κ² μλ¦Ό
- μ¬νμ΅ μλ£ β Flow state β κ²μ¦ agent β report μμ±
μ΄ λ¬Έμκ° λΉκ΅ λμμΌλ‘ μ΄ κ²μ #1 LangGraph μ΄λ©°, κ³ λ₯Έ μ΄μ λ κΌμ§ 2 μ μ μλ€. μΆμ μμ μ κ° μ νμ κ³΅κ° λ°ν μμ μ΄λ€ [9].
Table 5. Agent frameworks and when each was first announced
| # | Framework | Framework details | Announced |
|---|---|---|---|
| 1 | LangGraph | Graph λ‘ μνλ₯Ό λ€λ£¬λ€. μ€ν κΈ°λ‘κ³Ό μ¬λ μΉμΈμ΄ νμν κ³³μ κΈ°λ³Έκ° | 2024-01 |
| 2 | CrewAI | μν μ λ§‘μ agent μ¬λΏμ νμΌλ‘ λ¬Άλλ€. Prototype κΉμ§ κ°μ₯ λΉ λ¦ | 2024-01 |
| 3 | OpenAI Agents SDK | Model μ΄ loop λ₯Ό λκ³ κ°λ€. GPT μ€μ¬μ΄λ©΄ μμ΄ κ°μ₯ λ κ° | 2025-03 |
| 4 | Google ADK | Multimodal μ κ°νλ€. Google Cloud NEXT 2025 μμ κ³΅κ° | 2025-04 |
| 5 | Claude Agent SDK | Claude Code μ agent harness. Claude Code SDK μμ μ΄λ¦μ λ°κΏ | 2025-09 |
| 6 | Microsoft Agent Framework | Graph κΈ°λ°. Azure μ .NET νκ²½μ μ ν | 2026-04 |
| 7 | Pydantic AI | Type μμ ν Python. V2 κ° durable execution μ λ΄μ | 2026-06 |
#7 Pydantic AI μ Prefect λ λ°λ‘ μ°λ λ μ νμ΄κ³ , κ·Έ λμ μλ package κ° κ³΅κ°λμ΄ μλ€ [5]. κ·Έ package λ₯Ό μ€μΉνλ©΄ Pydantic AI λ‘ μ΄ agent κ° Prefect μ flow λ‘ λκ³ κ·Έ agent μ tool μ΄ Prefect μ task κ° λλ―λ‘, κ°μΈλ Python code λ₯Ό μ§μ μΈ νμκ° μλ€. λ μ νμ΄ ν©μ³μ‘λ€κ±°λ νμͺ½μ΄ λ€λ₯Έ μͺ½μ μμμ μ°λ κ²μ μλλ€.
μΌκ³± κ°μ΄λ° μ°κ³ μ μ© package κ° λμ¨ κ²μ #7 Pydantic AI νλμ΄λ©°, λλ¨Έμ§λ backend μμ§λμ΄κ° μ§μ κ°μΌλ€. Prefect λ flow λ₯Ό Python ν¨μλ‘ λ€λ£¨λ―λ‘ Pydantic AI μ LangGraph λ₯Ό λΉλ‘―ν΄ Python μΌλ‘ λ μ΄λ€ agent framework λ λλ¦°λ€ [10].

Every section of this article offers something valuable to learn. The writing style is welcoming and informative without being overwhelming. Thank you for producing consistently excellent content.
Thank you for producing content that combines accuracy, clarity, and usefulness. The article is enjoyable to read and provides readers with meaningful knowledge they can appreciate.