Course lesson 25 · Building AI Workflows
What are Cloudflare Workflows?
The next feature evaluates destination pages: render their content, ask AI whether the product remains available, and preserve evidence. Cloudflare Workflows supplies named steps with persisted progress and configurable retry behaviour, making the process easier to manage than a long HTTP request. The lesson explains the intended architecture before implementation and contrasts it with much heavier data-processing orchestration.
Primary source: course video 25 · Supplied English subtitles · 00:07:27.
Understand the idea
- The evaluator checks content health, such as a sold-out product, rather than merely whether a URL responds.
- Rendering matters because JavaScript can populate important information after the initial HTML arrives.
- A workflow coordinates a sequence of operations and retains state between steps.
- Per-step retry policies allow cheap retrieval and expensive inference to have different failure budgets.
- Sleep and waiting for events support delayed or externally coordinated work without treating the whole operation as one short request.
What the course does
- Identify the destination URL as the input and page health as the application-facing result.
- Plan a rendering step that collects visible text and HTML.
- Plan an AI step that interprets the collected page content.
- Plan evidence storage so the collected input can later support debugging and evaluation.
- Inspect the WorkflowEntrypoint class, its run method, and named steps in the conceptual example.
- Review concurrency and duration constraints before treating the example as a high-volume production design.
Watch for
- The recording’s concurrency counts, sleep limits, product availability, and competitor comparisons are historical claims rather than current guidance.
- The instructor presents more advanced model-evaluation systems as extensions; they are not built in this section.
- Added advice: a completed workflow only proves the processing finished, not that the AI judgement is correct.
Recall before revealing
Why give browser rendering and AI inference different retry policies?
Reveal the explanation
They have different failure modes and costs; retrying an expensive inference repeatedly may waste money even when retrying a transient rendering failure is useful.
Try it
Sketch three or four named steps for checking a product page, and write the output needed by the following step.
Check your result
Each step has a clear responsibility and a reason for the data it passes onward; the AI input comes from rendered evidence.
Practice prompts and answer checks are added teaching material. Answer from memory first, then compare and explain any difference.
Rewatch only what you need
Open this lesson in your original course library and seek to the times below. Videos are not hosted on this site.
- 00:00:30 — Render, evaluate, and preserve destination evidence
- 00:02:08 — Persisted multi-step applications
- 00:03:09 — Workflow entrypoint and run method
- 00:04:06 — Per-step retries and backoff
- 00:05:09 — Recorded workflow concurrency constraints
Companion primary documentation: Workflows Workers API. For recorded API names, commands, limits, and prices, check the version you use.