> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aseeflow.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Model a BPMN 2.0 Process

## Deploy and invoke a BPMN process

This guide demonstrates how to deploy a BPMN 2.0 process model and interact with it from Spring beans. The tutorial covers:

1. Modeling an executable BPMN 2.0 process
2. Using the Spring Boot Starter auto-deployment
3. Creating a process application
4. Starting a process instance

## Model an executable BPMN 2.0 process and deploy it

Begin by modeling an executable process using the Camunda Modeler. The process should resemble the loan approval diagram shown below.

![The loan approval process](https://mintcdn.com/aseeflow/nrz9o5m15i2WLCpp/get-started/spring-boot/img/loanApproval.png?fit=max\&auto=format\&n=nrz9o5m15i2WLCpp\&q=85\&s=1b0c585f3b26a0b6feb4fce8bfca8d96)

> [!TIP]
>
> If you are unfamiliar with modeling an executable process, read the [Model a Process](https://docs.aseeflow.org/1.x/get-started/quick-start/service-task.md) section of the Quick Start tutorial.

After modeling, save the process file in `src/main/resources` and refresh your project in your IDE.
The process automatically deploys on engine startup when saved to the application classpath.

## Create a process application

To declare the process application, add the `@EnableProcessApplication` annotation to your application class and place an empty `processes.xml` file in `src/main/resources/META-INF`.

## Start a process instance after the process application has been deployed

Listen for the `PostDeployEvent` to start the process instance automatically:

```java theme={null}
@Autowired
private RuntimeService runtimeService;

@EventListener
private void processPostDeploy(PostDeployEvent event) {
  runtimeService.startProcessInstanceByKey("loanApproval");
}
```

The `@Autowired` annotation enables dependency injection of ASEE Flow engine services.

## Rebuild and test

![The task in Tasklist](https://mintcdn.com/aseeflow/admrYUEqirEcFYUc/get-started/spring-boot/img/tasklist.png?fit=max\&auto=format\&n=admrYUEqirEcFYUc\&q=85\&s=3c18f4ebcc05d4a93bb2616a5d5c5406)

After rebuilding and restarting, you should see *Check the request* in Tasklist under *All tasks*.

> [!NOTE]
>
> **Catch up: get the sources of Step-3**
>
> ```bash theme={null}
> git clone https://github.com/aseeflow/aseeflow-get-started-spring-boot.git
> git checkout -f Step-3
> ```
>
> Or [download as a `.zip`](https://github.com/aseeflow/aseeflow-get-started-spring-boot/archive/Step-3.zip).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.