---
schema_version: "1"
id: a9756063295c2586bc797d75b1a463aa093f611da0430a8f0e954594ea06aacb
title: "Introduction to Mule 4: DataWeave Expression Language"
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mule-runtime/4.4/intro-expressions.md
canonical_url: https://docs.mulesoft.com/mule-runtime/4.4/intro-expressions
source_site: docs.mulesoft.com
content_type: documentation
content_hash: c1f401f27c0cd12b8d802d8ff7fb0db402878a2f51c0a10c4809965fa1be34cf
description: MuleSoft Documentation Site
release: "4.4"
latest: false
---
---
product: Mule Runtime
version: 4.4
---

# Introduction to Mule 4: DataWeave Expression Language

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

In Mule 3, you must learn both the Mule Expression Language (MEL) and DataWeave. MEL forces you to
convert your payloads from binary data (such as XML or JSON documents) into Java objects so that you
can write expressions that access that data, for example, when routing to a specific location.

In Mule 4, DataWeave is the default expression language. Combined with the built-in streaming
capabilities, this change simplifies many common tasks:

- Events can be routed based on payload data, without requiring conversion to Java objects.

- Binary data can easily be queried from an expression anywhere in your flow, for example, when
  logging.

- Streaming now happens transparently. You no longer need to worry about larger-than-memory data
  streams or about consuming a stream twice.

DataWeave 2.0 also features many improvements, which are covered in the
[DataWeave 2.0](https://docs.mulesoft.com/mule-runtime/4.4/intro-dataweave2) section.

At the core, expressions continue to work as before. You can use them to extract data, log data, or
make decisions about where to route data. And like MEL, the syntax to access properties in your data
is very simple.

```xml
<logger message="#[payload]"/>
<set-variable variableName="httpResponseStatus" value="#[attributes.statusCode]"/>
```

Unlike MEL, you can use DataWeave to easily access data anywhere in your flow without concern for
transforming it into intermediate objects. Consider this example in Mule 3:

```xml
<http:listener path="/hello"/> <!-- receives a JSON HTTP Body -->
<json:json-to-object/> <!-- convert to Java objects -->
<choice> <!-- route data based on the data -->
  <when expression="#[payload.customer == 'Acme, Inc']">
    <!-- do some logic -->
  </when>
</choice>
```

In Mule 4, you no longer need to convert JSON to an intermediate format. You can simply access the
data directly through expressions without losing the original underlying data, and Mule 4 handles
all data streaming and random access transparently for you.

```xml
<http:listener path="/hello"/> <!-- receives a JSON HTTP Body -->
<choice> <!-- route data based on the data -->
  <when expression="#[payload.customer == 'Acme, Inc']">
    <!-- do some logic -->
  </when>
</choice>
```

## See Also

[Transformations and Streaming](https://docs.mulesoft.com/mule-runtime/4.4/intro-transformations)

[Migrating from DataWeave 1.0 to 2.x](https://docs.mulesoft.com/mule-runtime/4.4/migration-dataweave)

[DataWeave Language](https://docs.mulesoft.com/mule-runtime/4.4/dataweave)
