W

workflow-orchestration-patterns

Устойчивые процессы на Temporal

Проектирует устойчивые процессы на Temporal для распределённых систем: разделение workflow и activity, саги, состояние, ограничения детерминизма. Нужен для долгих процессов, распределённых транзакций и оркестрации микросервисов.

★ 40,2 тыс. на GitHub Бэкенд и API в один клик в VibeeCode

Установка

$npx skills add https://github.com/wshobson/agents/tree/156b7a5e7a8b93642628a339ee4039c925b34c7f/plugins/backend-development/skills/workflow-orchestration-patterns

Ставит скилл в текущий проект, CLI спросит, для каких агентов. С флагом -g - для всех проектов. Нужен Node.js.

Описание автора

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. ---

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 of workflow.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

Ещё из wshobson/agents 184

  1. Aaccessibility-complianceв один кликДоступные интерфейсы по WCAG 2.2wshobson/agents★ 40,2 тыс.
  2. Aai-debt-detectorв один кликАудит техдолга после кода от ИИwshobson/agents★ 40,2 тыс.
  3. Aairflow-dag-patternsв один кликПайплайны на Apache Airflowwshobson/agents★ 40,2 тыс.
  4. Aangular-migrationв один кликМиграция с AngularJS на Angularwshobson/agents★ 40,2 тыс.
  5. Aanti-reversing-techniquesв один кликАнти-реверс и защита от отладкиwshobson/agents★ 40,2 тыс.
  6. Aapi-design-principlesв один кликПроектирование REST и GraphQL APIwshobson/agents★ 40,2 тыс.
  7. Aarchitecture-decision-recordsв один кликЗаписи архитектурных решений (ADR)wshobson/agents★ 40,2 тыс.
  8. Aarchitecture-patternsв один кликПаттерны архитектуры бэкенда: Clean и DDDwshobson/agents★ 40,2 тыс.
  9. Aasync-python-patternsв один кликАсинхронный Python: asyncio и паттерныwshobson/agents★ 40,2 тыс.
  10. Aattack-tree-constructionв один кликДеревья атак для карты угрозwshobson/agents★ 40,2 тыс.
Все скиллы wshobson/agents →

Похожие скиллы

  1. Cclaude-apiв один кликПриложения на основе Claude APIanthropics/skills★ 179,4 тыс.
  2. Aaspnet-coreв один кликРазработка на ASP.NET Coreopenai/skills★ 27,8 тыс.
  3. FFullstack Dev SkillsНабор из 67 скиллов для фулстекаjeffallan/claude-skills★ 11,7 тыс.
  4. Xxberg-io/xbergИзвлечение данных из 107 форматовxberg-io/xberg★ 9,4 тыс.
  5. Ccli-creatorв один кликСоздание CLI для Codexopenai/skills★ 27,8 тыс.
  6. Cczlonkowski/n8n-code-javascriptКод на JavaScript в нодах n8nczlonkowski/n8n-skills★ 6,4 тыс.
  7. Ggoogle/cloud/firebase-basicsВход и проекты в Firebase CLIgoogle/skills★ 20,6 тыс.
  8. Cczlonkowski/n8n-code-pythonКод на Python в нодах n8nczlonkowski/n8n-skills★ 6,4 тыс.
Все скиллы раздела «Бэкенд и API» →