> For the complete documentation index, see [llms.txt](https://docs.rierino.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rierino.com/devops/microservices/building-blocks/execution-handlers/custom-code-handlers.md).

# Custom Code Handlers

Custom code handlers are included in all Rierino platform versions, providing ability to incorporate highly customized logic and actions

Custom code handlers support dynamic scripts, runtime-loaded Java code, hot-swapped packages, and Python procedures.

Use this page for handler-level details:

* Class names
* Handler parameters
* Runtime dependencies
* Built-in runtime behavior

Use [Custom Code Actions](https://docs.rierino.com/devops/api-event-and-process-flows/configuring-saga-steps/event-step/custom-code-actions.md) for action-level saga step fields and parameters.

### Run Scripts

Class: `com.rierino.handler.ScriptLoadedEventHandler`

Executes stored scripts through Javax scripting engines.

#### Handler parameters

| Parameter     | Definition                             | Example              | Default        |
| ------------- | -------------------------------------- | -------------------- | -------------- |
| `code.state`  | State manager storing code definitions | `customJSCodes`      | `handler_code` |
| `code.domain` | Code category allowed for this handler | `custom_calculation` | -              |

Action details: [Run Scripts](https://docs.rierino.com/devops/api-event-and-process-flows/configuring-saga-steps/event-step/custom-code-actions/run-scripts.md)

### Run Java Code

Class: `com.rierino.handler.OpenHFTEventHandler`

Loads and executes dynamic Java handler code during runtime.

#### Handler parameters

| Parameter        | Definition                                 | Example             | Default          |
| ---------------- | ------------------------------------------ | ------------------- | ---------------- |
| `code.state`     | State manager storing code definitions     | `customCodes`       | `handler_code`   |
| `code.domain`    | Code category allowed for this handler     | `basket_operations` | -                |
| `code.local.dir` | Local directory used to store dynamic code | `/tmp`              | `java.io.tmpdir` |

Action details: [Run Java Code](https://docs.rierino.com/devops/api-event-and-process-flows/configuring-saga-steps/event-step/custom-code-actions/run-java-code.md)

### Run Java Package

Class: `com.rierino.handler.JarLoadedEventHandler`

Loads and executes packaged Java handlers during runtime.

#### Handler parameters

| Parameter       | Definition                            | Example             | Default          |
| --------------- | ------------------------------------- | ------------------- | ---------------- |
| `jar.state`     | State manager storing jar definitions | `customJars`        | `handler_jar`    |
| `jar.domain`    | Jar category allowed for this handler | `basket_operations` | -                |
| `jar.local.dir` | Local directory used to store jars    | `/tmp`              | `java.io.tmpdir` |

Action details: [Run Java Package](https://docs.rierino.com/devops/api-event-and-process-flows/configuring-saga-steps/event-step/custom-code-actions/run-java-package.md)

### Run Python Procedure

Class: `com.rierino.handler.py4j.Py4JEventHandler`

Calls Python code through Py4J for runtime event processing.

#### Handler parameters

This handler has no special parameters.

#### Runtime dependency

```gradle
implementation (group:'com.rierino.custom', name: 'py4j', version:"${rierinoVersion}")
```

#### Runtime note

This handler typically requires an extra container alongside the runner, such as `ghcr.io/rierino-open/py-runner`.

Action details: [Run Python Procedure](https://docs.rierino.com/devops/api-event-and-process-flows/configuring-saga-steps/event-step/custom-code-actions/run-python-procedure.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rierino.com/devops/microservices/building-blocks/execution-handlers/custom-code-handlers.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
