skills/temporal-applications-python/SKILL.md
Design, implement, and refactor high-quality Temporal workflows and activities in Python. Use when building or changing Temporal Python applications; when designing activities (injectable deps, Pydantic params/result, business logic outside); when implementing workflows with dynamic inputs or Continue-As-New; or when configuring reliability (timeouts, retries, idempotency), determinism, or testing. Covers boundaries, typed contracts, bounded history, and progressive disclosure via resources.
npx skillsauth add michael-f-bryan/skills temporal-applications-pythonInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Guidance for designing and implementing Temporal workflows and activities in Python so they are testable, type-safe, reliable, and keep orchestration separate from business logic. Use this skill when designing new workflows or activities, refactoring or extending existing ones, or when you need patterns for determinism, timeouts, retries, idempotency, or testing.
Load the skill first; then use the Resource index below to load only the resource(s) relevant to your task.
Next step: Infer your task from the user request, then use the Resource index table below to choose which resources/ file(s) to load.
Workflows — Orchestrate only. No I/O or non-deterministic APIs in workflow code. Use SDK APIs for time/random/UUID. State that must survive Continue-As-New lives in a serialisable params model; copy from params into workflow instance at the start of run. Details and examples → resources/workflows-continue-as-new.md, resources/determinism.md.
Activities — Thin wrappers. Dependencies (DB, HTTP client, browser, etc.) are injected at construction (e.g. in worker bootstrap). Each activity method has one Pydantic params type and one result type; no tuples or multiple return values. Business logic lives in a separate, testable module or function that the activity calls. Details and examples → resources/activities.md.
Child workflows vs activities — Use child workflows for per-item orchestration (e.g. one child per item in a batch); use activities for side effects (I/O, external APIs). Keep history small by extracting loops into child workflows and passing state via params when using Continue-As-New.
Before considering the work done, check:
workflow.now(), workflow.random(), workflow.uuid4(); version workflow changes with patching when needed. See resources/determinism.md.continue_as_new when using N-in-flight. See resources/workflows-continue-as-new.md.Load only the resource(s) that match your task. SKILL.md (this file) is the entry point; resources hold the detailed guidance and examples.
| Intent / task | Resource(s) to load | | ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Design or refactor an activity (class shape, deps, params/result, thin wrapper, heartbeats) | resources/activities.md | | Design or refactor an activity and care about timeouts, retries, or idempotency | resources/activities.md + resources/reliability.md | | Implement or refactor a workflow with a list/queue, long-running, or Continue-As-New | resources/workflows-continue-as-new.md | | Workflow code rules: determinism, replay, what’s allowed in workflow vs activity, versioning/patching | resources/determinism.md | | Timeouts, retries, heartbeats, or idempotency for activities | resources/reliability.md | | Testing activities, workflows, or replay (ActivityEnvironment, WorkflowEnvironment, Replayer) | resources/testing.md | | Refactor existing workflow/activity (determinism, replay, testability) | resources/workflows-continue-as-new.md and/or resources/activities.md + resources/determinism.md + resources/testing.md; add resources/reliability.md if timeouts/idempotency are involved | | General “build a Temporal Python app” | Start with this SKILL; add resources by sub-task (activity design → activities.md; workflow with list → workflows-continue-as-new.md; etc.) |
Cross-references: Resources may point to other resources (e.g. “For idempotency see reliability.md”). Load those when the task requires it.
documentation
Use when handling multi-step tasks, investigations, or long sessions where working notes, interim findings, and scratch planning are needed to keep context and handoffs clear.
documentation
When generating or editing markdown content, actively look for existing pages to link to and incorporate relevant wikilinks so content is interconnected. Use when writing notes, docs, or any .md content.
development
Wait for a GitHub Actions run to finish with minimal terminal output and a reliable exit code. Use when an agent must wait for CI to pass (e.g. after push, after opening a PR, or when verifying a specific run). Prefer gh run watch with --exit-status and --compact to avoid flooding context with poll output.
testing
Use when drafting, editing, or evaluating communication that should sound like Michael across public technical prose, internal notes, agent prompts, engineering feedback, and concise operational updates.