# MassTransit

MassTransit is an open-source distributed application framework for .NET that provides a consistent abstraction on top of the supported message transports.

It enables .NET developers to model messages as C# types, which can then be sent & received. To receive messages, one would typically write a Consumer.

When using the MassTransit module with Elsa, there is an additional method of sending & handling messages; through workflow activities.

## Messages as Activities﻿

Elsa makes it easy to send and receive messages that are modeled as .NET type. All you need to do is define your type and then register it with the MassTransit feature.

When a message type is registered, two new activities will be automatically available for use:

* Publish {activity type}
* {activity type}

The first activity will *publish* your message. The second activity acts as a trigger and will start or resume your workflow when a message of this type is received.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.elsaworkflows.io/activities/masstransit.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
