feat(trigger): add suspend/timeslice layers and workflow CFS scheduler

- add suspend, timeslice, and trigger post engine layers
- introduce CFS workflow scheduler tasks and supporting entities
- update async workflow, trigger, and webhook services to wire in the new scheduling flow
This commit is contained in:
Yeuoly
2025-10-21 19:20:54 +08:00
parent 55bf9196dc
commit 3d5e2c5ca1
17 changed files with 2698 additions and 2407 deletions

View File

@ -185,6 +185,22 @@ class TriggerConfig(BaseSettings):
)
class AsyncWorkflowConfig(BaseSettings):
"""
Configuration for async workflow
"""
ASYNC_WORKFLOW_SCHEDULER_GRANULARITY: int = Field(
description="Granularity for async workflow scheduler, "
"sometime, few users could block the queue due to some time-consuming tasks, "
"to avoid this, workflow can be suspended if needed, to achieve"
"this, a time-based checker is required, every granularity seconds, "
"the checker will check the workflow queue and suspend the workflow",
default=1,
ge=1,
)
class PluginConfig(BaseSettings):
"""
Plugin configs
@ -1165,6 +1181,7 @@ class FeatureConfig(
BillingConfig,
CodeExecutionSandboxConfig,
TriggerConfig,
AsyncWorkflowConfig,
PluginConfig,
MarketplaceConfig,
DataSetConfig,