You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds initial support for TypeScript to the skill
---------
Co-authored-by: James Watkins-Harvey <mjameswh@users.noreply.github.com>
Co-authored-by: Chris Olszewski <chrisdolszewski@gmail.com>
Copy file name to clipboardExpand all lines: SKILL.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
---
2
2
name: temporal-developer
3
-
description: This skill should be used when the user asks to "create a Temporal workflow", "write a Temporal activity", "debug stuck workflow", "fix non-determinism error", "Temporal Python", "workflow replay", "activity timeout", "signal workflow", "query workflow", "worker not starting", "activity keeps retrying", "Temporal heartbeat", "continue-as-new", "child workflow", "saga pattern", "workflow versioning", "durable execution", "reliable distributed systems", or mentions Temporal SDK development.
3
+
description: This skill should be used when the user asks to "create a Temporal workflow", "write a Temporal activity", "debug stuck workflow", "fix non-determinism error", "Temporal Python", "Temporal TypeScript", "workflow replay", "activity timeout", "signal workflow", "query workflow", "worker not starting", "activity keeps retrying", "Temporal heartbeat", "continue-as-new", "child workflow", "saga pattern", "workflow versioning", "durable execution", "reliable distributed systems", or mentions Temporal SDK development.
4
4
version: 1.0.0
5
5
---
6
6
7
7
# Skill: temporal-developer
8
8
9
9
## Overview
10
10
11
-
Temporal is a durable execution platform that makes workflows survive failures automatically. This skill provides guidance for building Temporal applications in Python.
11
+
Temporal is a durable execution platform that makes workflows survive failures automatically. This skill provides guidance for building Temporal applications in Python and TypeScript.
12
12
13
13
## Core Architecture
14
14
@@ -91,6 +91,7 @@ Once you've downloaded the file, extract the downloaded archive and add the temp
91
91
92
92
1. First, read the getting started guide for the language you are working in:
Copy file name to clipboardExpand all lines: references/core/determinism.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,7 @@ For a few simple cases, like timestamps, random values, UUIDs, etc. the Temporal
79
79
Each Temporal SDK language provides a protection mechanism to make it easier to catch non-determinism errors earlier in development:
80
80
81
81
- Python: The Python SDK runs workflows in a sandbox that intercepts and aborts non-deterministic calls at runtime.
82
+
- TypeScript: The TypeScript SDK runs workflows in an isolated V8 sandbox, intercepting many common sources of non-determinism and replacing them automatically with deterministic variants.
-**Non-retryable**: Invalid input, authentication failures, business rule violations, resource not found
153
+
154
+
## Cancellation Handling
155
+
156
+
### Not Handling Workflow Cancellation
157
+
158
+
**The Problem**: When a workflow is cancelled, cleanup code after the cancellation point doesn't run unless explicitly protected.
159
+
160
+
**Symptoms**:
161
+
- Resources not released after cancellation
162
+
- Incomplete compensation/rollback
163
+
- Leaked state
164
+
165
+
**The Fix**: Use language-specific cancellation scopes or try/finally blocks to ensure cleanup runs even on cancellation. See language-specific gotchas for implementation details.
166
+
167
+
### Not Handling Activity Cancellation
168
+
169
+
**The Problem**: Activities must opt in to receive cancellation. Without proper handling, a cancelled activity continues running to completion, wasting resources.
170
+
171
+
**Requirements for activity cancellation**:
172
+
1.**Heartbeating** - Cancellation is delivered via heartbeat. Activities that don't heartbeat won't know they've been cancelled.
173
+
2.**Checking for cancellation** - Activity must explicitly check for cancellation or await a cancellation signal.
174
+
175
+
**Symptoms**:
176
+
- Cancelled activities running to completion
177
+
- Wasted compute on work that will be discarded
178
+
- Delayed workflow cancellation
179
+
180
+
**The Fix**: Heartbeat regularly and check for cancellation. See language-specific gotchas for implementation patterns.
181
+
182
+
## Payload Size Limits
183
+
184
+
**The Problem**: Temporal has built-in limits on payload sizes. Exceeding them causes workflows to fail.
185
+
186
+
**Limits**:
187
+
- Max 2MB per individual payload
188
+
- Max 4MB per gRPC message
189
+
- Max 50MB for complete workflow history (aim for <10MB in practice)
190
+
191
+
**Symptoms**:
192
+
- Payload too large errors
193
+
- gRPC message size exceeded errors
194
+
- Workflow history growing unboundedly
195
+
196
+
**The Fix**: Store large data externally (S3/GCS) and pass references, use compression codecs, or chunk data across multiple activities. See the Large Data Handling pattern in `references/core/patterns.md`.
Copy file name to clipboardExpand all lines: references/core/patterns.md
+74Lines changed: 74 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -331,6 +331,80 @@ Run:
331
331
332
332
This ensures that on replay, already-completed steps are skipped.
333
333
334
+
## Large Data Handling
335
+
336
+
**Purpose**: Handle data that exceeds Temporal's payload limits without polluting workflow history.
337
+
338
+
**Limits** (see `references/core/gotchas.md` for details):
339
+
- Max 2MB per individual payload
340
+
- Max 4MB per gRPC message
341
+
- Max 50MB for workflow history (aim for <10MB)
342
+
343
+
**Key Principle**: Large data should never flow through workflow history. Activities read and write large data directly, passing only small references through the workflow.
344
+
345
+
**Wrong Approach**:
346
+
```
347
+
Workflow
348
+
│
349
+
├── downloadFromStorage(ref) ──▶ returns large data (enters history)
350
+
│
351
+
├── processData(largeData) ────▶ large data as argument (enters history AGAIN)
352
+
│
353
+
└── uploadToStorage(result) ───▶ large data as argument (enters history AGAIN)
354
+
```
355
+
356
+
This defeats the purpose—large data enters workflow history multiple times.
download(inputRef) → process → upload → return outputRef
366
+
```
367
+
368
+
The workflow only handles references (small strings). The activity does all large data operations internally.
369
+
370
+
**Implementation Pattern**:
371
+
1. Accept a reference (URL, S3 key, database ID) as activity input
372
+
2. Download/fetch the large data inside the activity
373
+
3. Process the data inside the activity
374
+
4. Upload/store the result inside the activity
375
+
5. Return only a reference to the result
376
+
377
+
**Other Strategies**:
378
+
-**Compression**: Use a PayloadCodec to compress data automatically
379
+
-**Chunking**: Split large collections across multiple activities, each handling a subset
380
+
381
+
## Activity Heartbeating
382
+
383
+
**Purpose**: Enable cancellation delivery and progress tracking for long-running activities.
384
+
385
+
**Why Heartbeat**:
386
+
1.**Support activity cancellation** - Cancellations are delivered to activities via heartbeat. Activities that don't heartbeat won't know they've been cancelled.
387
+
2.**Resume progress after failure** - Heartbeat details persist across retries, allowing activities to resume where they left off.
388
+
3.**Detect stuck activities** - If an activity stops heartbeating, Temporal can time it out and retry.
389
+
390
+
**How Cancellation Works**:
391
+
```
392
+
Workflow requests activity cancellation
393
+
│
394
+
▼
395
+
Temporal Service marks activity for cancellation
396
+
│
397
+
▼
398
+
Activity calls heartbeat()
399
+
│
400
+
├── Not cancelled: heartbeat succeeds, continues
401
+
│
402
+
└── Cancelled: heartbeat raises exception
403
+
Activity can catch this to perform cleanup
404
+
```
405
+
406
+
**Key Point**: If an activity never heartbeats, it will run to completion even if cancelled—it has no way to learn about the cancellation.
407
+
334
408
## Local Activities
335
409
336
410
**Purpose**: Reduce latency for short, lightweight operations by skipping the task queue. ONLY use these when necessary for performance. Do NOT use these by default, as they are not durable and distributed.
0 commit comments