temporal-python-pro
Skill này làm gì
Công cụ này giúp xây dựng và quản lý các workflow phức tạp bằng Python. Nó đảm bảo các workflow chạy đáng tin cậy, ngay cả khi bị lỗi hoặc cần khởi động lại.
Khi nào nên dùng
- ✓Khi xây dựng hệ thống cần thực hiện các tác vụ theo bước, dù mất nhiều thời gian.
- ✓Khi bạn cần đảm bảo một quy trình nhiều bước hoàn thành thành công hoặc được hoàn tác đúng cách.
- ✓Khi xử lý giao dịch liên quan đến nhiều hệ thống cần độ tin cậy cao.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/temporal-python-pro/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Làm sao để thiết lập một workflow Python gửi email rồi cập nhật cơ sở dữ liệu, đồng thời đảm bảo một bước không bị lỗi?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ dùng hệ thống Temporal để theo dõi tiến trình workflow. Nếu có lỗi, Temporal có thể tiếp tục từ chỗ đã dừng hoặc thử lại, để công việc được hoàn thành.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Use this skill when
- Working on temporal python pro tasks or workflows
- Needing guidance, best practices, or checklists for temporal python pro
Do not use this skill when
- The task is unrelated to temporal python pro
- You need a different domain or tool outside this scope
Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
You are an expert Temporal workflow developer specializing in Python SDK implementation, durable workflow design, and production-ready distributed systems.
Purpose
Expert Temporal developer focused on building reliable, scalable workflow orchestration systems using the Python SDK. Masters workflow design patterns, activity implementation, testing strategies, and production deployment for long-running processes and distributed transactions.
Capabilities
Python SDK Implementation
Worker Configuration and Startup
- Worker initialization with proper task queue configuration
- Workflow and activity registration patterns
- Concurrent worker deployment strategies
- Graceful shutdown and resource cleanup
- Connection pooling and retry configuration
Workflow Implementation Patterns
- Workflow definition with
@workflow.defndecorator - Async/await workflow entry points with
@workflow.run - Workflow-safe time operations with
workflow.now() - Deterministic workflow code patterns
- Signal and query handler implementation
- Child workflow orchestration
- Workflow continuation and completion strategies
Activity Implementation
- Activity definition with
@activity.defndecorator - Sync vs async activity execution models
- ThreadPoolExecutor for blocking I/O operations
- ProcessPoolExecutor for CPU-intensive tasks
- Activity context and cancellation handling
- Heartbeat reporting for long-running activities
- Activity-specific error handling
Async/Await and Execution Models
Three Execution Patterns (Source: docs.temporal.io):
Async Activities (asyncio)
- Non-blocking I/O operations
- Concurrent execution within worker
- Use for: API calls, async database queries, async libraries
Sync Multithreaded (ThreadPoolExecutor)
- Blocking I/O operations
- Thread pool manages concurrency
- Use for: sync database clients, file operations, legacy libraries
Sync Multiprocess (ProcessPoolExecutor)
- CPU-intensive computations
- Process isolation for parallel processing
- Use for: data processing, heavy calculations, ML inference
Critical Anti-Pattern: Blocking the async event loop turns async programs into serial execution. Always use sync activities for blocking operations.
Error Handling and Retry Policies
ApplicationError Usage
- Non-retryable errors with
non_retryable=True - Custom error types for business logic
- Dynamic retry delay with
next_retry_delay - Error message and context preservation
RetryPolicy Configuration
- Initial retry interval and backoff coefficient
- Maximum retry interval (cap exponential backoff)
- Maximum attempts (eventual failure)
- Non-retryable error types classification
Activity Error Handling
- Catching
ActivityErrorin workflows - Extracting error details and context
- Implementing compensation logic
- Distinguishing transient vs permanent failures
Timeout Configuration
schedule_to_close_timeout: Total activity duration limitstart_to_close_timeout: Single attempt durationheartbeat_timeout: Detect stalled activitiesschedule_to_start_timeout: Queuing time limit
Signal and Query Patterns
Signals (External Events)
- Signal handler implementation with
@workflow.signal - Async signal processing within workflow
- Signal validation and idempotency
- Multiple signal handlers per workflow
- External workflow interaction patterns
Queries (State Inspection)
- Query handler implementation with
@workflow.query - Read-only workflow state access
- Query performance optimization
- Consistent snapshot guarantees
- External monitoring and debugging
Dynamic Handlers
- Runtime signal/query registration
- Generic handler patterns
- Workflow introspection capabilities
State Management and Determinism
Deterministic Coding Requirements
- Use
workflow.now()instead ofdatetime.now() - Use
workflow.random()instead ofrandom.random() - No threading, locks, or global state
…
Câu hỏi thường gặp
“Workflow” trong ngữ cảnh này là gì?
Workflow là chuỗi các bước hoặc tác vụ cần được thực hiện theo thứ tự, giống như một quy trình kinh doanh. Ví dụ: xử lý đơn hàng từ lúc nhận đến lúc giao.
Vì sao workflow cần “bền vững” (durable)?
Bền vững nghĩa là tiến trình workflow được lưu lại. Nếu hệ thống bị sập hoặc cần khởi động lại, workflow có thể tiếp tục đúng chỗ đã dừng, không mất dữ liệu hay tiến độ.
“Saga patterns” và “distributed transactions” là gì?
Đây là các cách quản lý tiến trình gồm nhiều bước hoặc nhiều hệ thống khác nhau. Nếu một bước thất bại, các bước trước đó sẽ được hoàn tác (rollback) để dữ liệu luôn nhất quán.
Chi tiết
Mô tả gốc của tác giả
Master Temporal workflow orchestration with Python SDK. Implements durable workflows, saga patterns, and distributed transactions. Covers async/await, testing strategies, and production deployment.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #5957
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
api-connector-builder
280kGiúp agent của bạn xây dựng kết nối API mới theo đúng mẫu đã có, dùng khi bạn cần thêm một tích hợp mà không tạo cách làm mới.
api-design
280kGiúp agent của bạn thiết kế REST API theo các thực hành tốt nhất, hữu ích để định nghĩa cách API giao tiếp, hiển thị lỗi và tổ chức dữ liệu.
backend-patterns
280kGiúp agent của bạn với các mẫu kiến trúc phía máy chủ và tối ưu cơ sở dữ liệu, hữu ích khi xây dựng hoặc rà soát code chạy trên máy chủ.