ИИшка / Orchestration / 02 of 10

GITHUB
RESEARCH

Reuse-first исследование orchestration engines и patterns: durable execution, Python workflow orchestration, agent-state graphs, Kubernetes-native DAGs и lightweight task queues. Цель — не выбрать победителя по README, а сформировать проверяемый shortlist для практического spike.

01 — research frame

Что именно ищем

ИИшке нужен не «ещё один агентский фреймворк», а надёжный межмодульный control plane: ожидание внешних модулей и человека, retries, durable state, idempotency, stale-input detection, audit и ограничение полномочий.

Must-have

  • self-hosted;
  • durable workflow state;
  • retries/timeouts;
  • event/callback wait;
  • Python-friendly integration;
  • observability;
  • recoverability after restart.

Domain-policy boundary

Framework не получает ownership над canonical IDs, cross-module permissions, verdict gates, stale semantics, context minimization и human approval policy.

server2 constraint

Control plane должен быть CPU/RAM-light относительно Qwen 30B. Heavy workloads запускаются отдельными workers/resource classes и throttling.

Метод: GitHub/official docs → license/self-hosted check → feature-class mapping → shortlist → practical spike. Реальные performance-цифры server2 здесь не придумываются.
02 — candidate classes

Не сравнивать несопоставимое

КлассКандидатыЧто даётГлавный риск
Durable executionTemporalДолгоживущие workflows, retries, recovery, timers/signals, durable state.Инфраструктурная сложность и более тяжёлый adoption.
Python orchestrationPrefect, DagsterPython-native flows, scheduling, retries, observability.Data-pipeline assumptions могут не совпасть с inter-agent state machine.
Agent-state graphLangGraphStateful agent graphs, human-in-the-loop, durable execution abstractions.Слишком близко к LLM/agent layer; нельзя отдавать ему system policy.
Kubernetes DAGArgo WorkflowsContainer-native DAGs и parallel jobs.Kubernetes dependency; плохой fit, если server2 не K8s-first.
Declarative orchestratorKestraEvent-driven workflows, plugins, self-hosted control plane.Declarative/platform model может быть избыточен для внутреннего core.
Scheduler / task queueAirflow, Celery, DramatiqЗрелые tasks, queues, retries, scheduling.Не дают полного durable workflow semantics без нашей state machine.
03 — primary candidates

Кандидаты, которые стоит довести до spike

Temporal — strongest durable candidate

MIT-licensed open-source durable execution platform; official self-hosting guide есть. Сильная сторона — workflow state survives crashes/outages, retries и long-running execution являются базовой моделью, а не add-on.

REUSE candidatedurableMIT

Sources: github.com/temporalio/temporal · temporal.io/self-hosted-guide

Prefect — strongest lightweight Python finalist

Apache-2.0; Python workflow orchestration, self-hosted Prefect server, retries, dependencies, branching, event-based automations и work pools. Вероятно проще для быстрого spike и внутренней Python-команды.

ADAPT/REUSEPythonApache-2.0

Sources: github.com/PrefectHQ/prefect · prefect.io/prefect/open-source

LangGraph — agent-layer specialist

Low-level orchestration framework для long-running stateful agents с durable execution и human-in-the-loop. Очень релевантен там, где Qwen должен проходить управляемый graph, но не должен становиться каноническим workflow engine всей ИИшки.

SPECIALISTagent graph

Source: github.com/langchain-ai/langgraph

Kestra — declarative platform alternative

Open-source Apache-2.0 core, self-hosted Docker/Kubernetes, event-driven declarative orchestration. Полезен как comparator для approvals, audit trail, plugin model и cross-tool workflows.

COMPARATORdeclarativeApache-2.0

Sources: github.com/kestra-io/docs · kestra.io/orchestration

04 — secondary / reference

Сильные инструменты, но не первый выбор

Dagster

Apache-2.0, зрелая orchestration platform с lineage/observability. Сильна для data assets/pipelines; использовать как comparator, если Orchestration будет тесно связан с data/ML jobs.

Argo Workflows

Apache-2.0 CNCF project, Kubernetes CRD, DAG/container workflows. Отличен для heavy container jobs, но не как обязательный core на одиночном server2 без K8s-first архитектуры.

