Variable scope in Step Run Condion's Avatar

11 Oct, 2017 10:44 AM


I'm running Octopus 3.16.7

I've created a Step1 variable and made reference to it with Step2 "Step Run Condition".
In theory the Step1 Variable should be different for each Machine and Step2 should only run on some Machines.
What I'm seeing is Step1 Variable not being Scoped by Machine level and Step2 will always run because the last machine run in Step1 have set the variable to true.

Is this an issue or just the way Octopus work?


  1. 1 Posted by on 13 Oct, 2017 10:19 AM's Avatar

    Hello, anyone looking at this?

  2. Support Staff 2 Posted by Kenneth Bates on 13 Oct, 2017 08:55 PM

    Kenneth Bates's Avatar


    Thanks for getting in touch! I'm sorry you're hitting this behavior and for the delay in getting back to you. This should be theoretically possible, however I'm not positive I fully understand your scenario. If step 2 should only run on some machines, would it be a viable solution for you to scope this step to a role that's assigned only to the machines you want it to be run on?

    Could you provide screenshots of your steps (specifically where you're setting the variable, and step 2's run condition)? I'll be happy to re-assess with some more info. :)

    Best regards,


  3. 3 Posted by on 16 Oct, 2017 08:00 AM's Avatar


    Please find attached a test project that reconstruct the scenario.

    As you can See STEP01 set the local Variable "SchemeDeploy".
    STEP02 reference it in the "Run condition"
    STEP03 Output the STEP01 local Variable "SchemeDeploy"

    The result I have is that STEP02 will not run because the last server STEP01 ran set the local Variable "SchemeDeploy".to False.
    STEP03 shows that STEP01 local Variable "SchemeDeploy" is different on each server.

  4. 4 Posted by on 16 Oct, 2017 02:24 PM's Avatar

    btw, The machine deployment is dependent on validation rules (e.g. file that exist or don't exist on server). This is why Role scoping will not work. What I have done is have a step that check the server status and another step to take action based on previous check result.

    I really need an answer soon. I'm suppose to be at the end of project development and if the "Run Condition" in a step does not scope by machine then I will have to go about changing all my Script Templates to Script Modules and placing the validation into the script module.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac