# Embedded Microflow vs. Runtime Microflow Server

ONEWEB Microflow can be used in **two different deployment models**, depending on how the integration logic is intended to be consumed and operated:

1. **Embedded Microflow**
2. **Runtime Microflow Server**

Each option serves a different integration and deployment requirement.

***

### Embedded Microflow

**Embedded Microflow** allows users to design a Microflow and package it as a **Java JAR file**, which can then be embedded into other applications or systems.

#### How It Works

* The Microflow is designed using **Microflow Designer**
* The Microflow is exported as a **JAR file**
* The generated JAR is imported into an existing **Java application**
* The Microflow is executed using **Microflow Java APIs**

In this model, the Microflow runs **inside the host application’s JVM**, behaving like a shared library or embedded service.

***

#### Use Cases

Embedded Microflow is suitable when:

* Integration logic must be tightly coupled with an existing Java system
* The target environment does not allow running a separate service
* Low‑latency, in‑process execution is required
* REST exposure is not necessary

Typical examples include:

* Legacy Java application extensions
* Custom batch jobs
* Embedded integration utilities

***

### Runtime Microflow Server

**Runtime Microflow Server** allows Microflows to be deployed and executed as **standalone services**.

#### How It Works

* The Microflow Runtime Server is installed and started independently
* Microflows are deployed to the runtime
* Each Microflow is exposed as a **service endpoint**
* External systems or applications invoke the Microflow using **REST APIs**

In this mode, the Microflow behaves like a true **microservice**, accessible over the network.

***

#### Use Cases

Runtime Microflow Server is suitable when:

* Microflows must be consumed by multiple applications
* Integration needs to scale independently
* REST‑based integration is required
* The architecture follows a service‑oriented or microservices model

Typical examples include:

* Backend APIs for web or mobile applications
* System‑to‑system integration services
* Cloud‑hosted integration layers

***

### Key Differences

| Aspect             | Embedded Microflow                 | Runtime Microflow Server        |
| ------------------ | ---------------------------------- | ------------------------------- |
| Deployment Model   | Embedded inside a Java application | Standalone server runtime       |
| Execution          | In‑process (same JVM)              | Remote service execution        |
| Access Method      | Java API                           | REST API                        |
| Scalability        | Coupled with host application      | Independently scalable          |
| Architecture Style | Library / embedded service         | Service‑oriented / microservice |
| Typical Consumers  | Java applications                  | Web, mobile, external systems   |

***

### Choosing the Right Deployment Model

Use **Embedded Microflow** when:

* Integration logic must run inside an existing Java system
* Deployment simplicity is critical
* Service exposure is not required

Use **Runtime Microflow Server** when:

* Integration logic must be shared across applications
* REST‑based access is required
* Scalability and loose coupling are important

Selecting the correct deployment model ensures both **operational efficiency and architectural clarity**.

***

### Summary

ONEWEB Microflow supports two flexible deployment approaches:

* **Embedded Microflow** – best for in‑process Java integration
* **Runtime Microflow Server** – best for service‑oriented and REST‑based integration

Both models allow developers to reuse the same Microflow design while adapting deployment to different architectural needs, making ONEWEB Microflow a versatile integration component within enterprise systems.


---

# 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/embedded-microflow-vs.-runtime-microflow-server.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.
