Skillpedia
واجهات API والخوادم (backend)41k · #6643

workflow-orchestration-patterns

ما الذي تفعله

تساعد هذه المهارة على تنظيم العمليات المعقدة التي تحتاج إلى التنفيذ على مراحل، حتى لو استغرقت وقتًا طويلًا أو شملت عدة أنظمة. وتضمن أن كل شيء يعمل بشكل صحيح، حتى لو حدث خطأ ما.

متى تستخدمها

  • ✓عندما تنظم عملية طلب من العملاء تشمل المخزون والدفع والشحن.
  • ✓عندما تدير عملية اعتماد مستند طويلة قد تستغرق أيامًا.
  • ✓عندما تنسق أجزاء النظام المختلفة لضمان اكتمال المعاملة أو فشلها بالكامل.

رابط المهارة

https://github.com/wshobson/agents/blob/main/plugins/backend-development/skills/workflow-orchestration-patterns/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/wshobson/agents/blob/main/plugins/backend-development/skills/workflow-orchestration-patterns/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“كيف أنظم عملية حجز فندق تتضمن التحقق من التوفر وتأكيد الغرفة ومعالجة الدفع؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تعمل هذه المهارة بتحديد «سير عمل» رئيسي ينسّق استدعاء «أنشطة» أصغر. وإذا فشل نشاط ما، يمكن لسير العمل إعادة المحاولة أو اتباع خطة استعادة، مع حفظ تقدمه تلقائيًا.

المحتوى التقني (ملف 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.

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
الأسئلة الشائعة

ما الفرق بين «سير العمل» و«النشاط»؟

«سير العمل» هو الوصفة الرئيسية التي تحدد ما يجب فعله وبأي ترتيب. أما «النشاط» فهو مهمة محددة يطلب سير العمل تنفيذها، مثل «التحقق من المخزون» أو «معالجة الدفع».

لماذا يجب أن تكون شيفرة سير العمل «حتمية» (deterministic)؟

تعني «الحتمية» أن سير العمل سيقوم دائمًا بالأشياء نفسها بالترتيب نفسه، مهما تكرر تشغيله. وهذا ضروري حتى يتمكن من التعافي من الأعطال ومتابعة عمله من حيث توقف دون أخطاء.

متى لا يجب استخدام هذه المهارة؟

لا تستخدمها للمهام البسيطة مثل حفظ البيانات (CRUD) أو معالجة البيانات السريعة. وهي الأنسب للعمليات الطويلة التي تحتاج إلى التعافي من الأعطال، أو التي تشمل عدة خطوات وأنظمة.

التفاصيل

الوصف الأصلي من المؤلف

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.

repo: wshobson/agents

الشعبية

نجوم GitHub
41k
الترتيب
#6643
الترخيص
MIT
آخر تحديث
15‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة