Course lesson 26 · Building AI Workflows
Build & Deploy a Workflow
The instructor creates and deploys the first destination-evaluation workflow with one named step returning dummy data. The class, entrypoint export, Wrangler binding, resource name, and class name are connected so Cloudflare can discover and execute it. A manual dashboard trigger then confirms the wiring before real browser and AI work are introduced.
Primary source: course video 26 · Supplied English subtitles · 00:09:15.
Understand the idea
- A WorkflowEntrypoint subclass owns the run method that coordinates the operation.
- The event carries parameters supplied when a workflow instance is created.
- The step object runs named operations whose results can be used by later steps.
- An individual workflow execution is an instance with an ID; it is distinct from the deployed workflow definition.
- Returning data from a step makes it available to subsequent code and visible as step output in the demonstrated dashboard.
What the course does
- Create a workflows folder and the destination-evaluation class in the data service.
- Implement run with an event argument and a step argument, initially using an unknown payload type.
- Add a descriptive step that logs an action and returns a small dummy object.
- Export the workflow class from the Worker entrypoint.
- Configure the workflow binding, deployed name, and exported class name in Wrangler, then deploy.
- Trigger an instance in the dashboard, inspect its completed step and output, and note how instance parameters and IDs are supplied.
Watch for
- The first successful deployment proves configuration only; it does not yet render a page or evaluate a destination.
- The dashboard is a teaching and debugging aid; application-triggered execution is introduced later.
- Added advice: lesson 34 changes how large step outputs are handled, so do not generalise this small dummy-output example to screenshots or full documents.
Follow the final workflow correction in lesson 34 when combining these steps.
Recall before revealing
What is the difference between a workflow definition and an instance?
Reveal the explanation
The definition is the deployed class and its steps; an instance is one execution of that definition with its own identity, inputs, and progress.
Try it
Change the dummy step to return a small diagnostic object describing the input URL, then trigger two distinct test instances.
Check your result
You can locate each instance separately and connect its visible output to the parameters supplied for that execution.
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:01:20 — WorkflowEntrypoint subclass
- 00:02:37 — Defining a named step
- 00:05:05 — Export and Wrangler configuration
- 00:06:58 — Manual instance trigger
- 00:07:58 — Inspecting returned step output
Companion primary documentation: Workflows Workers API. For recorded API names, commands, limits, and prices, check the version you use.