> 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/helmut4-components/streamdesigner/nodes/actions/misc-21/execute-javascript-action.md).

# Execute Javascript Action

The **Execute JavaScript Action** node runs JavaScript code using **Nashorn**, enabling powerful custom logic and integrations directly inside a stream.

Its primary purpose is to integrate Helmut with third-party systems where no dedicated action node exists yet. Typical use cases include custom API calls, data transformation, conditional logic, or generating values that are reused later in the workflow.

If you need assistance building a specific integration, please contact MoovIT GmbH.

#### Input Parameters

**JavaScript**\
JavaScript code executed via the Nashorn engine.

<figure><img src="/files/X6jMRs6VmIUdorTHBTuH" alt="" width="349"><figcaption><p>Execute Javascript Action</p></figcaption></figure>

#### Output and Wildcards

The return value of the script is provided as the node result and can be accessed via:

* [{stream.last\_result}](/helmut4-releases/helmut4-components/streamdesigner/wildcards/result-or-return-wildcards-2/stream-last_result.md)
* [{node.result.?}](/helmut4-releases/helmut4-components/streamdesigner/wildcards/result-or-return-wildcards-2/node-result.md)

To return a value, ensure the last expression in your script evaluates to the desired output.

#### Nashorn Overview and Limitations

Nashorn is the JavaScript engine included with Oracle Java **8–14**. It implements **ECMAScript 5.1** and supports only a limited subset of newer JavaScript features.

**ECMAScript Support**

* Full ECMAScript 5.1 support
* Partial ECMAScript 6 support (limited features such as some arrow functions or template literals)
* No modern features such as classes, modules, and most ES2017+ syntax

**Performance Considerations**

* Scripts are compiled to bytecode at runtime, which can cause a small startup delay for larger scripts
* Usually negligible, but should be considered for heavy or frequent execution

**No Browser APIs**

* Nashorn does not provide browser objects like `window`, `document`, or DOM APIs
* Scripts must use plain JavaScript logic (or JVM-provided functionality, if available)

#### Example

The following script returns a value which can then be used via [{stream.last\_result}](/helmut4-releases/helmut4-components/streamdesigner/wildcards/result-or-return-wildcards-2/stream-last_result.md) or [{node.result.?}](/helmut4-releases/helmut4-components/streamdesigner/wildcards/result-or-return-wildcards-2/stream-last_result.md):

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

myOutput;
```

#### Typical Use Cases

* integrating with third-party systems without dedicated Helmut nodes
* transforming metadata values (formatting, parsing, mapping)
* building custom identifiers or filenames
* conditional logic and decision making within a stream
* preparing JSON payloads for HTTP Request nodes

#### Practical Tip

Keep scripts small and focused. If you need complex logic, consider splitting it into multiple nodes or using a dedicated external service—this makes workflows easier to maintain and troubleshoot.


---

# 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/helmut4-components/streamdesigner/nodes/actions/misc-21/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.
