# Embedded Microflow

**Embedded Microflow** allows you to export a Microflow as a **JAR file** and embed it directly into an existing **Java application**.\
In this mode, the Microflow runs **inside the JVM of the host application** and is invoked using **Microflow Java APIs**.

This approach is suitable when integration logic needs to be tightly coupled with a Java‑based system and does not need to be exposed as a standalone service.

***

### When to Use Embedded Microflow

Embedded Microflow is recommended when:

* The consuming system is a Java application
* You want in‑process execution with low latency
* The Microflow does not need to be accessed via REST APIs
* You want to reuse Microflow logic as a Java library

***

### Steps to Export an Embedded Microflow

#### Step 1: Choose Embedded Export Option

1. Open the completed Microflow in **Microflow Designer**
2. Locate **Choose Export** at the top‑right corner of the screen
3. Click **Export Embedded Microflow**

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FmRJ3yzuQzJsf335B1fTG%2Fimage.png?alt=media&#x26;token=7dbdd176-f59c-42f8-9f0d-3fcdd50f0362" alt=""><figcaption></figcaption></figure>

***

#### Step 2: Export the Microflow as JAR

1. Enter the desired **File Name**
2. Click **Export**

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FuQbsZB8ivvFdyj7z7b5M%2Fimage.png?alt=media&#x26;token=ed5ad57f-d16b-4a8f-a4af-ec16577ecf8e" alt=""><figcaption></figcaption></figure>

***

### Result of Export

* The Microflow is downloaded as a **JAR file**
* The generated JAR contains:
  * Microflow execution logic
  * Business Object definitions
  * Required runtime metadata

You can now:

* Copy the JAR file into another **Java project**
* Add it to the project’s classpath
* Invoke the Microflow using **Microflow Java APIs**

***

### Using Embedded Microflow in Java Applications

Once embedded, the Microflow behaves like a reusable Java component and can be:

* Invoked programmatically
* Integrated with existing services or batch jobs
* Used as part of internal application logic

This enables reuse of ONEWEB Microflow logic without deploying a separate runtime server.

***

### Summary

**Embedded Microflow** provides a simple and efficient way to reuse Microflow logic inside Java applications.

With Embedded Microflow, you can:

* Export Microflow as a JAR file
* Embed it into an existing Java project
* Execute integration logic in‑process
* Avoid standalone service deployment

Embedded Mode is ideal for **tight Java integration scenarios**, while **Standalone Server Mode** is better suited for service‑based and cross‑system integration.


---

# 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.onewebstack.com/building-apps/integrations/develop-integration-with-oneweb-microflow/start-with-microflow-in-oneweb/export-your-microflow/embedded-microflow.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.
