diff --git a/templates/full-pipeline.yml b/templates/full-pipeline.yml
index 708f6dd5271cdb6bfdf2d82ee869c8229c338c85..12e01c46890460f9cea6de56f9641f33372e17ec 100644
--- a/templates/full-pipeline.yml
+++ b/templates/full-pipeline.yml
@@ -185,4 +185,4 @@ include:
 
 # NOTE: we have to define this `needs` here, because inputs don't support arrays, yet.
 delete-state:
-  needs: [destroy]
+  needs: ['$[[ inputs.job_name_prefix ]]destroy']