Execute Custom JavaScript Code Node in Flow Builder
Have you checked for existing requests?
- [x] I have searched the existing issues and found no similar request.
Feature Area
🔀 Flow Builder (Flows, Tags, Custom Fields)
Is your feature request related to a problem? Please describe.
Currently, handling data manipulation, input validation, JSON processing, or custom business logic inside the Flow Builder requires relying on external automation tools (like Zapier, Make) or external webhooks.
Using external servers for pure JavaScript calculations increases execution latency, introduces unnecessary third-party dependencies, and complicates workflow setup.
Describe the solution you'd like
Add an Execute JavaScript Code action node under Actions > Tools in the Flow Builder, allowing users to run custom JavaScript directly within their bot flows.
Key Specifications & Requirements:
-
Navigation Path:
- Available via
Actions->Tools->Execute JavaScript Code.
- Available via
-
Execution & Return Value:
- Custom JavaScript logic execution.
- Code must return a value (Text, Number, JSON object, Array, Boolean, etc.) so it can be mapped back to Custom User Fields or dynamic flow outputs.
-
Runtime Restrictions & Limitations:
- Pure JavaScript Only: No external libraries/packages import supported.
- Sandbox Isolation: No direct internet/network access or file system access (API calls must strictly use the separate External Request node).
- Timeout Safety: Strict execution limit of 500ms. Code exceeding 500ms will be automatically terminated to prevent system hanging.
-
Error Handling & Logging:
- Automatically log execution errors and syntax failures in the System Error Log for easy debugging and inspection by the flow builder.
Describe alternatives you've considered
- External Webhooks / External API Requests: Causes network overhead and latency for basic string formatting, math calculations, or array operations.
- Third-Party Automation (Zapier/Make): Adds extra cost, setup complexity, and delay for simple data transformations.
Additional context
- Goal: Empower creators to execute custom JavaScript code to process data, validate inputs, format JSON, and dynamically control workflow behavior securely within ChatbotX flows.
Please check the documentation here: https://chatbotx.io/docs/automation/execute-javascript-code