mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 02:51:14 +00:00
feat(core): Add execution flow to native Python runner (no-changelog) (#18485)
This commit is contained in:
22
packages/@n8n/task-runner-python/src/task_state.py
Normal file
22
packages/@n8n/task-runner-python/src/task_state.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from enum import Enum
|
||||
from dataclasses import dataclass
|
||||
from multiprocessing.context import SpawnProcess
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class TaskStatus(Enum):
|
||||
WAITING_FOR_SETTINGS = "waiting_for_settings"
|
||||
RUNNING = "running"
|
||||
ABORTING = "aborting"
|
||||
|
||||
|
||||
@dataclass
|
||||
class TaskState:
|
||||
task_id: str
|
||||
status: TaskStatus
|
||||
process: Optional[SpawnProcess] = None
|
||||
|
||||
def __init__(self, task_id: str):
|
||||
self.task_id = task_id
|
||||
self.status = TaskStatus.WAITING_FOR_SETTINGS
|
||||
self.process = None
|
||||
Reference in New Issue
Block a user