---
schema_version: "1"
id: 128d056144b752897b86fee02a1ba917db7f3482485c58cf2aba89af6b7db948
title: Using the Execution Mode
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/scripting-module/latest/scripting-execution-mode.md
canonical_url: https://docs.mulesoft.com/scripting-module/latest/scripting-execution-mode
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 893ae147663a0743870e070b02fd967740865404c68791ab55663d0d17e7108c
description: MuleSoft Documentation Site
release: "2.1"
latest: true
---
---
product: Scripting Module
version: 2.1
is-latest-version: true
---

# Using the Execution Mode

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Determine whether a script is automatically compiled or forced to be interpreted using the Scripting
Module **Execution Mode** field.

Configure the field in these modes:

- **AUTO**  
  Uses the compiled version of the script if the compilation is possible and successful during the
  initialization. This mode doesn’t perform a dynamic analysis of the script’s content to determine
  whether it should switch to interpreted execution. For example, if the script contains hardcoded
  parameters or local values that need to be dynamic, the `AUTO` mode doesn’t detect this situation
  and can opt for compilation, resulting in the loss of these values.

  Therefore, `AUTO` mode applies only if there are no critical dependencies on local variables that
  could be lost during compilation.

- **INTERPRETED**  
  Avoids issues related to variable retention.

  Using `INTERPRETED` mode can lead to performance degradation because the script is interpreted
  with each execution instead of being compiled once. This mode only applies to scenarios where
  modifying the script to receive parameters explicitly is not feasible, as it is inherently less
  efficient.

This XML example shows the **Execution Mode** field (`executionMode`) configuration:

```xml
<mule ...>
	<flow name="conn-flow" >
		<scripting:execute
engine="jruby" executionMode="INTERPRETED">
               <scripting:code>
				...
</scripting:code>
                ...
            </scripting:execute>

	</flow>
</mule>
```

## See Also

- [Scripting Module - Examples](https://docs.mulesoft.com/scripting-module/latest/scripting-module-examples)
