temporal
Build durable, distributed workflows using Temporal to ensure fault tolerance.
Install
mkdir -p .claude/skills/temporal && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17119" && unzip -o skill.zip -d .claude/skills/temporal && rm skill.zipInstalls to .claude/skills/temporal
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Build reliable distributed workflows with Temporal. Use when a user asks to orchestrate microservices, handle long-running workflows, implement saga patterns, build reliable background jobs, or create fault-tolerant distributed systems.Key capabilities
- →Build reliable distributed workflows
- →Orchestrate microservices with fault tolerance
- →Implement saga patterns for long-running processes
- →Create reliable background jobs
- →Define workflows that survive crashes and automatically retry
- →Interact with external services through activities
How it works
This skill provides code examples and guidelines for building reliable distributed workflows using Temporal, which ensures exactly-once execution and fault tolerance.
Inputs & outputs
When to use temporal
- →Implement a saga pattern
- →Orchestrate microservices
- →Build reliable background tasks
About this skill
Temporal
Overview
Temporal is a durable execution platform for building reliable distributed systems. Workflows survive crashes, retries are automatic, and long-running processes (days, months) just work. Used by Netflix, Snap, and Stripe for mission-critical workflows.
Instructions
Step 1: Setup
# Start Temporal server locally
brew install temporal
temporal server start-dev
# Initialize TypeScript project
npx @temporalio/create@latest my-workflows --sample hello-world
cd my-workflows
Step 2: Define Workflow
// src/workflows.ts — Order processing workflow
import { proxyActivities, sleep } from '@temporalio/workflow'
import type * as activities from './activities'
const { processPayment, reserveInventory, sendConfirmation, shipOrder } = proxyActivities<typeof activities>({
startToCloseTimeout: '30 seconds',
retry: { maximumAttempts: 3 },
})
export async function orderWorkflow(orderId: string, items: Item[]): Promise<OrderResult> {
// Step 1: Reserve inventory (retries automatically on failure)
const reservation = await reserveInventory(orderId, items)
// Step 2: Process payment
const payment = await processPayment(orderId, reservation.total)
// Step 3: Wait for warehouse confirmation (could take hours)
await sleep('2 hours')
// Step 4: Ship and notify
const tracking = await shipOrder(orderId)
await sendConfirmation(orderId, tracking)
return { orderId, tracking, total: reservation.total }
}
// If the server crashes at step 3, Temporal resumes from exactly where it stopped.
// No data loss, no duplicate payments, no orphaned orders.
Step 3: Define Activities
// src/activities.ts — Business logic (can fail and retry)
export async function processPayment(orderId: string, amount: number) {
const result = await stripe.charges.create({
amount: Math.round(amount * 100),
currency: 'usd',
metadata: { orderId },
})
return { chargeId: result.id, status: result.status }
}
export async function reserveInventory(orderId: string, items: Item[]) {
// Check stock, create reservation
const total = items.reduce((sum, item) => sum + item.price * item.quantity, 0)
return { reservationId: `res_${orderId}`, total }
}
export async function sendConfirmation(orderId: string, tracking: string) {
await sendEmail({ to: orderEmail, subject: `Order ${orderId} shipped`, body: `Tracking: ${tracking}` })
}
Step 4: Start Workflow
// src/client.ts — Start a workflow from your API
import { Client } from '@temporalio/client'
const client = new Client()
// Start workflow (returns immediately, workflow runs in background)
const handle = await client.workflow.start(orderWorkflow, {
taskQueue: 'orders',
workflowId: `order-${orderId}`,
args: [orderId, items],
})
// Check status
const result = await handle.result() // waits for completion
const status = await handle.describe() // current status
Guidelines
- Temporal guarantees exactly-once execution of workflow steps — even through crashes and deployments.
- Use for anything that spans multiple services or takes more than a few seconds.
- Activities are the only way to interact with the outside world from workflows.
- Temporal Cloud (hosted) starts free for development. Self-hosted is free with Docker.
- Don't use Temporal for simple cron jobs — it's designed for complex, stateful workflows.
When not to use it
- →When the user needs to implement simple cron jobs
- →When the user needs to build systems that do not require stateful, long-running workflows
- →When the user needs to interact with the outside world directly from workflows
Limitations
- →Temporal is designed for complex, stateful workflows, not simple cron jobs
- →Activities are the only way to interact with the outside world from workflows
- →Workflows are defined in specific programming languages like TypeScript, Go, Python, Java, .NET
How it compares
This workflow provides a durable execution platform for complex, stateful distributed systems, contrasting with simpler task queues or manual retry logic.
Compared to similar skills
temporal side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| temporal (this skill) | 0 | 3mo | Review | Advanced |
| architecture-patterns | 55 | 3mo | No flags | Advanced |
| ark-analysis | 0 | 4mo | Review | Beginner |
| backend-expert | 0 | 2mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by TerminalSkills
View all by TerminalSkills →You might also like
architecture-patterns
wshobson
Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use when architecting complex backend systems or refactoring existing applications for better maintainability.
ark-analysis
mckinsey
Analyze the Ark codebase by cloning the repository to a temporary location. Use this skill when the user asks questions about how Ark works, wants to understand Ark's implementation, or needs to examine Ark source code.
backend-expert
FlavioProgramador
Advanced backend engineering guidelines focusing on clean architecture, API standards, performance, asynchronous jobs, and clean code principles.
workflow-orchestration-patterns
wshobson
Design durable workflows with Temporal for distributed systems. Covers workflow vs activity separation, saga patterns, state management, and determinism constraints. Use when building long-running processes, distributed transactions, or microservice orchestration.
auth-http-api-cloudbase
TencentCloudBase
Use when you need to implement CloudBase Auth v2 over raw HTTP endpoints (login/signup, tokens, user operations) from backends or scripts that are not using the Web or Node SDKs.
generating-grpc-services
jeremylongshore
Generate gRPC service definitions, stubs, and implementations from Protocol Buffers. Use when creating high-performance gRPC services. Trigger with phrases like "generate gRPC service", "create gRPC API", or "build gRPC server".