# Custom Logic with Java Node

Although ONEWEB Microflow Designer provides a comprehensive set of built‑in integration nodes, certain integration scenarios require **custom logic** that goes beyond standard configuration capabilities.\
To address such requirements, Microflow Designer supports a **Java Node**, enabling developers to execute **custom Java code** as part of a Microflow execution.

This approach ensures that advanced or highly specific logic can be implemented when necessary, while keeping Microflows **clean, orchestrative, and aligned with low‑code design principles**.

***

### Purpose of Custom Logic in Microflow

Custom logic is typically introduced when:

* Specialized or complex computation is required
* Proprietary or domain‑specific algorithms must be implemented
* Third‑party Java libraries need to be leveraged
* Integration logic cannot be expressed using built‑in Microflow nodes

By encapsulating such logic within Java classes, Microflows can remain focused on **orchestration and data flow**, while computational complexity is handled externally.

***

### Java Node in Microflow Designer

The **Java Node** allows a Microflow to invoke a **Java method packaged as a JAR file** during execution.\
It serves as a bridge between **low‑code integration modeling** and **full‑code extensibility**.

Using a Java Node, developers can:

* Execute custom Java logic as part of a Microflow
* Pass data from Microflow parameters into Java methods
* Receive computed results back into the Microflow
* Integrate external Java libraries into Microflow execution

This enables Microflow Designer to support advanced enterprise scenarios without compromising its visual, logic‑driven design model.

***

### Custom Logic Lifecycle Using Java Node

From a conceptual standpoint, adding custom logic via Java Node involves:

* Implementing required logic in a Java class with defined inputs and outputs
* Packaging the Java code as a JAR artifact
* Uploading the JAR into the Microflow environment
* Configuring a Java Node within the Microflow to invoke the desired class and method
* Mapping Microflow parameters to Java method arguments and return values

This lifecycle ensures a clear contract between Microflows and external logic components.

<figure><img src="/files/6xmn1bnQrrj3nk4C7aUg" alt=""><figcaption></figcaption></figure>

***

### Managing Dependent JAR Files

When custom Java logic relies on additional libraries, ONEWEB recommends managing dependencies separately.

Best practice includes:

* **Avoid bundling dependent libraries** into the main Java Node JAR
* Upload dependency JARs individually using the JAR upload utility
* Centrally manage and version shared libraries

This approach:

* Prevents classpath conflicts
* Improves dependency governance
* Simplifies maintenance of shared utilities across Microflows

***

### Best Practices for Using Java Node

To ensure readability, maintainability, and long‑term stability:

* Keep Java logic focused and reusable
* Follow the single‑responsibility principle
* Clearly define input and output contracts
* Prefer built‑in Microflow nodes whenever possible
* Use Java Node only when configuration‑based logic is insufficient

This balanced approach allows teams to benefit from **low‑code productivity** while retaining the ability to implement **full‑code logic when required**.

***

### Summary

Custom logic support in ONEWEB Microflow Designer enables developers to extend Microflows with **full‑fledged Java functionality** through the Java Node.

By leveraging the Java Node, applications can:

* Execute complex or proprietary backend logic
* Integrate with third‑party Java libraries
* Maintain a clear separation between orchestration and computation
* Combine low‑code design with full‑code flexibility

This hybrid capability ensures that ONEWEB remains both **developer‑friendly** and **enterprise‑ready**, even for advanced integration and computation scenarios.


---

# 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/designer-reference/microflow-designer/custom-logic-with-java-node.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.
