From b60f7e87b82fa46696f205c190366fb5ae15207f Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 6 Nov 2025 19:08:59 +0000 Subject: [PATCH] fix: improve priority for child jobs ran from api --- backend/windmill-api/src/jobs.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/windmill-api/src/jobs.rs b/backend/windmill-api/src/jobs.rs index 33beb32ec6..62cae0f352 100644 --- a/backend/windmill-api/src/jobs.rs +++ b/backend/windmill-api/src/jobs.rs @@ -4226,7 +4226,8 @@ pub async fn run_script_by_path_inner( tag, timeout, None, - None, + // If the job has a parent job, set priority to 2 as it may be ran synchronously and block a current worker until being executed. Flow steps have a priority of 1 so this is higher. + if run_query.parent_job.is_some() || run_query.root_job.is_some() { Some(2) } else { None }, push_authed.as_ref(), false, None,