All skills
wshobson avatar

/workflow-orchestration-patterns

@be57c0b
by Seth Hobsonwshobson/agents40k stars
4,281

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.

Use this Skill: https://skilld.dev/gh/wshobson/agents/workflow-orchestration-patterns

This session only. Nothing lands on disk.

SKILL.md

≈74 tokens always: the name and description. ≈788 when used: this file. ≈1.5k more on demand in 1 file.

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

Source: SKILL.md on GitHub

No alerts16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    No security issues detected. The skill provides architectural guidance and best practices for building durable workflows with Temporal.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    1 file scanned · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at be57c0b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 4 months ago
  • temporal
  • workflow-orchestration
  • distributed-systems
  • saga-pattern
  • microservices
  • state-management
  • long-running-processes
  • resilience

README badge

README badge for wshobson/agents/workflow-orchestration-patterns

Teaches workflow orchestration architecture with Temporal, covering the separation of workflow orchestration from activity execution, saga patterns, state management, and determinism constraints. Use this skill when designing long-running distributed processes, implementing all-or-nothing transactions across services, or building microservice choreography that must survive failures and resume from the last successful step.

Generated from the current SKILL.md.

Does this skill cover Temporal-specific implementation, or is it framework-agnostic?
This skill is Temporal-specific. It teaches workflow orchestration patterns using Temporal's architecture, including workflow vs activity separation, determinism constraints, and Temporal's state persistence model.
What programming languages does this skill support?
The SKILL.md references Python examples (datetime.now() vs workflow.now()) but does not explicitly list all supported languages. Temporal supports TypeScript/JavaScript, Python, Go, and Java.
Does this cover the saga pattern?
Yes. The skill includes saga pattern guidance for distributed transactions and references Temporal's saga pattern documentation.
What should I use this skill for instead of tools like Airflow or Kafka?
Use this skill for long-running workflows with automatic state persistence and failure recovery (hours to years), distributed transactions requiring all-or-nothing semantics, and human-in-the-loop systems. Airflow is better for pure data pipelines; Kafka is better for real-time streaming.
Does this skill include code examples or just theory?
The skill includes worked examples and references a separate `references/details.md` file with detailed pattern documentation, though full code samples are not in the main content.

Generated from the current SKILL.md. These answers refresh after source changes.