Overview
This node integrates with the NetSuite REST API to perform various record operations within a NetSuite account. Specifically, the "Insert Record" operation allows users to create new records of different types in their NetSuite environment. This is useful for automating data entry tasks such as adding new customers, sales orders, invoices, or custom records directly from workflows.
Practical examples include:
- Automatically inserting new customer records when a lead is qualified.
- Creating sales orders based on e-commerce transactions.
- Adding calendar events or tasks triggered by external scheduling systems.
- Inserting custom records for specialized business processes.
The node supports concurrency control to manage multiple insertions efficiently and can return either the full API response or just the relevant body content.
Properties
| Name | Meaning |
|---|---|
| Record Type | The type of NetSuite record to insert. Options include standard records like Assembly Item, Billing Account, Calendar Event, Cash Sale, Contact, Customer, Invoice, Sales Order, Vendor, and many others including Custom Records. |
| Custom Record Script ID | (Required if Record Type is "Custom") The internal identifier of the custom record type to insert. Typically starts with "customrecord". |
| Replace Sublists | (Optional) Names of sublists on the record where all lines will be replaced with those specified in the request. Multiple sublist names are comma-separated. Only applicable for insert and update operations. |
| API Version | The version of the NetSuite REST API to use. Currently only "v1" is supported. |
| Options | Additional options: • Concurrency: Maximum number of simultaneous REST requests sent to NetSuite (default 1). • Full Response: Whether to return the full API response instead of just the response body (default false). |
Output
The output consists of JSON objects representing the inserted records or the API response details. Each output item corresponds to an input item processed.
The
jsonfield contains the response data from NetSuite, which may include:- The newly created record's fields and identifiers.
- Metadata such as operation IDs, job IDs, property validation info, and links to the created resource.
- A success flag indicating whether the insertion was successful.
If the "Full Response" option is enabled, the output includes status code, headers, and the full response body.
The node does not output binary data.
Dependencies
- Requires valid NetSuite API credentials with appropriate permissions to create records.
- Uses the NetSuite REST API endpoint configured via these credentials.
- Supports concurrency control using the
p-limitlibrary to manage parallel requests. - No additional environment variables are required beyond the API credentials.
Troubleshooting
Common Issues:
- Incorrect or missing API credentials will cause authentication failures.
- Using an invalid or unsupported record type or custom record script ID will result in errors.
- Exceeding concurrency limits or API rate limits may cause request failures or throttling.
- Improperly formatted record data in the input JSON can cause validation errors.
Error Messages:
- Errors returned from NetSuite typically include error codes and detailed messages in the response body.
- If the node is set to stop on failure, it throws an error with the message from NetSuite.
- When "continue on fail" is enabled, errors are returned as JSON objects with an
errorfield describing the issue.
Resolution Tips:
- Verify that the API credentials have sufficient permissions.
- Double-check the record type and custom record script ID values.
- Validate the input data structure matches NetSuite's expected format.
- Adjust concurrency settings to avoid hitting API limits.
- Enable full response output to get more detailed error information for debugging.
Links and References
- NetSuite REST API Documentation
- NetSuite Record Types Reference
- n8n Documentation on Credentials
- p-limit npm package (used internally for concurrency control)