Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0589a99
Clean up references/core/ai-integration.md
donald-pinckney Feb 13, 2026
22d90c5
Clean up references/core/common-gotchas.md
donald-pinckney Feb 13, 2026
a32152b
Clean up references/core/common-gotchas.md
donald-pinckney Feb 13, 2026
9ce8441
Clean up references/core/determinism.md
donald-pinckney Feb 13, 2026
519b2ea
Clean up references/core/determinism.md
donald-pinckney Feb 13, 2026
49c449a
Update error-reference.md
donald-pinckney Feb 17, 2026
d2a4af3
Update interactive-workflows.md
donald-pinckney Feb 17, 2026
e62865a
Clean up patterns.md
donald-pinckney Feb 17, 2026
324b532
Cut shell scripts
donald-pinckney Feb 17, 2026
5d3f79f
Edit troubleshooting.md
donald-pinckney Feb 17, 2026
19a9589
remove interceptors for now
donald-pinckney Feb 18, 2026
761b220
remove dynamic workflows
donald-pinckney Feb 18, 2026
4d032f4
clarify on heartbeating of async activity completions, and prompt it …
donald-pinckney Feb 18, 2026
8d77164
Improve references/python/advanced-features.md
donald-pinckney Feb 18, 2026
ceb40a0
Use explicit namespace in connect
donald-pinckney Feb 18, 2026
c61bc64
remove duplicated content from determinism.md, clean up
donald-pinckney Feb 18, 2026
236eab2
Improve references/python/data-handling.md
donald-pinckney Feb 18, 2026
43b1ed7
Prefer start_to_close_timeout
donald-pinckney Feb 18, 2026
cc593e3
don't explicitely provide defaults for retry policies
donald-pinckney Feb 18, 2026
24f0e3e
error-handling.md cleanup
donald-pinckney Feb 18, 2026
18cb1e8
move idempotency patterns to patterns.md
donald-pinckney Feb 18, 2026
03e8706
remove multi-param activities
donald-pinckney Feb 18, 2026
3f7dc9d
small edits
donald-pinckney Feb 18, 2026
9163fa2
Unify sandbox stuff into one file
donald-pinckney Feb 18, 2026
4c288cf
local activities aren't experimental
donald-pinckney Feb 18, 2026
b8b47ca
Clean up references/python/sync-vs-async.md
donald-pinckney Feb 18, 2026
9bc285f
Cleanup observability.md, remove duplicated search attributes
donald-pinckney Feb 19, 2026
f455d39
Cut otel for now
donald-pinckney Feb 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up references/core/common-gotchas.md
  • Loading branch information
donald-pinckney committed Feb 13, 2026
commit a32152bbbc974b3e7f7baaaf55ce3c54484e119f
65 changes: 17 additions & 48 deletions references/core/common-gotchas.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

Common mistakes and anti-patterns in Temporal development. Learning from these saves significant debugging time.

## Idempotency Issues

### Non-Idempotent Activities
## Non-Idempotent Activities

**The Problem**: Activities may execute more than once due to retries or Worker failures. If an activity calls an external service without an idempotency key, you may charge a customer twice, send duplicate emails, or create duplicate records.

Expand All @@ -16,9 +14,7 @@ Common mistakes and anti-patterns in Temporal development. Learning from these s

**Note:** Local Activities skip the task queue for lower latency, but they're still subject to retries. The same idempotency rules apply.

## Replay Safety Violations

### Side Effects & Non-Determinism in Workflow Code
## Side Effects & Non-Determinism in Workflow Code

**The Problem**: Code in workflow functions runs on first execution AND on every replay. Any side effect (logging, notifications, metrics, etc.) will happen multiple times and non-deterministic code (IO, current time, random numbers, threading, etc.) won't replay correctly.

Expand All @@ -39,9 +35,7 @@ Common mistakes and anti-patterns in Temporal development. Learning from these s

See `references/core/determinism.md` for more info.

## Worker Management Issues

### Multiple Workers with Different Code
## Multiple Workers with Different Code

**The Problem**: If Worker A runs part of a workflow with code v1, then Worker B (with code v2) picks it up, replay may produce different Commands.

Expand All @@ -51,70 +45,45 @@ See `references/core/determinism.md` for more info.

**The Fix**:
- Use Worker Versioning for production deployments
- Use patching APIs
- During development: kill old workers before starting new ones
- Ensure all workers run identical code

### Stale Workflows During Development

**The Problem**: Workflows started with old code continue running after you change the code.
**Note:** Workflows started with old code continue running after you change the code, which can then induce the above issues. During development (NOT production), you may want to terminate stale workflows (`temporal workflow terminate --workflow-id <id>`), or use `find-stalled-workflows.sh` included in this skill to detect stuck workflows.

**Symptoms**:
- Workflows behave unexpectedly after code changes
- Non-determinism errors on previously-working workflows

**The Fix**:
- Terminate stale workflows: `temporal workflow terminate --workflow-id <id>`
- Use `find-stalled-workflows.sh` to detect stuck workflows
- In production, use versioning for backward compatibility

## Workflow Design Anti-Patterns

### The Mega Workflow

**The Problem**: Putting too much logic in a single workflow.

**Issues**:
- Hard to test and maintain
- Event history grows unbounded
- Single point of failure
- Difficult to reason about

**The Fix**:
- Keep workflows focused on a single responsibility
- Use Child Workflows for sub-processes
- Use Continue-as-New for long-running workflows
See `references/core/versioning.md` for more info.

### Failing Too Quickly
## Failing Activities Too Quickly

**The Problem**: Using aggressive retry policies that give up too easily.
**The Problem**: Using aggressive activity retry policies that give up too easily.

**Symptoms**:
- Workflows failing on transient errors
- Unnecessary workflow failures during brief outages

**The Fix**: Use appropriate retry policies. Let Temporal handle transient failures with exponential backoff. Reserve `maximum_attempts=1` for truly non-retryable operations.
**The Fix**: Use appropriate activity retry policies. Let Temporal handle transient failures with exponential backoff. Reserve `maximum_attempts=1` for truly non-retryable operations.

## Query Handler Mistakes
## Query Handler & Update Validator Mistakes

### Modifying State in Queries
### Modifying State in Queries & Update Validators

**The Problem**: Queries are read-only. Modifying state in a query handler causes non-determinism on replay because queries don't generate history events.
**The Problem**: Queries and update validators are read-only. Modifying state causes non-determinism on replay, and must strictly be avoided.

**Symptoms**:
- State inconsistencies after workflow replay
- Non-determinism errors

**The Fix**: Queries must only read state. Use Updates for operations that need to modify state AND return a result.
**The Fix**: Queries and update validators must only read state. Use Updates for operations that need to modify state AND return a result.

### Blocking in Queries
### Blocking in Queries & Update Validators

**The Problem**: Queries must return immediately. They cannot await activities, child workflows, timers, or conditions.
**The Problem**: Queries and update validators must return immediately. They cannot await activities, child workflows, timers, or conditions.

**Symptoms**:
- Query timeouts
- Query / update validators timeouts
- Deadlocks

**The Fix**: Queries return current state only. Use Signals or Updates to trigger async operations.
**The Fix**: Queries and update validators must only look at current state. Use Signals or Updates to trigger async operations.

### Query vs Signal vs Update

Expand Down