AI curriculum
Course outline for Cloudflare for AI Applications and Agents
Build a small Cloudflare application that answers support questions and stores bounded job state. Run a Worker, coordinate requests through a Durable Object, and make a real Workers AI exchange. Test duplicate requests, concurrent work, dependency failure, and data boundaries before comparing other execution choices.
Cloudflare for AI Applications and Agents Course Objectives
- Write, configure, run, and deploy a Worker in an authorized environment.
- Implement persistent job state and duplicate handling with a Durable Object.
- Connect Workers AI and inspect an actual service response.
- Test concurrent requests, dependency failure, recovery, and protected state boundaries.
- Distinguish Wrangler local behavior from deployed platform behavior and limits.
- Compare Dynamic Workers, Containers, Sandboxes, gateway control, and vector retrieval accurately.
Pre-requisites
- Small HTTP handlers, JavaScript or TypeScript, JSON, and asynchronous functions.
- Basic model requests and test assertions over persisted state.
- Terminal, package scripts, and safe handling of account secrets.
- No Cloudflare experience required; an authorized disposable account is prerequisite setup.
Before this course
Complete the required courses or bring equivalent experience. Recommended courses add useful depth; they are not enrolment gates.
Required preparation
Recommended preparation
Readiness checks
- Small HTTP handlers, JavaScript or TypeScript, JSON, and asynchronous functions.
- Basic model requests and test assertions over persisted state.
- Terminal, package scripts, and safe handling of account secrets.
- No Cloudflare experience required; an authorized disposable account is prerequisite setup.
Small HTTP handlers, JavaScript or TypeScript, JSON, and asynchronous functions.
Find your place in the learning mapLab Setup
Delivery requirements: the environment, access, and exercise materials must be prepared and verified before delivery. This outline does not certify that a lab package is ready.
Supported stable Node.js/Wrangler/TypeScript toolchain, project shell, disposable authorized Cloudflare account, Workers/Durable Objects/Workers AI entitlements, selected model access, capped spending, synthetic support facts, test identity adapter, and cleanup checks. Compatibility dates, storage/class configuration, local-versus-remote behavior, quotas, deployment permissions, and removal require verification. No production credentials or public unauthenticated writes.
Detailed Course Outline
Module 1: Handle the first Worker request (2 hours)
- Workers handler foundations: Workers request handlers, responses, runtime APIs, and isolate execution.
- Wrangler project configuration: Project files, Wrangler configuration, bindings, and compatibility dates.
- Local runtime response: Local runtime startup and a learner-edited visible response.
- Validation and errors: Input validation, explicit errors, and secret-free configuration.
- Authorized test deployment: Authorized test deployment, request inspection, and cleanup ownership.
- Dependency and state placement: Edge proximity versus remote dependency and state placement.
- Guided-time allocation: 0.75 hours for explanation and a worked example, 0.75 hours for learner practice, 0.25 hours for feedback, and 0.25 hours for questions and contingency.
Practical outcome: Run modified Worker source locally and deploy an inspected handler to the authorized test account.
Module 2: Give changing state a clear owner (2 hours)
- Durable Object foundations: Durable Object identity, bindings, methods, and private storage basics.
- Class and storage setup: Supported class declaration, storage setup, and configuration lifecycle.
- Persistent deduplication: Stable job/request identity and atomic duplicate-result recording.
- Tenant-to-object authorization: Protected state transitions and authoritative tenant-to-object mapping.
- Concurrency and invariants: Concurrent calls, await boundaries, and application-level invariants.
- Independent state checks: Independent state inspection after repeated and competing requests.
- Guided-time allocation: 0.75 hours for explanation and a worked example, 0.75 hours for learner practice, 0.25 hours for feedback, and 0.25 hours for questions and contingency.
Practical outcome: Implement a persistent job method and show one allowed effect under duplicate and concurrent calls.
Module 3: Ask Workers AI through the application (2 hours)
- Workers AI responsibilities: Workers AI inference versus Worker execution and object coordination.
- AI binding operation: AI binding, supported model interface, and request/response inspection.
- Remote inference from development: Actual remote inference during local development and its charges.
- Answer support and failure: Answer validity, missing evidence, and explicit failure states.
- Data minimization: Data minimization before model submission and retained-record rules.
- Durable result linkage: Durable job status linked to observed model outcome.
- Guided-time allocation: 0.75 hours for explanation and a worked example, 0.75 hours for learner practice, 0.25 hours for feedback, and 0.25 hours for questions and contingency.
Practical outcome: Execute one real Workers AI exchange and persist a checked result without exporting protected fields.
Module 4: Survive repeats and broken dependencies (2 hours)
- Repeated and parallel requests: Parallel client requests and duplicate job identifiers against real objects.
- Inference and commit boundaries: Retry boundaries before inference, after response, and during state commit.
- Controlled dependency faults: Controlled timeout and error injection beside successful real inference.
- External-call limits: No false completion and no unsupported exactly-once external-call claim.
- Cross-tenant negative tests: Cross-tenant identifiers, denied access, and protected-state checks.
- Independent recovery checks: Recovery with independent state and request-result reconciliation.
- Guided-time allocation: 0.75 hours for explanation and a worked example, 0.75 hours for learner practice, 0.25 hours for feedback, and 0.25 hours for questions and contingency.
Practical outcome: Run duplicate/concurrency/failure tests and prove the stated persisted-state invariant and recovery behavior.
Module 5: Check the deployed application separately (2 hours)
- Local and remote boundaries: Wrangler emulation, local state, remote bindings, and production differences.
- Deployed binding checks: Deployed Worker/Object configuration and test resource identity checks.
- Deployed concurrency smoke tests: Authorized deployed requests and bounded repeat/concurrency smoke tests.
- Latency quotas and spend: Response time, dependency placement, limits, quotas, and spend controls.
- Resource cleanup: Secret redaction, denied routes, state retention, and test-resource cleanup.
- Independent boundary test: Learner-authored unseen boundary test before explanatory feedback.
- Guided-time allocation: 0.75 hours for explanation and a worked example, 0.75 hours for learner practice, 0.25 hours for feedback, and 0.25 hours for questions and contingency.
Practical outcome: Compare local and deployed observations and verify a new failure/recovery condition without claiming global-load coverage.
Module 6: Choose another execution shape only when needed (2 hours)
- Dynamic Workers boundaries: Dynamic Workers loading, bindings, egress, and current interface boundaries.
- Container lifecycle: Containers processes, image/runtime needs, lifecycle, and persistence responsibilities.
- Sandbox and authorization boundaries: Sandboxes isolation, exposed capabilities, and application authorization boundaries.
- Availability and support: Current availability, paid plans, beta features, and supported compatibility.
- Gateway inference and retrieval roles: AI Gateway proxy/control versus Workers AI inference and Vectorize retrieval.
- Placement and simpler alternatives: Sourced placement choice for a new workload and simpler alternative.
- Guided-time allocation: 0.75 hours for explanation and a worked example, 0.75 hours for learner practice, 0.25 hours for feedback, and 0.25 hours for questions and contingency.
Practical outcome: Explain a concrete interface example for each comparison and reject an unsuitable or unsupported execution choice.
Practical exercise
- The proposed starter supplies a TypeScript project shell, synthetic support facts, test identity adapter, HTTP client, and empty Worker/Object methods. The learner authors validation, object access mapping, persistent deduplication, state transitions, AI binding call, and one independent test. A supplied identity adapter is not a production authentication implementation. Durable Object isolation alone does not authorize access to the object named by untrusted input.
- Run and deploy actual Cloudflare source/configuration. A real Workers AI response is required, not a vendor-neutral replacement. Validate answer support against the small known fact set. Run parallel/repeated requests and inspect persisted state independently. Inject a timeout and a failure around result persistence, recover, and check that false completion and duplicate accepted effects do not occur. Describe potential repeated billable inference separately from idempotent state.
- Run cross-tenant and protected-field negative tests locally and bounded smoke tests on authorized deployed resources. Compare observations, not implied global capacity. Complete a new boundary-condition task before opening feedback. Explain which request hit local emulation, remote AI, or deployed state. Remove test resources and verify the cleanup checklist. Containers, Dynamic Workers, and Sandboxes require sourced comparison only; a changing preview cannot silently become a mandatory lab.
Delivery and timing
- Guided hours include teaching, demonstrations, learner practice, feedback, questions, and contingency as allocated above. Breaks, bulk downloads, account approval, and prerequisite setup are additional. Allocations need a timed learner pilot before delivery; they are not measured completion times.
What you will produce
Implement and test a Cloudflare application with Workers, Durable Objects, and actual Workers AI inference.
How the work is checked
- Complete Worker/Object source, bindings, configuration, and observed requests agree.
- Real Workers AI exchange and answer-quality check are linked to stored job state.
- Concurrent and duplicate tests independently verify one accepted state effect.
- Failures preserve valid state, explicit uncertainty, and a tested recovery route.
- Unauthorized identifiers and protected data cannot cross the declared boundary.
- Local emulation is not presented as production limits or worldwide performance.
- Comparison cites current APIs, maturity, lifecycle, and costs without platform equivalence.
12 guided hours. Actual Workers, Durable Objects, and Workers AI operation is required, including authorized deployed checks. AI Gateway, Vectorize, Dynamic Workers, Containers, and Sandboxes are sourced comparisons with feature-specific availability and preview limits. Remote inference during local development can incur charges. No generic simulator replaces required platform operation. No global benchmark, arbitrary-code sandbox deployment, exactly-once external inference, or production security certification is claimed.
When another approach is better
- A centralized application is simpler when edge placement adds coordination without a measured latency benefit.
- Do not use a component whose verified availability, state semantics, or isolation properties do not fit the workload.
How we train
Contact us for full course details, including duration, delivery options and lab requirements.
Ask about exercises, instructor feedback and the prior knowledge you need. Tool-specific courses marked provisional may become modules in a broader course.
Discuss your learning goals