Output Variables

A script step can record values that later steps read back by reference — no temp files, no database, no shared state.

Search guides... Ctrl K

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 injected into subsequent steps automatically — no temp files, no shared database, no environment-variable workarounds.

// Scope

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 via ThisMachine; steps on other targets can reference it by machine name.
  • Global — the value is shared across the whole deployment regardless of which machine produced it. Use this for values every subsequent step needs: a generated URL, a resource ID, a computed version number.

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.

// PowerShell 7+
# 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.

// PowerShell 5.1
# 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.

// Python
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.

// Reference patterns

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
// Reading output variables
# 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")
// Types

Supported types

Set Secret whenever the value is sensitive — it is redacted as **** in all deployment logs immediately after emission.

  • Text — plain string (default)
  • Number — numeric value, resolved as a number in step parameters
  • Secret — string value, redacted as **** in all deployment logs immediately
  • Booleantrue or false
  • Date — date/time value
  • Json — raw JSON string, passed as-is to later steps