> For the complete documentation index, see [llms.txt](https://docs.helmut.de/helmut4-releases/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.helmut.de/helmut4-releases/v4.11.0/helmut4-components/streamdesigner/nodes/actions/misc/execute-javascript-action.md).

# Execute Javascript Action

Execute JavaScript Action enables the execution of JavaScript code via Nashorn, unlocking a wide range of possibilities. Its primary purpose is to facilitate integration with third-party systems for which MoovIT GmbH has not yet provided dedicated action nodes. If you require assistance, please contact us.

**Nashorn Overview and Limitations**\
Nashorn is the JavaScript engine included with Oracle’s Java 8–14 releases. It implements ECMAScript 5.1 and offers partial support for some ECMAScript 6 features, allowing Java applications to run JavaScript scripts on the JVM. However, Nashorn has several limitations to consider when using it within Execute JavaScript Action:

* **ECMAScript Support**\
  • Supports ECMAScript 5.1 fully, but only a subset of ECMAScript 6 (for example, limited support for arrow functions and template literals). Many modern JavaScript language features—such as classes, modules, and newer syntax introduced in ES2017+—are not supported.
* **Performance Considerations**\
  • Nashorn compiles scripts to bytecode at runtime, which can introduce a slight startup delay when loading large or complex scripts. For long-running integrations, this overhead is usually negligible, but you should profile performance if execution speed is critical.
* **Limited Browser API Support**\
  • Nashorn does not emulate browser-specific APIs (e.g., `window`, `document`, or DOM manipulation). Any script relying on browser globals must either be adapted to use pure JavaScript logic or augmented with custom Java-side shims.

Example javascript nashorn code which returns the result via the wildcard [stream.last\_result](/helmut4-releases/v4.11.0/helmut4-components/streamdesigner/wildcards/result-or-return-wildcards-2/stream-last_result.md) or [node result](/helmut4-releases/v4.11.0/helmut4-components/streamdesigner/wildcards/result-or-return-wildcards-2/node-result.md)

```javascript
var myInput = "test1234";
var myOutput = myInput;

myOutput;
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.helmut.de/helmut4-releases/v4.11.0/helmut4-components/streamdesigner/nodes/actions/misc/execute-javascript-action.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
