workflow-orchestration-patterns

Design durable Temporal workflows with saga patterns, determinism constraints, and activity separation.

Updated Apr 23, 2026
One-click install
npx skills add https://github.com/SanketAdlak/PDMProjectDesign --skill workflow-orchestration-patterns-sanketadlak
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: workflow-orchestration-patterns
Source: https://github.com/SanketAdlak/PDMProjectDesign/tree/main/.agents/skills/workflow-orchestration-patterns
Command: npx skills add https://github.com/SanketAdlak/PDMProjectDesign --skill workflow-orchestration-patterns-sanketadlak

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building long-running distributed processes that survive failures is hard: state gets lost, retries cause duplicate side effects, and distributed transactions lack rollback. This Skill provides architectural guidance for designing Temporal workflows that preserve state automatically, recover from crashes, and coordinate multi-step operations reliably. ## Core Features & Use Cases - Workflow vs Activity Separation: Clear decision framework for placing orchestration logic in deterministic workflows and external calls in idempotent activities. - Saga Pattern with Compensation: Implement distributed transactions with LIFO compensation rollback for payment, order, and fulfillment flows. - Entity and Fan-Out Patterns: Model long-lived entity workflows (carts, accounts) and scale parallel work via child workflows. - Determinism and Versioning Guidance: Avoid prohibited operations (system time, random, threading) and evolve workflow code safely with versioning APIs. - Use Case: You are building an order processing system spanning payment, inventory, and shipping services. Use this Skill to structure a saga workflow that reserves inventory, charges payment, and fulfills the order, with compensating refunds and releases on any failure. ## Quick Start Ask the AI to design a Temporal workflow for a multi-step order process with saga compensation and idempotent activities.

Frequently Asked Questions about workflow-orchestration-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement the saga pattern with Temporal workflows?

Register a compensation action before executing each step, execute steps via activities, and on failure run all compensations in reverse (LIFO) order. Compensations must be idempotent so retries are safe, and partial failures should be handled gracefully.

What is the difference between Temporal workflows and activities?

Workflows contain orchestration and decision logic and must be deterministic, while activities handle all external interactions like API calls and database writes. Activities can be non-deterministic, include built-in retries and timeouts, and must be idempotent.

When should I not use Temporal workflow orchestration?

Avoid Temporal for simple CRUD operations, pure data processing pipelines, stateless request-response APIs, and real-time streaming. Use direct API calls, Airflow, standard APIs, or Kafka for those cases respectively.

Why does my Temporal workflow fail with a nondeterminism error?

Workflows replay as state machines, so using datetime.now(), random(), threading, global state, or direct network calls breaks determinism. Use workflow.now() and workflow.random() instead, and move all external calls into activities.

How do I update workflow code while old executions are still running?

Use the workflow.get_version() API to branch safely between old and new logic during replay. Alternatively, create a new workflow type and route new executions to it while old executions finish on the original code.

How do I make Temporal activities idempotent?

Use idempotency keys for deduplication, check-then-act with unique constraints, upsert operations instead of inserts, or track processed request IDs. This ensures duplicate executions from retries produce the same result as a single call.