Output variables let a deployment step record a value that later steps in the same deployment read back by name. The value is stored in the step's execution context and passed to later steps automatically, with no temp files, shared database or environment-variable workarounds.
Two scopes control visibility
- Machine (default): the value is tied to the target machine that ran the step. Later steps on the same target read it through
ThisMachine, and steps on other targets can reference it by machine name. - Global: the value is shared across the whole deployment, whichever machine produced it. Use it for values every later step needs, such as a generated URL, a resource ID or a computed version number.
Output values don't carry over between deployments. They are available to every step that runs after the step that set them, and discarded when the deployment ends.
Emit from PowerShell (PS7+)
Use Set-JawsOutputValue in any PowerShell (PS7+) script step. -Scope defaults to Machine. Pass Global to share the value across the whole deployment. Set-JawsOutputValueGlobalScope is a shorthand for the global case.
# Machine scope (default): visible to later steps running on the same target
Set-JawsOutputValue -Name "ServicePort" -Value $port
# Global scope: visible to all later steps in the deployment
Set-JawsOutputValue -Name "DeployedUrl" -Value $url -Scope Global
# Shorthand for Global scope
Set-JawsOutputValueGlobalScope -Name "BuildVersion" -Value $version
# Emit a number or a secret (secrets are redacted in logs immediately)
Set-JawsOutputValue -Name "InstanceCount" -Value 3 -Type Number -Scope Global
Set-JawsOutputValue -Name "ApiToken" -Value $token -Type Secret -Scope Global
Emit from PowerShell 5.1
PS5 steps use the same Set-JawsOutputValue and Set-JawsOutputValueGlobalScope functions. The difference from PS7+: -Type and -Scope are plain strings rather than typed enum values.
# Machine scope (default)
Set-JawsOutputValue -Name "ServicePort" -Value $port
# Global scope: pass scope as a string
Set-JawsOutputValue -Name "DeployedUrl" -Value $url -Scope "Global"
# Shorthand
Set-JawsOutputValueGlobalScope -Name "BuildVersion" -Value $version
# Typed values: type is also a string in PS5
Set-JawsOutputValue -Name "InstanceCount" -Value 3 -Type "Number" -Scope "Global"
Set-JawsOutputValue -Name "ApiToken" -Value $token -Type "Secret" -Scope "Global"
Emit from Python
Python steps use jaws.set_output_value() from the built-in jaws module. The scope and type parameters are strings and default to "Machine" and "Text" respectively.
import jaws
# Machine scope (default)
jaws.set_output_value("ServicePort", port)
# Global scope
jaws.set_output_value("DeployedUrl", url, scope="Global")
# Shorthand for Global scope
jaws.set_output_value_global_scope("BuildVersion", version)
# Typed values
jaws.set_output_value("InstanceCount", 3, type="Number", scope="Global")
jaws.set_output_value("ApiToken", token, type="Secret", scope="Global")
Consume in a later step
Output variables from earlier steps are injected into each subsequent step's parameter context automatically. Reference them with #{...} syntax in script code, step property fields, or variable values.
Choose the pattern for your scope
#{OUTPUT.Step.<StepName>.Global.<Name>}: value emitted with Global scope#{OUTPUT.Step.<StepName>.ThisMachine.<Name>}: Machine scope, step runs on the same target#{OUTPUT.Step.<StepName>.MachineOutput.<MachineName>.<Name>}: Machine scope, referencing output from a specific named target
Use the step's display name as it appears in the deployment process, spaces included. For a step named Deploy Web App, the reference is #{OUTPUT.Step.Deploy Web App.Global.DeployedUrl}.
# PowerShell: read directly from the parameters dictionary
$url = $Jaws.Parameters["OUTPUT.Step.Deploy Web App.Global.DeployedUrl"].Value
# In a step property field or variable value, use #{...} substitution:
# #{OUTPUT.Step.Get Config.Global.ConnectionString}
# Python: read from jaws.parameters
url = jaws.parameters.get("OUTPUT.Step.Deploy Web App.Global.DeployedUrl")
# Machine-scoped value from the same target
port = jaws.parameters.get("OUTPUT.Step.Configure Service.ThisMachine.ServicePort")
# Machine-scoped value from a specific named target
port = jaws.parameters.get("OUTPUT.Step.Configure Service.MachineOutput.web-01.ServicePort")
Supported types
Use Secret whenever the value is sensitive. It is shown as **** in all deployment logs as soon as it is set.
- Text: plain string (default)
- Number: numeric value, resolved as a number in step parameters
- Secret: string value, shown as
****in all deployment logs as soon as it is set - Boolean:
trueorfalse - Date: date/time value
- Json: raw JSON string, passed as-is to later steps