Files
n8n/packages/@n8n/task-runner-python/src/task_state.py
T
alighasami 3d5eaf9445
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
first commit
2026-03-17 16:22:57 +03:30

38 lines
986 B
Python

from enum import Enum
from dataclasses import dataclass
from multiprocessing.context import ForkServerProcess
class TaskStatus(Enum):
WAITING_FOR_SETTINGS = "waiting_for_settings"
RUNNING = "running"
ABORTING = "aborting"
@dataclass
class TaskState:
task_id: str
status: TaskStatus
process: ForkServerProcess | None = None
workflow_name: str | None = None
workflow_id: str | None = None
node_name: str | None = None
node_id: str | None = None
def __init__(self, task_id: str):
self.task_id = task_id
self.status = TaskStatus.WAITING_FOR_SETTINGS
self.process = None
self.workflow_name = None
self.workflow_id = None
self.node_name = None
self.node_id = None
def context(self):
return {
"node_name": self.node_name,
"node_id": self.node_id,
"workflow_name": self.workflow_name,
"workflow_id": self.workflow_id,
}