NodeJS app
This section explains how to use the NodeJS app to execute custom JavaScript code within a journey for data transformation, validation, and logic-based automation.
The NodeJS app in Quickwork enables you to write and execute custom JavaScript code directly within a journey. It is designed for advanced use cases where prebuilt connectors or formulas cannot handle the required business logic, transformations, or validations. This app allows you to process dynamic payloads, and return computed outputs in real time, all within the same journey.
NodeJS actions execute in a secure, sandboxed environment with isolated runtime contexts and limited execution time to maintain performance and reliability across enterprise workloads.
Key features
- Custom logic execution: Write JavaScript or Node.js code for dynamic data processing.
- Flexible data handling: Supports strings, numbers, booleans, and JSON (both stringified and non-stringified).
- Handles large payloads: Accepts payloads up to 10 MB, suitable for complex integrations.
- Extended runtime: Allows execution time of up to 90 seconds, ideal for heavier computations.
- Context-based access: Data pills from previous steps can be accessed directly in the code or via the context object as key–value pairs.
- Data manipulation and transformation: Perform loops, validations, array/object operations, and conditional logic.
Use case: Email domain validation
Validate the domain of a user’s email address before adding it to a CRM. The NodeJS step checks whether the email belongs to a corporate domain and returns structured data for downstream use.
When a form submission trigger captures a user’s email, the NodeJS app processes it using JavaScript. It extracts the domain, verifies if it’s corporate (not Gmail/Yahoo), and returns key details such as the domain and a boolean flag. The output can then be used in subsequent steps, for example, adding only corporate users to Salesforce or sending alerts for public domains.
Prerequisites
- Access to Quickwork to configure the journey
- A connected Typeform account with an active form containing an Email field
Configuration steps
-
Add trigger
- In the Event section, select Typeform from the App drop-down and from the Event drop-down, choose New Form Response.
- Connect your Typeform account and select the form that includes the Email field.
- When a new response is submitted in Typeform, this journey will be triggered.
-
Add NodeJS step: Click + below the trigger, from the Simple Action drop-down, select NodeJS and choose Run javascript.
-
Configure context: In the Context input field, enter
Key: email
Value: Drag and drop the Email data pill from the Typeform trigger in the Data Tree Output into the Value field. This passes the user’s email from the Typeform submission into the NodeJS code for processing.
-
Add JavaScript code: Write the code that extracts the email received from Typeform, isolates its domain, and checks if it belongs to a public provider like Gmail, Outlook, Yahoo. It then marks the email as corporate or public and returns this information in a structured JSON format for use in the next steps of the journey.
// Extract email address from input or context const email = context.email || input.email || "[email protected]"; // Split to extract the domain const domain = email.split("@")[1] || "unknown.com"; // Check if the domain is corporate (not public email provider) const publicDomains = ["gmail.com", "yahoo.com", "hotmail.com", "outlook.com"]; const isCorporate = !publicDomains.includes(domain.toLowerCase()); // Assign the output object instead of using 'return' output = { userEmail: email, emailDomain: domain, isCorporateEmail: isCorporate, message: isCorporate ? `Valid corporate email detected: ${domain}` : `Public domain detected: ${domain}` };

- Add sample JSON output: This defines the structure of the data that Quickwork will generate as output and expose as data pills.
Both context and output are predefined variables in Quickwork’s NodeJS environment. You don’t need to declare them, simply use them directly in your JavaScript code.
The context object holds input data passed from previous steps (for example, a user’s first name and last name). You can access its values using dot notation, such as context.firstName.
Set your return value to output variable for returning output from the code.
Example code:
let firstName = context.firstName; let lastName = context.lastName; output = { fullName : firstName + '' + lastName }
In the above use case, the context object provides input data to the NodeJS code, such as the email received from the Typeform trigger. It acts as a key–value store that lets you reference dynamic data within the script without hardcoding values. In this case, context.email fetches the user’s email submitted via Typeform. The code then processes this value, extracts the domain, checks whether it’s a public or corporate email, and finally stores the result in the output object. The output holds the processed information, email, domain, validation status, and message, which is then passed to subsequent journey steps such as Salesforce as data pills for further automation.
- Save and test
- Click Save & Start to activate the journey.
- Go to your Typeform form and submit a response with a valid email address.
- Navigate to the History tab in Quickwork to verify the execution and view the output data.

The validated data stored in the output object can be seamlessly passed to downstream applications like Salesforce. For instance, corporate emails identified through the NodeJS step can be automatically added as new leads or contacts in Salesforce, while public domain emails can be filtered out or routed differently.
✏️Tips and recommendations
- Always enter your JavaScript in the Text mode of the Code field.
- Use short, efficient scripts.
- Store dynamic inputs as key–value pairs in the Context section (For example, email, amount, customerName). Access them in your code using context.keyName.
- Always assign your final data to the output object. Ensure the output is well-structured (object, array, or string) so that it appears as clean data pills for subsequent steps.
Updated 1 day ago