# Add flows to resources

Copy as Markdown[View as Markdown](/docs/development/guides/resources/flows/add-flows-to-resources.md)

***

Adding [flows](/docs/development/guides/resources/flows/introduction.md) to resources helps people understand where a business process belongs and which parts of the architecture participate in it.

In EventCatalog, flows can be connected to:

* [Domains](/docs/development/guides/domains/introduction.md)
* [Systems](/docs/development/guides/systems/introduction.md)
* [Services](/docs/development/guides/resources/services/introduction.md)

## Add flows using frontmatter[​](#add-flows-using-frontmatter "Direct link to Add flows using frontmatter")

Add flows to a resource using the `flows` array in the resource frontmatter.

/services/Orders/index.mdx

```
---
id: OrdersService
name: Orders Service
version: 1.0.0
# define flows this service participates in
flows:
  - id: OrderProcessing
    version: 1.0.0
  - id: PaymentFlow
---
```

You can use the same pattern for domains:

/domains/Orders/index.mdx

```
---
id: OrdersDomain
name: Orders
version: 1.0.0
# define flows that belong to this domain
flows:
  - id: OrderProcessing
    version: 1.0.0
---
```

And systems:

/domains/Orders/systems/order-management/index.mdx

```
---
id: order-management
name: Order Management
version: 1.0.0
# define flows that are part of this system
flows:
  - id: OrderProcessing
    version: 1.0.0
---
```

The `version` is optional. If no version is given, EventCatalog uses the latest version of the referenced flow.

## Keep flows inside the resource folder[​](#keep-flows-inside-the-resource-folder "Direct link to Keep flows inside the resource folder")

You can also define flows inside a resource folder to keep related process documentation together.

* domains

  <!-- -->

  /

  * Orders

    <!-- -->

    /

    * index.mdx
    * flows
      <!-- -->
      /
      * OrderProcessing
        <!-- -->
        /
        * index.mdx

This structure makes the domain the entry point for the flows that belong to that business area.

Flows can also live inside services:

* services

  <!-- -->

  /

  * OrdersService

    <!-- -->

    /

    * index.mdx
    * flows
      <!-- -->
      /
      * OrderProcessing
        <!-- -->
        /
        * index.mdx

This structure is useful when the flow is specific to one service.

## Show flows on resource pages[​](#show-flows-on-resource-pages "Direct link to Show flows on resource pages")

When a domain, service, or system references a flow, EventCatalog shows that relationship on the resource page and in the visualizer.

Use frontmatter when the flow is shared across multiple resources. Keep the flow inside a resource folder when the flow is owned by that resource and should move with it.

For the complete list of supported fields, see the [flows reference](/docs/development/guides/resources/flows/reference.md).
