From 810347b061488e801a35fc39f1fdcf709a3ce256 Mon Sep 17 00:00:00 2001 From: Pyra <92104930+pyranota@users.noreply.github.com> Date: Tue, 6 Jan 2026 19:03:07 +0100 Subject: [PATCH] fix: properly construct concurrency key (#7504) Signed-off-by: pyranota --- backend/windmill-queue/src/jobs.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/backend/windmill-queue/src/jobs.rs b/backend/windmill-queue/src/jobs.rs index c9deff6fed..c371d48fa2 100644 --- a/backend/windmill-queue/src/jobs.rs +++ b/backend/windmill-queue/src/jobs.rs @@ -5357,7 +5357,23 @@ pub async fn insert_concurrency_key<'d, 'c>( job_id: Uuid, ) -> Result<(), Error> { let concurrency_key = custom_concurrency_key - .map(|x| interpolate_args(x, args, workspace_id)) + .map(|x| { + let interpolated = interpolate_args(x.clone(), args, workspace_id); + // In cloud mode, enforce workspace isolation by prefixing with workspace + // if the custom key doesn't already specify $workspace + #[cfg(feature = "cloud")] + { + if !x.contains("$workspace") { + format!("{}/{}", workspace_id, interpolated) + } else { + interpolated + } + } + #[cfg(not(feature = "cloud"))] + { + interpolated + } + }) .unwrap_or(fullpath_with_workspace( workspace_id, script_path.as_ref(),