This is an n8n community node that lets you interact with NetSuite using OAuth 1.0a authentication. It supports both RESTlet operations and SuiteQL queries.
n8n is a fair-code licensed workflow automation platform.
- OAuth 1.0a Authentication: Secure authentication using NetSuite's OAuth 1.0a standard
- SuiteQL Support: Execute SQL-like queries against your NetSuite data
- Automatic Pagination: Fetch all pages of results automatically
- Configurable Limits: Control the number of results per page
- Smart OAuth Handling: Proper signature generation for paginated requests
- RESTlet Operations: Call custom NetSuite RESTlet scripts
- Automatic Pagination: Fetch all pages of results with configurable start/end indices
- Flexible Configuration: Customize field names for pagination and results
- Custom Company URL: Support for different RESTlet domains
- File Upload: Upload PDF, Excel, and CSV files to NetSuite via RESTlet
- Record Operations: Full CRUD operations on NetSuite records
- Create records with optional Duplicate Detection
- Get records by ID
- Update records (PUT and PATCH)
- Post actions to records
- Transform records (e.g., Sales Order to Invoice)
Follow the installation guide in the n8n community nodes documentation.
npm install n8n-nodes-netsuite-restlet-suiteql- Go to Settings > Community Nodes
- Select Install
- Enter
n8n-nodes-netsuite-restlet-suiteqlin the Package Name field - Click Install
Before using this node, you need to set up OAuth 1.0a authentication in NetSuite:
-
Create an Integration Record:
- Navigate to Setup > Integration > Manage Integrations > New
- Check "Token-Based Authentication"
- Save and note down the Consumer Key and Consumer Secret
-
Create an Access Token:
- Navigate to Setup > Users/Roles > Access Tokens > New
- Select your Integration, User, and Role
- Save and note down the Token ID and Token Secret
When setting up the NetSuite OAuth1 API credentials in n8n, you'll need:
- Account ID: Your NetSuite account ID
- Company URL: Your NetSuite SuiteTalk API URL (e.g.,
1234567.suitetalk.api.netsuite.com) - RESTlet Company URL (optional): Your NetSuite RESTlet API URL (e.g.,
1234567.restlets.api.netsuite.com). Leave empty to use the Company URL above. - Consumer Key: From your Integration record
- Consumer Secret: From your Integration record
- Token Key: Token ID from your Access Token
- Token Secret: Token Secret from your Access Token
Execute SQL-like queries against your NetSuite data with automatic pagination support.
- Query: The SuiteQL query to execute
- Return All Pages: Toggle to automatically fetch all pages of results
- When enabled: Automatically follows pagination links until all data is retrieved
- When disabled: Returns only the specified number of results
- Limit: Maximum number of results per page (1-1000, only visible when "Return All Pages" is disabled)
When "Return All Pages" is enabled, the node will:
- Execute your query and retrieve the first page of results
- Automatically detect if more data is available (via
hasMorefield) - Follow the
nextlink in the response to fetch subsequent pages - Combine all items from all pages into a single result
- Return the complete dataset with proper OAuth authentication for each request
This eliminates the need to manually handle pagination when working with large datasets.
Example Query:
SELECT id, companyName, email FROM customer WHERE subsidiary = '1' LIMIT 10Example Query with Pagination:
SELECT
Item.id,
Item.itemId as sku,
SUM(InventoryBalance.quantityAvailable) as total_quantity
FROM
Item
LEFT JOIN
InventoryBalance ON InventoryBalance.item = Item.id
WHERE
BUILTIN.DF(Item.itemType) IN ('Assembly/Bill of Materials','Inventory Item')
AND Item.isinactive = 'F'
GROUP BY
Item.id, Item.itemId
ORDER BY
Item.id ASCWith "Return All Pages" enabled, this query will automatically fetch all inventory items across multiple pages.
Call custom NetSuite RESTlet scripts with automatic pagination support and file upload capabilities.
Execute a custom RESTlet script with optional automatic pagination.
- Script ID: The Script ID of your RESTlet (e.g.,
customscript_my_restlet) - Deploy ID: The Deploy ID of your RESTlet (e.g.,
customdeploy_my_restlet) - Body: JSON body to send to the RESTlet
- Return All: Toggle to automatically paginate through all results
- When enabled: Additional pagination options appear
- Page Size: Number of records to fetch per page (default: 1000)
- Start Index Field: Field name in the request body for the start index (default:
start) - End Index Field: Field name in the request body for the end index (default:
end) - Results Field: Field name in the response containing the results array (default:
results)
When "Return All" is enabled, the node will:
- Automatically increment the start/end index fields in your request body
- Make multiple requests to fetch all pages of data
- Stop when it receives fewer results than the page size (indicating the last page)
- Combine all results into a single response with a
totalcount
Example Body (without pagination):
{
"id": "19405",
"type": "savesearchdata",
"start": 0,
"end": 1000
}Example with Pagination Enabled:
- Set "Return All" to true
- Set "Page Size" to 1000
- Set "Start Index Field" to start
- Set "End Index Field" to end
- Set "Results Field" to results
- The node will automatically update
startandendvalues in each request
The response will contain:
{
"results": [...all items from all pages...],
"total": 5432
}Upload PDF, Excel, or CSV files to NetSuite via a RESTlet endpoint. The node automatically converts the file to base64 and determines the file type from the extension.
Parameters:
- RESTlet Script ID: The numeric Script ID of your upload RESTlet (e.g.,
123) - RESTlet Deployment ID: The numeric Deployment ID (e.g.,
1) - Folder ID: The internal ID of the destination folder in NetSuite
- File Name: The name for the uploaded file (defaults to
{{ $binary.data.fileName }})
Supported File Types:
- PDF files (
.pdf) - Automatically detected asPDFtype - Excel files (
.xlsx,.xls) - Automatically detected asEXCELtype - CSV files (
.csv) - Automatically detected asCSVtype
Request Body Sent:
{
"postType": "uploadFile",
"folderId": "12345",
"name": "document.pdf",
"base64Content": "JVBERi0xLjQKJeLjz9MKMyAwIG9iai...",
"fileType": "PDF"
}Prerequisites:
- Your RESTlet must accept file upload requests with the structure above
- The RESTlet should create a file record in NetSuite using the base64 content
- Input data must contain binary data (use Read/Download Binary File node before this)
Example Workflow:
- Use "HTTP Request" or "Read Binary File" node to get a file
- Connect to the NetSuite node
- Select Resource: RESTlet
- Select Operation: Upload File
- Configure the RESTlet IDs and folder ID
- The file will be uploaded automatically
Create a new record in NetSuite. Returns the newly created record's ID and location.
Duplicate Detection (optional): Enable to check for existing duplicates before creating a record. When enabled, the node runs a SuiteQL query to look up matching field values. If a duplicate is found, the creation is skipped and a marker is output instead.
- Duplicate Detection: Toggle on/off (default: off)
- SuiteQL Table Name: The SuiteQL table to query (e.g.,
transactionfor salesOrder,entityfor customer). Note: SuiteQL table names differ from REST API record types. - Duplicate Check Fields: One or more field mappings (combined with AND logic):
- NetSuite Field: The internal field name to check (e.g.,
otherrefnum) - Match Value: The value to match against (supports expressions, e.g.,
={{ $json.poNumber }})
- NetSuite Field: The internal field name to check (e.g.,
When a duplicate is found, the node outputs:
{
"skipped": true,
"reason": "duplicate",
"duplicateId": "12345",
"recordType": "salesOrder",
"matchedFields": { "otherrefnum": "PO-1234", "entity": "42" }
}Example Body:
{
"entity": "12345",
"trandate": "2024-12-04",
"item": {
"items": [
{
"item": "123",
"quantity": 1,
"rate": 100
}
]
}
}Response:
{
"id": "54321",
"location": "/services/rest/record/v1/salesOrder/54321"
}The node automatically extracts the record ID from the Location header returned by NetSuite.
Retrieve a record by its internal ID.
Replace an entire record with new data.
Update specific fields of a record without replacing the entire record.
Post a specific action to a record.
Transform one record type into another (e.g., Sales Order to Invoice).
Parameters:
- Record Type: The source record type (e.g.,
salesOrder) - Target Record Type: The destination record type (e.g.,
invoice) - Record ID: The ID of the source record
- Body: Optional JSON to override fields in the transformed record
Delete a record by internal ID.
| Parameter | Description |
|---|---|
| Record Type | The record type (e.g., salesOrder, customer) |
| Record ID | The internal ID of the record to delete |
Output:
{
"deleted": true,
"recordType": "salesOrder",
"recordId": "12345"
}- n8n community nodes documentation
- NetSuite SuiteTalk REST Web Services
- NetSuite SuiteQL
- NetSuite OAuth 1.0 Setup
- Added Duplicate Detection for Record > Create operation
- Optional SuiteQL-based pre-check before creating records
- Configurable field mappings with AND logic for matching
- Skips duplicate creation with informative output marker
- Input validation and SQL injection prevention
- Added file upload capability to RESTlet operations
- Support for uploading PDF and Excel files to NetSuite
- Automatic file type detection based on extension
- Base64 encoding handled automatically
- Initial release
- SuiteQL query execution with automatic pagination support
- Return All Pages feature for fetching complete datasets
- Configurable limit per page (1-1000 results)
- RESTlet operations with automatic pagination
- Configurable start/end index fields
- Configurable results field name
- Custom RESTlet Company URL support
- Full Record CRUD operations
- OAuth 1.0a authentication with proper signature handling for paginated requests
- Record transformation support
For issues, questions, or contributions, please visit the GitHub repository.
cafeasp
Note: This is a community-maintained node and is not officially supported by n8n or Oracle NetSuite.