Inteli Logo

Module 8 · Information Systems · Lesson 8 · Lab

The pipeline as a Prefect DAG

This page reproduces, in the browser, the session in which a coding agent turns the runner of Lesson 7 into a Prefect 3 flow. The folder starts as a copy of the package tcg-dataapp of Lesson 7; each of the four prompts makes the agent write the files of the reference package and run them. The panels below the editor show each flow run as the server of Prefect records it: the graph of task runs with the state of each one, the logs, a time line that puts the runner of Lesson 7 and the flow on the same scale, the rows written to ops.pipeline_runs and, in the last step, the deployment that runs the flow every day at 06:00 UTC. Nothing runs here: the code is the code of the repository, and the runs, their timings and their logs were recorded on 12/11/2026 against tcgcsv.com.

pipeline.pythe runner of Lesson 7: 12 tasks, one after the other, in about 40 sbefore
▶
flows.pytasks, one flow and futures: the order comes from the datastep 01
▶
retries · cache · hooksoptions chosen task by task, and the run log of Lesson 7step 02
▶
tests/test_flows.pyfive tests on a temporary server, without networkstep 03
▶
server · deploymentprefect server start, tcg-dataapp serve, cron 0 6 * * *step 04
A DAG each task is a node and each edge says that one task needs the output of another · Prefect orders the graph, runs independent tasks at the same time, retries, caches and records every state · The server keeps the history and starts the scheduled runs (step 04)
Steps Speed
lesson_08_dag — Welcomesimulation
⎇ mainstep —UTF-8

What is real and what is simulated

The files of the editor are those of lab/lesson-8/tcg_dataapp/, and the folder starts with the package of lab/lesson-7/. Two files are first versions that later steps replace: flows.py of step 01, without retries, cache or hooks, and cli.py of step 01, without serve. The runs were recorded on 12/11/2026 by build_lab_data.py with the final code: step 01 replays the first run without the lines of the state hooks, which that version does not have yet. The agent, its messages and the pace of the typing are a staging of the session.

How to use it in class

  • Send each prompt and stop at the end of the step to compare the files with the slides.
  • The panel Flow run plays each run on its recorded clock; click a task to see its state, attempts and upstream tasks, and press “Replay” to watch it again.
  • The panel Time line answers why the flow is faster than the runner: the five downloads overlap.
  • The icon ⚙ lists what the orchestrator adds and the file that delivers each item.

Doing it for real

The README of lab/lesson-8/ lists the commands. Over a copy of the package of Lesson 7, with pip install -e '.[dev]' 'prefect>=3.4,<4', the four prompts of prompts/ go to the coding agent in this order. The reference package passes its 14 tests without network, runs once with tcg-dataapp flow and serves the deployment with tcg-dataapp serve after prefect server start; the UI is at http://127.0.0.1:4200. Prompt 05 is the work of the second hour, over the DataApp of each group.

Prompt

Prompt
Section