Airflow

Apache-2.0, зрелый scheduler/orchestrator. Полезен как reference для DAG/scheduling, но batch/data orientation и scheduler semantics хуже соответствуют интерактивным WAITING_HUMAN / callback workflows.

Celery

BSD-3-Clause task queue. Отличный worker primitive, retries и routing, но durable cross-step workflow semantics придётся строить самим.

Dramatiq

Надёжная Python task-processing library; LGPL family. Хорош как lightweight queue/worker primitive, но не заменяет orchestration state machine.

Build-only baseline

Postgres + outbox + queue + workers + explicit state machine. Нужен как контрольный baseline: чтобы понять, оправдывает ли framework собственную сложность.

05 — research matrix

Предварительная оценка до benchmark

CandidateLicenseSelf-hostDurable wait/recoveryPython fitHITL fitInitial role
TemporalMITYesVery strongSDKSignals/workflow patternsFinalist A
PrefectApache-2.0YesStrongExcellentNeeds pattern validationFinalist B
LangGraphCheck exact components in doc 3Library yes; deployment pieces verifyAgent-durableExcellentStrongSpecialist finalist
KestraApache-2.0 coreYesStrong platformAPI/plugin orientedApproval patternsComparator
DagsterApache-2.0YesData-orientedExcellentNot primary focusComparator
Argo WorkflowsApache-2.0Yes / K8sWorkflow DAGExternal controlNot primaryHeavy-job adapter
CeleryBSD-3-ClauseYesNot full workflow durabilityExcellentBuild ourselvesQueue primitive

Это research-stage matrix, не итоговый ADR. Все неоднозначные license/security/deployment детали должны быть перепроверены в документе №3 по конкретным версиям и компонентам.

06 — shortlist

Что идёт дальше

A — Temporal

Проверить как основной durable execution backend. Ключевые сценарии: crash recovery, signal/callback wait, idempotent side effects, retry classification, versioning workflows.

B — Prefect

Проверить как более лёгкий Python-first backend. Ключевые сценарии: dynamic branching, event wait, retries, pause/resume, self-host footprint, integration effort.

C — LangGraph

Проверить не как владельца global orchestration, а как optional inner-agent graph runtime для Qwen-driven steps с checkpoints/HITL.

Baseline — BUILD

Минимальный Postgres state machine + transactional outbox + queue. Без baseline нельзя понять, сколько сложности реально экономит внешний engine.

Не принимать ADR сейчас. README/research достаточно только для shortlist. До REUSE/ADAPT/BUILD нужен practical spike на golden scenarios и измерение server2 footprint.
07 — risks to verify

Вопросы для документа №3 и benchmark

08 — source snapshot

Проверенные публичные источники

ProjectSourceObserved
Temporalgithub.com/temporalio/temporal; temporal.ioMIT, open source, self-hosting, durable execution.
Prefectgithub.com/PrefectHQ/prefect; prefect.ioApache-2.0, self-hosted server, retries/events/work pools.
LangGraphgithub.com/langchain-ai/langgraphLong-running stateful agents, durable execution.
Dagstergithub.com/dagster-io/dagsterApache-2.0 data orchestration platform.
Argo Workflowsgithub.com/argoproj/argo-workflowsApache-2.0, Kubernetes-native workflow engine.
Celerygithub.com/celery/celeryBSD-3-Clause task queue.
Dramatiqgithub.com/Bogdanp/dramatiqPython task processing; LGPL/GPL license metadata requires careful legal review.
Kestragithub.com/kestra-io/docs; kestra.ioApache-2.0 core, self-hosted declarative orchestration.
09 — research verdict

Результат этапа

PRIMARY FINALISTS
  Temporal  -> durable execution backend candidate
  Prefect   -> Python-first orchestration backend candidate

SPECIALIST
  LangGraph -> inner agent/Qwen graph candidate

COMPARATORS / OPTIONAL ADAPTERS
  Kestra, Dagster, Argo Workflows

PRIMITIVES / BASELINE
  Celery or similar queue
  Postgres + outbox + explicit state machine
Следующий документ: AI_orchestration_3_детальное_исследование_финалистов.html