gives a string indicating the type of local or cloud environment in which the current Wolfram Language evaluation is being performed.


  • Typical values for $EvaluationEnvironment include:
  • "Session"local or cloud interactive session
    "Script"script run in batch mode
    "Subkernel"parallel or grid subkernel
    "WebEvaluation"cloud evaluation initiated by an HTTP request
    "WebAPI"API called through an HTTP request
    "Scheduled"scheduled task
  • The "Script" environment is used by wolframscript for local script execution.
  • The "WebEvaluation" environment is used by CloudEvaluate and by wolframscript -cloud.
  • The "WebAPI" environment is used when code in Delayed, APIFunction, FormFunction, etc. is executed as a result of a web request.


open allclose all

Basic Examples  (2)

In an interactive session, the evaluation environment is "Session":

Remote evaluation in the cloud gives a different result:

Scope  (5)

Interactive session:

A remote evaluation inside CloudEvaluate:

An evaluation in an API call:

An evaluation in a cloud task:

Once the task is finished, the saved environment can be retrieved:

Parallel subkernels are identified as "Subkernel":

Introduced in 2014
Updated in 2019