workflow-orchestration-patterns – skill Agent & Tự động hóa cho agent AI
Thiết kế workflow bền vững với Temporal cho hệ thống phân tán. Bao gồm tách biệt workflow và activity, saga pattern, quản lý trạng thái và ràng buộc tính xác định (determinism). Dùng khi xây dựng quy trình chạy dài, giao dịch phân tán hoặc điều phối microservice.
Cài skill workflow-orchestration-patterns bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/workflow-orchestration-patterns-52ebf.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /workflow-orchestration-patterns – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/workflow-orchestration-patterns-52ebf.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $workflow-orchestration-patterns – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/workflow-orchestration-patterns-52ebf.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /workflow-orchestration-patterns – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/workflow-orchestration-patterns-52ebf.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /workflow-orchestration-patterns – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Workflow Orchestration Patterns
Master workflow orchestration architecture with Temporal, covering fundamental design decisions, resilience patterns, and best practices for building reliable distributed systems.
When to Use Workflow Orchestration
Ideal Use Cases (Source: docs.temporal.io)
- Multi-step processes spanning machines/services/databases
- Distributed transactions requiring all-or-nothing semantics
- Long-running workflows (hours to years) with automatic state persistence
- Failure recovery that must resume from last successful step
- Business processes: bookings, orders, campaigns, approvals
- Entity lifecycle management: inventory tracking, account management, cart workflows
- Infrastructure automation: CI/CD pipelines, provisioning, deployments
- Human-in-the-loop systems requiring timeouts and escalations
When NOT to Use
- Simple CRUD operations (use direct API calls)
- Pure data processing pipelines (use Airflow, batch processing)
- Stateless request/response (use standard APIs)
- Real-time streaming (use Kafka, event processors)
Detailed patterns and worked examples
Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.
Best Practices
Workflow Design
1. Keep workflows focused - Single responsibility per workflow
2. Small workflows - Use child workflows for scalability
3. Clear boundaries - Workflow orchestrates, activities execute
4. Test locally - Use time-skipping test environment
Activity Design
1. Idempotent operations - Safe to retry
2. Short-lived - Seconds to minutes, not hours
3. Timeout configuration - Always set timeouts
4. Heartbeat for long tasks - Report progress
5. Error handling - Distinguish retryable vs non-retryable
Common Pitfalls
Workflow Violations:
- Using
datetime.now()instead ofworkflow.now() - Threading or async operations in workflow code
- Calling external APIs directly from workflow
- Non-deterministic logic in workflows
Activity Mistakes:
- Non-idempotent operations (can't handle retries)
- Missing timeouts (activities run forever)
- No error classification (retry validation errors)
- Ignoring payload limits (2MB per argument)
Operational Considerations
Monitoring:
- Workflow execution duration
- Activity failure rates
- Retry attempts and backoff
- Pending workflow counts
Scalability:
- Horizontal scaling with workers
- Task queue partitioning
- Child workflow decomposition
- Activity batching when appropriate
Additional Resources
Official Documentation:
- Temporal Core Concepts: docs.temporal.io/workflows
- Workflow Patterns: docs.temporal.io/evaluate/use-cases-design-patterns
- Best Practices: docs.temporal.io/develop/best-practices
- Saga Pattern: temporal.io/blog/saga-pattern-made-easy
Key Principles:
1. Workflows = orchestration, Activities = external calls
2. Determinism is non-negotiable for workflows
3. Idempotency is critical for activities
4. State preservation is automatic
5. Design for failure and recovery
Skill liên quan
- workflow-patterns – Dùng skill này khi triển khai tác vụ theo quy trình TDD của Conductor, xử lý các điểm…
- find-complementary-founders – Dùng khi chủ sở hữu yêu cầu rõ ràng một đồng sáng lập hoặc đối tác dự án, hoặc nói rõ…
- firecrawl-scraper – Thu thập dữ liệu web chuyên sâu, chụp màn hình, phân tích PDF và crawl website bằng…
- flowhunt-skill – Kỹ năng kiểm toán khám phá tự động hóa. Dẫn qua quy trình phỏng vấn 5 câu hỏi, sau đó…
- folder-specific-claude-and-agents-md – Tạo hướng dẫn CLAUDE.md và AGENTS.md theo phạm vi thư mục cho các agent làm việc sau này…
- framework-migration-legacy-modernize – Điều phối quá trình hiện đại hóa hệ thống legacy toàn diện bằng mẫu strangler fig, cho…
- freshdesk-automation – Tự động hóa các thao tác helpdesk Freshdesk gồm ticket, contact, company, note và reply…
- freshservice-automation – Tự động hóa tác vụ ITSM Freshservice qua Rube MCP (Composio): tạo/cập nhật ticket, thao…