workflow-orchestration-patterns

sickn33/antigravity-awesome-skills · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill workflow-orchestration-patterns
0 commentsdiscussion
summary

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

skill.md

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.
  • If detailed examples are required, open resources/implementation-playbook.md.

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
  • Wait for all to complete
  • Aggregate results
  • Handle partial failures

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

  • Don't scale individual workflows
  • For 1M tasks: spawn 1K child workflows × 1K tasks each
  • Keep each workflow bounded

4. Async Callback Pattern

Purpose: Wait for external event or human approval

Pattern:

  • Workflow sends request and waits for signal
  • External system processes asynchronously
  • Sends signal to resume workflow
  • Workflow continues with response

Use Cases:

  • Human approval workflows
  • Webhook callbacks
  • Long-running external processes

State Management and Determinism

Automatic State Preservation

How Temporal Works (Source: docs.temporal.io/workflows):

  • Complete program state preserved automatically
  • Event History records every command and event
  • Seamless recovery from crashes
  • Applications restore pre-failure state

Determinism Constraints

Workflows Execute as State Machines:

  • Replay behavior must be consistent
  • Same inputs → identical outputs every time

Prohibited in Workflows (Source: docs.temporal.io/workflows):

  • ❌ Threading, locks, synchronization primitives
  • ❌ Random number generation (random())
  • ❌ Global state or static variables
  • ❌ System time (datetime.now())
  • ❌ Direct file I/O or network calls
  • ❌ Non-deterministic libraries

Allowed in Workflows:

  • workflow.now() (deterministic time)
  • workflow.random() (deterministic random)
  • ✅ Pure functions and calculations
  • ✅ Calling activities (non-deterministic operations)

Versioning Strategies

Challenge: Changing workflow code while old executions still running

Solutions:

  1. Versioning API: Use workflow.get_version() for safe changes
  2. New Workflow Type: Create new workflow, route new executions to it
  3. Backward Compatibility: Ensure old events replay correctly

Resilience and Error Handling

Retry Policies

Default Behavior: Temporal retries activities forever

Configure Retry:

  • Initial retry interval
  • Backoff coefficient (exponential backoff)
  • Maximum interval (cap retry delay)
  • Maximum attempts (eventually fail)

Non-Retryable Errors:

  • Invalid input (validation failures)
  • Business rule violations
  • Permanent failures (resource not found)

Idempotency Requirements

Why Critical (Source: docs.temporal.io/activities):

  • Activities may execute multiple times
  • Network failures trigger retries
  • Duplicate execution must be safe

Implementation Strategies:

  • Idempotency keys (deduplication)
  • Check-then-act with unique constraints
  • Upsert operations instead of insert
  • Track processed request IDs

Activity Heartbeats

Purpose: Detect stalled long-running activities

Pattern:

  • Activity sends periodic heartbeat
  • Includes progress information
  • Timeout if no heartbeat received
  • Enables progress-based retry

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
how to use workflow-orchestration-patterns

How to use workflow-orchestration-patterns on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add workflow-orchestration-patterns
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill workflow-orchestration-patterns

The skills CLI fetches workflow-orchestration-patterns from GitHub repository sickn33/antigravity-awesome-skills and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/workflow-orchestration-patterns

Reload or restart Cursor to activate workflow-orchestration-patterns. Access the skill through slash commands (e.g., /workflow-orchestration-patterns) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

User Story & Requirements Generation

Create detailed user stories, acceptance criteria, and feature specs

Example

Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios

Reduce spec writing time by 50%, ensure comprehensive coverage

Competitive Analysis

Research competitors, compare features, identify gaps

Example

Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities

Complete competitive research in 2 hours instead of 2 days

Roadmap Prioritization

Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs

Example

Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale

Make data-driven prioritization decisions faster

Stakeholder Communication

Draft PRDs, status updates, and stakeholder presentations

Example

Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement

Save 3-5 hours/week on communication overhead

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client
  • Access to product documentation and roadmap tools (Jira, Notion, etc.)
  • Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
  • Stakeholder contact information and communication channels

Time Estimate

30-60 minutes to see productivity improvements

Installation Steps

  1. 1.Install product management skill
  2. 2.Start with user story generation for known feature
  3. 3.Progress to competitive analysis: research 2-3 competitors
  4. 4.Use for roadmap prioritization: apply RICE/ICE scoring
  5. 5.Draft stakeholder communications and refine based on feedback
  6. 6.Build template library for recurring PM tasks
  7. 7.Share effective prompts with product team

Common Pitfalls

  • Not validating competitive research—verify facts before sharing
  • Accepting user stories without involving engineering team
  • Over-relying on frameworks without qualitative judgment
  • Not customizing outputs to company culture and communication style
  • Skipping stakeholder validation of generated requirements

Best Practices

✓ Do

  • +Validate research and competitive analysis with real data
  • +Collaborate with engineering when generating technical requirements
  • +Customize frameworks and templates to your company context
  • +Use skill for first drafts, refine with stakeholder input
  • +Document successful prompt patterns for PM tasks
  • +Combine AI efficiency with human judgment and intuition

✗ Don't

  • Don't publish competitive analysis without fact-checking
  • Don't finalize user stories without engineering review
  • Don't make prioritization decisions solely on AI scoring
  • Don't skip customer validation of generated requirements
  • Don't ignore company-specific context and culture

💡 Pro Tips

  • Provide context: company goals, constraints, customer feedback
  • Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
  • Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
  • Use skill for 70% generation + 30% customization to company needs

When to Use This

✓ Use When

Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.

✗ Avoid When

Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.

Learning Path

  1. 1Basic: user stories, feature specs, status updates
  2. 2Intermediate: competitive analysis, prioritization frameworks, PRDs
  3. 3Advanced: product strategy, go-to-market planning, OKR setting
  4. 4Expert: product vision, market positioning, business model innovation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.634 reviews
  • Isabella Johnson· Dec 24, 2024

    workflow-orchestration-patterns fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Olivia Rahman· Dec 20, 2024

    Keeps context tight: workflow-orchestration-patterns is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Isabella Thompson· Dec 4, 2024

    I recommend workflow-orchestration-patterns for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Olivia Abbas· Dec 4, 2024

    workflow-orchestration-patterns reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Isabella Okafor· Nov 23, 2024

    Registry listing for workflow-orchestration-patterns matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Isabella Mensah· Nov 15, 2024

    workflow-orchestration-patterns is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Isabella Desai· Oct 14, 2024

    Useful defaults in workflow-orchestration-patterns — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Isabella Gill· Oct 6, 2024

    Solid pick for teams standardizing on skills: workflow-orchestration-patterns is focused, and the summary matches what you get after install.

  • Aarav Dixit· Sep 21, 2024

    workflow-orchestration-patterns fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Oshnikdeep· Sep 13, 2024

    Solid pick for teams standardizing on skills: workflow-orchestration-patterns is focused, and the summary matches what you get after install.

showing 1-10 of 34

1 / 4