Actions57
- 1. Manager Actions
- 2. Mouse Actions
- 3. Keyboard Actions
- 4. Browser Control Actions
- 5. Element Actions
- 6. Image Actions
- 7. Others Actions
- 8. Email Actions
- 9. Developer Actions
- 10. General Debug Actions
7. Others → execute_javascript
AI-generatedSummary
Executes a supplied JavaScript function in the browser page routed by the selected remote port, and returns the function’s result when a response is received.
Inputs
- Topic (required) — MQTT topic used to publish the request to the client.
- QoS — MQTT delivery level; defaults to 1 (at least once).
- Include Input Items — When enabled, attaches selected fields from incoming workflow items as payload.inputItems.
- Include Input Fields — Comma-separated field paths to include from incoming items, including nested paths and array indexes; shown when Include Input Items is enabled.
- Wait For Response — When enabled, waits for the MQTT response before continuing; defaults to false.
- Response Timeout (sec) — Maximum response wait time in seconds when waiting is enabled; defaults to 60.
- Delay Next Step (ms) — Delay before continuing after the response, or after publishing when not waiting; defaults to a random 200–1000 ms expression.
- Remote Port (required) — CDP port used to route the JavaScript action to the intended browser session. Commonly connected from the node that opened the profile; 127001 denotes a local session.
- Script (required) — JavaScript function written as an arrow function and executed in the page context, such as
() => document.title. Its returned value becomes the action result. - Arg (JSON) — Optional JSON value passed as the script function’s argument; can be an object, array, or incoming item data.
Output shape
A workflow item containing the JavaScript action result when a response is received.
The action is sent over MQTT. The operation defaults to not waiting for a response; enable Wait For Response to receive the result before continuing. When not waiting, the node proceeds after publishing and the configured delay.
