Skip to content

[Submission] Durable Wordle #120

@MasonEgger

Description

@MasonEgger

Project link

https://github.com/temporal-community/durable-wordle

Language

Python

Short description (max 256 chars)

Wordle where each game is a Temporal Workflow, not a database row. Crash the server mid-game and your progress survives. A small, complete app demoing durable execution, Updates, Queries, and Activities, fully playable from the Temporal CLI or a web UI.

Long Description

Durable Wordle is the word game you already know, rebuilt so that each game session is a Temporal Workflow instead of a row in a database. There is no database at all. The Workflow's event history is the game state.

Kill the worker mid-guess and restart it, and Temporal replays the history, rebuilds your exact board, and finishes the guess that was in flight. Nothing lost, and you didn't write a single line of save-and-restore code.

How It's Built

It's a small, complete, readable app that maps Wordle mechanics directly onto the core Temporal building blocks, so it works as both a teaching reference and a "show, don't tell" demo:

  • Start Workflow: each game session starts a Workflow; a deterministic Workflow ID reconnects a returning player.
  • Updates: make_guess mutates state and returns feedback, with a synchronous validator that rejects malformed guesses before anything is written to history.
  • Queries: get_game_state returns the board, read-only, any time.
  • Activities: word selection, real dictionary-API word validation (with Temporal retries), and green/yellow/gray scoring, each visible in the event history.
  • Durable Execution: the worker holds state in memory; a restart replays history to rebuild it with zero data loss.

The Workflow is the whole game

All game logic lives in the Workflow, never in the API layer. You can play a complete game from the command line with temporal workflow start / update / query, which makes it a great way to show what's actually happening underneath. Two modes ship: a daily word (deterministic via workflow.now()) and a random word (via workflow.random()), both replay-safe.

Stack

Temporal Python SDK, FastAPI, and Jinja2 on the backend; HTMX and Tailwind on the frontend. uv for packaging, just for tasks, and a Docker Compose setup that brings up the Temporal dev server, worker, and web app with one command.

Great for learning durable execution and the Python SDK by reading one complete example, or for running a quick booth or conference demo that lets someone feel why durability matters.

Author(s)

@MasonEgger - Temporal

Metadata

Metadata

Assignees

Labels

code exchange submissionCode and/or content about Temporal!triageIssues that Temporal folk need to look atziggy reviewedPre-screened by ZiggyBot

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions