NiFi Adapter for NetSuite

Vishal Augustine

Vishal Augustine,

Vice President, Product Development

NiFi Adapter for NetSuite - Revssurance

How do you connect to NetSuite from NiFi, and with a connection that is highly configurable? How do you create a framework where connecting, transforming, and testing any new NetSuite end-point can be done in only a few minutes?

This can be achieved through a combination of NiFi, Python and config files. Below are the steps:

Step 1: Have a clear configuration approach and keep the configuration files ready.

In file, set the variable to your application’s “master” NiFi config file. In this case, the master config file is

NiFi is designed where the NiFi instance has to be restarted if the .properties files are modified; only then will the variables in .properties file take effect. This is highly inconvenient in a production environment. To avoid such “restarts” for the NetSuite adapter changes and to keep the connections to each external system modular, it is recommended to create an interface-specific config file. Refer the config file as shown below. This is like a pointer to a pointer to a pointer.

NiFI Revssurance

Within file, add the following variables:

# Point to the NetSuite config file location ns_conf_file=/path/to/conf/netsuite.conf

# Point to a working directory


# Point to the python script location


# Point to the python binary


Put all the NetSuite-specific variables into the NetSuite Config file – netsuite.conf

# NetSuite OAut1.0 authentication info/section


token_key=<token key – obtain from the NetSuite Server side>

token_secret=<token secret – obtain from the NetSuite Server side>

cons_key=<consumer key – obtain from the NetSuite Server side>

cons_secret=<consumer secret – obtain from the NetSuite Server side>


# Example of Functional/Interface section – GL


# NetSuite End point



# NetSuite Query

suiteql=SELECT * FROM TransactionAccountingLine

Step 2: Connect to NetSuite using Postman and derive the Python connection code snippet

Use postman to test the basic connectivity and authentication. The above-mentioned SuiteQL could be kept empty. Use any simple end-point URL. Once the connection is successful, from Postman request/response, download the Python code snippet related to the connection. Opt for the Python snippet that uses the “request” module.

Note: This code snippet will be a useful reference in Step 3.

Step 3: Write/Test the Python code

There are numerous ways to connect to NetSuite using Python. While this article will not go into all of the details, here are a few pointers to keep in mind while writing the Python code:

  1. The Python script should be able to read the above-mentioned netsuite.conf file.
  2. NetSuite usually uses HMAC SHA256, and hence the OAuth signature generation has to keep using SignatureMethod_HMAC_SHA256.
  3. Based on the script’s command-line argument, the Python script shall handle only one functional/interface section.

Step4: Configure NiFi

Configure NiFi to invoke the Python script using ExecuteStreamCommand Processor.

Depending on the type of NetSuite endpoint required, the corresponding section name can be invoked through a command-line argument from within the ExecuteStreamCommand Processor.

NiFi Adapter

As a best practice, it is recommended to use the JOLT Transformation processor after ExecuteStreamCommand to make future transformations much faster.

Relevant Blogs

Are you tracking the right revenue assurance metrics?

Are you tracking the right revenue assurance metrics?

Kiran Mohan, Marketing AssuranceRevenue Assurance systems are great to help us curb revenue leakage, build more predictability in our revenues and deliver great customer experiences. However, all these systems are of less use if we are not tracking the right metrics....