Python Nexus tutorial: planning drafts - #7
Conversation
Mirrors the Java decouple-monolith tutorial with Python-idiomatic code. - TUTORIAL.md — Mode A draft, 14 modules, ~75 min, monolith→decoupled→durability arc - SANDBOX.md — repo structure for python/ folder, Instruqt step mapping, test strategy - AUDIT.md — pacing audit (73% active), terminology check, completeness vs. learning outcomes Feedback-driven additions vs. straight Java port: - "Why Nexus vs alternatives" framing in Module 1 - Nexus vs. Child Workflow decision guide in Module 12 - Local-fallback setup alongside Instruqt in Module 0 Designed using the temporal-edu-skills /edu:learning-experience-designer skill, informed by Replay 2026 workshop feedback (5 sessions, 97 responses). Diagrams marked inline as <!-- DIAGRAM: ... --> placeholders for later production. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds draft planning documentation for a Python port of the “Decoupling Temporal Services with Nexus” tutorial, intended to lock tutorial structure, sandbox layout, and pacing before the Python code/exercises are implemented.
Changes:
- Adds a full learner-facing tutorial draft with module structure, checkpoints, and diagram placeholders.
- Specifies the intended
/pythonsandbox folder layout, solution branch strategy, and Instruqt step mapping. - Provides a pacing/terminology/completeness audit plus open technical questions to confirm before publishing.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| python/_planning/TUTORIAL.md | Draft end-to-end tutorial narrative + code snippets + checkpoints/quiz/decision guide |
| python/_planning/SANDBOX.md | Proposed Python sandbox structure, solution branches, devcontainer spec, and Instruqt mapping |
| python/_planning/AUDIT.md | Pacing + terminology audit, learning-outcome coverage, and pre-publish open questions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # payments/review_caller.py — for reference, no edits required | ||
| from temporalio import workflow | ||
|
|
There was a problem hiding this comment.
Resolved in 5bf1a56 — the entire human-review path (including payments/review_caller.py) was cut to fit the 30-min budget, so the unimported-timedelta snippet is gone with it. The sync-operation pattern is signposted in Going further if a Part 2 picks it up.
| ## Test strategy | ||
|
|
||
| Per `AGENTS.md` non-negotiable #6 (majority integration tests on real DB/API, minority unit, plus E2E): | ||
|
|
There was a problem hiding this comment.
Agreed and remove the testing section as this isn't relevant in this workshop
There was a problem hiding this comment.
Removed the testing section from python/_planning/SANDBOX.md as requested in commit ab0a2af.
| | E2E | `test_e2e_nexus.py` | Full dev server, both namespaces, real endpoint, three transactions | | ||
| | E2E (manual) | "kill-the-worker" script in `tests/manual/` | Helper that scripts the Module 10 outage demo for CI verification | | ||
|
|
||
| All tests must **fail loudly** if a required env var is unset — never skip. (AGENTS.md non-negotiable #10.) |
|
|
||
| ## Terminology audit | ||
|
|
||
| Cross-referenced against `_shared/terminology.md`. |
There was a problem hiding this comment.
Fixed in 5bf1a56. The reference now reads 'Cross-referenced against Temporal terminology guidance (e.g., the disambiguation rules tracked by the Temporal Edu team)' — pointing at the team-owned source rather than a file path that doesn't live in this repo.
| 2. **Check compliance** (risk score, sanctions screening). | ||
| 3. **Execute** the payment through the gateway. | ||
|
|
||
| All three steps live in a single Worker, in a single Namespace, on a single Task Queue. The Payments team and the Compliance team share the deployment. That means **one team's bug is everyone's outage** — a NullPointerException in compliance code crashes the Worker mid-payment, and now nobody can process money. |
There was a problem hiding this comment.
Fixed in 5bf1a56. The Module 1 framing now says 'a runtime crash in compliance code kills the Worker mid-payment' — language-neutral.
|
|
|
|
||
| Skip to Module 1. | ||
|
|
||
| ### Option 2 — Local fallback |
There was a problem hiding this comment.
Local fallback should be a section at the end. We can link to it here but we should recommend Instruqt as it will allow the user to get up and running quickly with no environmental issues. If they really want, they can run locally, but that will be a separate section at the end to not distract from a good flow
There was a problem hiding this comment.
Updated in 43c65b7: Module 0 now recommends Instruqt first and links local setup to a separate end section (Appendix A — Local fallback setup).
There was a problem hiding this comment.
Done in 5bf1a56. Module 0 is now Instruqt-only (~2 min) with a one-line pointer to the appendix. The full local setup steps live in Appendix — Local setup (optional) at the end, clearly marked as not counting toward the 30-min budget.
| @@ -0,0 +1,864 @@ | |||
| # Decoupling Temporal Services with Nexus and the Python SDK | |||
|
|
|||
| **Time:** ~75 min · **Difficulty:** Intermediate · **SDK:** Python 3.10+ | |||
There was a problem hiding this comment.
@copilot 75 minutes is a long time! Can we limit it to 30? I don't think the Java tutorial takes 75 min
There was a problem hiding this comment.
Updated in 43c65b7: tutorial timing is now ~30 min (core path), with AUDIT aligned to a 30-minute core path and extended content clearly marked as optional.
There was a problem hiding this comment.
Done in 5bf1a56 — this goes further than the relabel-only patch in 43c65b7 by actually cutting Modules 11 (human review path) and 12 (full quiz/decision guide) and compressing the remaining modules. New total: ~33 min for the Instruqt core path (the 30-min budget excludes the local-setup appendix per your follow-up note). The Nexus-vs-Child-Workflow decision rule survives as a 3-bullet callout in the Module 10 wrap-up.
Resolves PR #7 review comments. Tutorial scope cuts to fit 30 min (Instruqt path only — local appendix excluded): - Drop Module 11 (Human review path / sync Nexus operation + Workflow Update) - Drop Module 12 (Quiz + scenario questions); decision rule survives as a 3-bullet callout in the wrap-up - Compress remaining modules from ~75 min total → ~33 min total Structure changes: - Module 0 is now Instruqt-only (~2 min); local setup moved to a clearly-marked appendix at the end with a note that its time is NOT counted toward the budget - Tutorial now has 11 modules (was 14) Copilot inline-comment fixes: - Remove Java-ism "NullPointerException" from Module 1 framing (was a leftover from the Java port) - Reference to payments/review_caller.py (which had a missing timedelta import) is gone with the rest of the human-review path - Remove _shared/terminology.md reference in AUDIT.md; replace with a generic pointer to Temporal Edu terminology guidance Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per PR review feedback: better pedagogy to run the monolith first, then let learners discover the problems themselves via a Socratic prompt, then introduce Nexus terminology just-in-time before the transformation. Module order changes: Before After 1. The problem (read) 1. Run the monolith (do) 2. Nexus building blocks (read) 2. What's wrong with this picture? (reflect + reveal) 3. Run the monolith (do) 3. Nexus building blocks (read) Module 2 is a new Socratic discovery step: - Three concrete observations from the running system (one Namespace, one Task Queue, one Worker) - A 30-second reflection prompt: "what goes wrong?" - A <details> reveal with three concrete failure modes (blast radius, deploy cadence, scaling) and the three-alternatives comparison table that was previously the body of old Module 1 - Module 10 wrap-up callback now references "the three problems from Module 2" to close the loop Aligns with the edu skill's "Do, then understand" core principle and the workshop-feedback request to favor hands-on time. New active ratio is 66% (up from 61%); total stays ~32 min. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Reordered modules 1-3 in 439f726 per the "do-first, understand-second" feedback. Diff:
New Module 2 — What's wrong with this picture? has three pieces:
Module 10 wrap-up now closes the loop with "Remember the three problems from Module 2..." Pacing impact: active ratio 61% → 66% (more time hands-on). Total stays ~32 min. |
|
|
||
| ## Prerequisites | ||
|
|
||
| - Comfortable with Temporal **Workflows**, **Activities**, and **Workers** in Python. If not, run the [Hello World tutorial](https://learn.temporal.io/getting_started/python/hello_world_in_python/) first. |
There was a problem hiding this comment.
Is this tutorial up to date? should we point elsewhere?
…lone Activities Per PR review feedback. - Module 3 mental model: replace the mixed-metaphor "interface / method / address-book entry" line with a single coherent HTTP+DNS analogy, plus an explicit team-ownership paragraph (who owns the implementation vs. the call site) - Module 9 opener: drop "This is the demo that sells Nexus" — was selling to the learner instead of teaching. Replaced with "Now we prove the durability claim" - Module 10 decision guide: add a fourth bullet for Standalone Activities (Pre-release Python feature for starting Activities directly from a Client without a wrapping Workflow). Updated the one-line heuristic accordingly - Module 10 "Going further": added Standalone Activities link as the first follow-on topic Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…d Standalone Activities" This reverts commit 681fc14.
What this is
Planning artifacts for the Python port of the Java Decoupling Temporal Services with Nexus tutorial. Not the code itself — three review-ready docs that lock the tutorial structure, sandbox layout, and pacing before anyone writes Python.
All three live in
python/_planning/so they're easy to delete (or relocate) once the actualpython/code lands in a follow-up PR.Files
TUTORIAL.md— Full draft of the learner-facing tutorial. 11 modules, ~32 min for the Instruqt path. Mirrors the Java arc monolith → decoupled → durability proven, but cuts the human-in-the-loop path to fit the time budget (signposted in Going further). 2<!-- DIAGRAM: ... -->placeholders inline with descriptions of what each should depict.SANDBOX.md— Spec for the futurepython/code folder: directory layout, solution branches (solution/todo-1…solution/complete), devcontainer (local-only), and Instruqt step-to-module mapping with per-step auto-checks.AUDIT.md— Pacing audit (66% active, clears the 60% target), terminology audit, completeness check against the 6 learning outcomes, and open questions to resolve before publishing.Pedagogical flow: "do first, understand second"
The first three modules implement the edu-skill's core principle — give learners running code, let them find the problems, then explain:
<details>block) lists three concrete failure modes — shared blast radius, shared deploy cadence, shared scaling — plus the three-alternatives comparison that motivates Nexus.Modules 4–9 are the guided transformation (5 TODOs, 2 checkpoints, the kill-the-worker durability demo). Module 10 wraps up with the Nexus vs. Child Workflow vs. Activity decision rule as a 3-bullet callout, closing the loop back to the problems surfaced in Module 2.
Feedback-driven decisions vs. straight Java port
Informed by Replay 2026 workshop feedback (5 sessions / 97 responses, including the "Nexus Morning Session – Python"):
Python-specific structural difference from Java
The Python SDK puts the Nexus endpoint binding inside the Workflow via
workflow.create_nexus_client(endpoint=...)— noNexusServiceOptionsat Worker registration like Java. One less concept for learners to track. Module 7 (TODO 4 — stub swap) highlights this.What I'm looking for from reviewers
temporalio>=1.14.1.AUDIT.mdflags this as open question Add Java decouple-monolith Nexus exercise #1.Not in this PR
python/{shared,compliance,payments,monolith}/— next PR, once this plan is locked.Source
Designed using the temporal-edu-skills
/edu:learning-experience-designerskill.🤖 Generated with Claude Code