# Tutorial

The following example highlights creating and registering a fictive message type called `OrderCreated`.

{% code title="OrderCreated.cs" %}

```csharp
public record OrderCreated(string Id, string ProductId, int Quantity);
```

{% endcode %}

{% code title="Program.cs" %}

```csharp
services.AddElsa(elsa =>
{
    // Enable and configure MassTransit
    elsa.AddMassTransit(massTransit =>
    {
        // Register our message type.
        massTransit.AddMessageType<OrderCreated>();
    };
});
```

{% endcode %}

With the above setup, your workflow server will now add two activities that allow you to send and receive messages of type \`OrderCreated\`:

* Order Created
* Publish Order Created

The **Order Created** activity acts as a trigger, which means that it will automatically start the workflow it is a part of when a message is received of this type. The **Publish Order Created** activity will publish a message of this type.


---

# 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/tutorial.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.
