This commit is contained in:
@@ -4,7 +4,6 @@ import hashlib
|
||||
import importlib.util
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import uuid
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
@@ -2027,17 +2026,7 @@ async def run_script(
|
||||
context.workflow_run_id = workflow_run_id
|
||||
context.organization_id = organization_id
|
||||
|
||||
# Check if script contains conditional blocks (not supported in CLI execution)
|
||||
# The marker "# === CONDITIONAL:" is generated by _build_block_statement() for conditional blocks.
|
||||
with open(path, encoding="utf-8") as f:
|
||||
script_content = f.read()
|
||||
if re.search(r"# === CONDITIONAL:", script_content):
|
||||
raise Exception(
|
||||
"This script contains conditional blocks which are not supported in CLI execution. "
|
||||
"Conditional blocks require the workflow engine's DAG traversal to properly evaluate "
|
||||
"branch conditions at runtime. Please run this workflow through the API instead."
|
||||
)
|
||||
|
||||
# run the script as subprocess; pass the parameters and run_id to the script
|
||||
# Dynamically import the script at the given path
|
||||
spec = importlib.util.spec_from_file_location("user_script", path)
|
||||
if not spec or not spec.loader:
|
||||
|
||||
Reference in New Issue
Block a user