本文へスキップ
Skillpedia
自動化48k · #6201

workflow-orchestration-patterns

できること

このスキルは、複数の手順やサービスが関わる複雑な処理を、どのように整理して管理するかを理解する手助けをします。途中で何か問題が起きても、処理全体が確実に動くようにするためのパターンを学べます。

使う場面

  • ✓互いに依存しているタスクを整理する必要があるとき。
  • ✓長い処理の途中の一つのステップがエラーになっても、処理全体が完全に失敗しないようにしたいとき。
  • ✓複数の部品が確実に連携して動くシステムを構築するとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/workflow-orchestration-patterns/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/workflow-orchestration-patterns/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“在庫システムが一時的に止まっても、オンライン注文の処理が正しく動くようにするにはどうすればよいですか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

「ワークフロー」(処理全体を制御するロジック)と「アクティビティ」(外部で行う具体的な作業)という考え方を説明します。「Saga」や「Entity Workflows」といったパターンに従うことで、障害から回復できる堅牢なシステムを構築できます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Workflow Orchestration Patterns

Master workflow orchestration architecture with Temporal, covering fundamental design decisions, resilience patterns, and best practices for building reliable distributed systems.

Use this skill when

  • Working on workflow orchestration patterns tasks or workflows
  • Needing guidance, best practices, or checklists for workflow orchestration patterns

Do not use this skill when

  • The task is unrelated to workflow orchestration patterns
  • 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.

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)

Critical Design Decision: Workflows vs Activities

The Fundamental Rule (Source: temporal.io/blog/workflow-engine-principles):

  • Workflows = Orchestration logic and decision-making
  • Activities = External interactions (APIs, databases, network calls)

Workflows (Orchestration)

Characteristics:

  • Contain business logic and coordination
  • MUST be deterministic (same inputs → same outputs)
  • Cannot perform direct external calls
  • State automatically preserved across failures
  • Can run for years despite infrastructure failures

Example workflow tasks:

  • Decide which steps to execute
  • Handle compensation logic
  • Manage timeouts and retries
  • Coordinate child workflows

Activities (External Interactions)

Characteristics:

  • Handle all external system interactions
  • Can be non-deterministic (API calls, DB writes)
  • Include built-in timeouts and retry logic
  • Must be idempotent (calling N times = calling once)
  • Short-lived (seconds to minutes typically)

Example activity tasks:

  • Call payment gateway API
  • Write to database
  • Send emails or notifications
  • Query external services

Design Decision Framework

Does it touch external systems? → Activity
Is it orchestration/decision logic? → Workflow

Core Workflow Patterns

1. Saga Pattern with Compensation

Purpose: Implement distributed transactions with rollback capability

Pattern (Source: temporal.io/blog/compensating-actions-part-of-a-complete-breakfast-with-sagas):

For each step:
  1. Register compensation BEFORE executing
  2. Execute the step (via activity)
  3. On failure, run all compensations in reverse order (LIFO)

Example: Payment Workflow

  1. Reserve inventory (compensation: release inventory)
  2. Charge payment (compensation: refund payment)
  3. Fulfill order (compensation: cancel fulfillment)

Critical Requirements:

  • Compensations must be idempotent
  • Register compensation BEFORE executing step
  • Run compensations in reverse order
  • Handle partial failures gracefully

2. Entity Workflows (Actor Model)

Purpose: Long-lived workflow representing single entity instance

Pattern (Source: docs.temporal.io/evaluate/use-cases-design-patterns):

  • One workflow execution = one entity (cart, account, inventory item)
  • Workflow persists for entity lifetime
  • Receives signals for state changes
  • Supports queries for current state

Example Use Cases:

  • Shopping cart (add items, checkout, expiration)
  • Bank account (deposits, withdrawals, balance checks)
  • Product inventory (stock updates, reservations)

Benefits:

  • Encapsulates entity behavior
  • Guarantees consistency per entity
  • Natural event sourcing

3. Fan-Out/Fan-In (Parallel Execution)

Purpose: Execute multiple tasks in parallel, aggregate results

Pattern:

  • Spawn child workflows or parallel activities

…

よくある質問

ワークフローとアクティビティの違いは何ですか?

ワークフローは、何を、どの順番で行うかを決める司令塔の役割を担います。アクティビティは、外部サービスの呼び出しやデータベースへの保存など、具体的な作業そのものです。

Sagaパターンとは何ですか?

長時間にわたるトランザクションを管理する方法です。ある手順が失敗した場合、それまでの手順を取り消して、全体の整合性を保とうとします。

なぜワークフローは決定的(deterministic)である必要があるのですか?

障害が起きた後に、処理の状態を正確に再現できるようにするためです。これにより、エラーなしで止まった地点から再開できます。

詳細

作者による元の説明

Master workflow orchestration architecture with Temporal, covering fundamental design decisions, resilience patterns, and best practices for building reliable distributed systems.

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#6201
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル