diff --git a/backend/windmill-worker/src/bun_executor.rs b/backend/windmill-worker/src/bun_executor.rs index a1bc2ed299..c7ff297ff1 100644 --- a/backend/windmill-worker/src/bun_executor.rs +++ b/backend/windmill-worker/src/bun_executor.rs @@ -571,6 +571,7 @@ pub fn copy_recursively( } } } + let original = entry.path(); if filetype.is_dir() { @@ -1290,6 +1291,10 @@ pub async fn get_common_bun_proc_envs(base_internal_url: &str) -> HashMap | null, - scheduledInSeconds: number | null = null + scheduledInSeconds: number | null = null, + flowOutlivesParent: boolean = true ): Promise { // Create a script job and return its job id. @@ -283,9 +284,11 @@ export async function runFlowAsync( params["scheduled_in_secs"] = scheduledInSeconds; } - let parentJobId = getEnv("WM_JOB_ID"); - if (parentJobId !== undefined) { - params["parent_job"] = parentJobId; + if (!flowOutlivesParent) { + let parentJobId = getEnv("WM_JOB_ID"); + if (parentJobId !== undefined) { + params["parent_job"] = parentJobId; + } } let rootJobId = getEnv("WM_ROOT_FLOW_JOB_ID");