---
schema_version: "1"
id: 0abea7ec4d0692a8f20a7f15400cebe8139fe66873440bac8fa358116c5cef8f
title: Predefined Variables
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.9/dataweave-variables-context.md
canonical_url: https://docs.mulesoft.com/dataweave/2.9/dataweave-variables-context
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 5c68f24c67a858d5efc0c771d88dc813d77a2264c9877baabfbe7f388446dfce
description: MuleSoft Documentation Site
release: "2.9"
latest: false
---
---
product: DataWeave
version: 2.9
---

# Predefined Variables

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

DataWeave expressions accept variables that can retrieve values from a variety of Mule Runtime
engine objects.

Commonly used variables include `attributes`, `payload`, and `vars`, the main parts of the Mule
event.

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Variables</th><th>Description</th><th>Fields and Examples</th></tr></thead><tbody><tr><td><p><strong><code>app</code></strong></p></td><td><p>The Mule artifact in context.</p></td><td><div><div><ul><li><p>Fields:</p><div><ul><li><p><code>encoding</code>: Encoding used by the Mule message processor.</p></li><li><p><code>name</code>: Name of your project and Mule app.</p></li><li><p><code>standalone</code>: Returns <code>true</code> or <code>false</code>.</p></li><li><p><code>workDir</code>: Working directory for the Mule app. For Studio, this is an Eclipse plugin directory.</p></li><li><p><code>registry</code>: Map of Mule registry entries.</p></li></ul></div></li><li><p>Example: <code>#[app.encoding]</code> might return <code>UTF-8</code>.</p></li></ul></div></div></td></tr><tr><td><p><strong><code>attributes</code></strong></p></td><td><p>Attributes (metadata) of a Mule Message object (<code>message</code>).</p></td><td><div><div><ul><li><p>Fields: Depends on the message type, such as HTTP request attributes.</p></li><li><p>Example: <code>#[attributes]</code> returns message attributes. For an HTTP request, <code>#[attributes.header]</code> returns HTTP header metadata, and <code>#[attributes.version]</code> might return <code>HTTP/1.1</code>.</p></li></ul></div></div></td></tr><tr><td><p><strong><code>authentication</code></strong></p></td><td><p>Provides access to the authentication information.</p></td><td><div><div><ul><li><p>Fields:</p><div><ul><li><p><code>principal</code>: The main part of the authentication, such as the user or subject.</p></li><li><p><code>credentials</code>: The credentials for the authentication.</p></li><li><p><code>properties</code>: A map of properties for the authentication.</p></li></ul></div></li><li><p>Example: <code>#[authentication.principal]</code></p></li></ul></div></div></td></tr><tr><td><p><strong><code>correlationId</code></strong></p></td><td><p>The <code>correlationId</code> of the message being processed.</p></td><td><div><div><ul><li><p>Fields: No fields.</p></li><li><p>Example: <code>#[correlationId]</code> might return <code>0-f77404d0-e699-11e7-a217-38c9864c2f8f</code>.</p></li></ul></div></div></td></tr><tr><td><p><strong><code>dataType</code></strong></p></td><td><p>Data type of the message payload.</p></td><td><div><div><ul><li><p>Fields: No fields.</p></li><li><p>Example: <code>#[dataType]</code> might return <code>SimpleDataType</code>.</p></li></ul></div></div></td></tr><tr><td><p><strong><code>error</code></strong></p></td><td><p>Error associated with a Mule message object.</p></td><td><div><div><ul><li><p>Fields:</p><div><ul><li><p><code>description</code>: Concise description of the error.</p></li><li><p><code>detailedDescription</code>: Can provide a more thorough description.</p></li><li><p><code>failingComponent</code>: The component where the error occurred.</p></li><li><p><code>errorType</code>: The type of error. The <code>errorType</code> is composed of <code>identifier</code> and <code>namespace</code>.</p></li><li><p><code>cause</code>: The internal Java <code>Throwable</code> that caused the error.</p></li><li><p><code>errorMessage</code>: An optional Mule Message provided by the failing component (used by components like HTTP when a response is invalid).</p></li><li><p><code>childErrors</code>: An optional list of internal errors (provided by components that aggregate errors, such as scatter-gather).</p></li></ul></div></li><li><p>Example: <code>#[error.description]</code></p></li></ul></div></div></td></tr><tr><td><p><strong><code>flow</code></strong></p></td><td><p>Deprecated: The name of the current flow. Because flow names are static, this field is deprecated and only available through the Logger component.</p></td><td><div><div><ul><li><p>Fields:</p><div><ul><li><p><code>name</code></p></li></ul></div></li><li><p>Example: <code>#[flow.name]</code> returns <code>testFlow</code> in the Studio console when executed within a Flow with the name <code>testFlow</code>.</p></li></ul></div></div></td></tr><tr><td><p><strong><code>message</code></strong></p></td><td><p>Package (<code>payload</code> and <code>attributes</code>) being processed.</p></td><td><div><div><ul><li><p>Fields:</p><div><ul><li><p><code>payload</code>: The message payload, or <code>null</code> if the payload is null.</p></li><li><p><code>dataType</code>: The message payload’s data type.</p></li><li><p><code>attributes</code>: The message attributes, or <code>null</code> if the attributes are null.</p></li></ul></div></li><li><p>Example: <code>#[message]</code></p></li></ul></div></div></td></tr><tr><td><p><strong><code>mule</code></strong></p></td><td><p>The Mule instance on which the application is currently running.</p></td><td><div><div><ul><li><p>Fields:</p><div><ul><li><p><code>clusterId</code>: The ID of the cluster when the Mule runtime is part of a High Availability cluster.</p></li><li><p><code>home</code>: Home directory.</p></li><li><p><code>nodeId</code>: Cluster Node ID.</p></li><li><p><code>version</code>: Mule version.</p></li></ul></div></li><li><p>Example: <code>#[mule.version]</code> might return <code>4.0.0</code>.</p></li></ul></div></div></td></tr><tr><td><p><strong><code>payload</code></strong></p></td><td><p>The body of the current Mule message object (<code>message</code>) being processed.</p></td><td><div><div><ul><li><p>Fields: Depends on the current payload.</p></li><li><p>Example: <code>#[payload]</code> returns the body of the message.</p></li></ul></div></div></td></tr><tr><td><p><strong><code>server</code></strong></p></td><td><div><div><p>The operating system on which the Mule instance is running. Exposes information about both the physical server and the JVM on which Mule runs.</p></div><div><ul><li><p>Note that the ability to select system properties, like <code>user.name</code>, depends on the behavior of the JVM on your operating system.</p></li></ul></div></div></td><td><div><div><ul><li><p>Fields:</p><div><ul><li><p><code>env</code>: Map of operating system environment variables.</p></li><li><p><code>fileSeparator</code>: Character that separates components of a file path, which is <code>/</code> on UNIX and <code>\</code> on Windows.</p></li><li><p><code>host</code>: Fully qualified domain name for the server.</p></li><li><p><code>ip</code>: IP address of the server.</p></li><li><p><code>locale</code>: Default locale (<code>java.util.Locale</code>) of the JRE. Can be used language (<code>locale.language</code>), country (<code>locale.country</code>).</p></li><li><p><code>javaVendor</code>: JRE vendor name</p></li><li><p><code>javaVersion</code>: JRE version</p></li><li><p><code>osArch</code>: Operating system architecture.</p></li><li><p><code>osName</code>: Operating system name.</p></li><li><p><code>osVersion</code>: Operating system version.</p></li><li><p><code>systemProperties</code>: Map of Java system properties.</p></li><li><p><code>timeZone</code>: Default time zone (<code>java.util.TimeZone</code>) of the JRE.</p></li><li><p><code>tmpDir</code>: Temporary directory for use by the JRE.</p></li><li><p><code>userDir</code>: User directory.</p></li><li><p><code>userHome</code>: User home directory.</p></li><li><p><code>userName</code>: User name.</p></li></ul></div></li><li><p>Example: <code>#[server.osName]</code> might return <code>Mac OS X</code>.</p></li></ul></div></div></td></tr><tr><td><p><strong><code>vars</code></strong></p></td><td><p>All variables currently set on the current Mule event being processed.</p></td><td><div><div><ul><li><p>Fields: No fields.</p></li><li><p>Example: <code>#[vars.myVar]</code> returns the value of <code>myVar</code>.</p></li></ul></div></div></td></tr></tbody></table>
