Creating Controller Services for your dataflow

You can add controller services that can provide shared services to be used by the processors in your dataflow. Create them after you build the NiFi dataflow and before you configure the processors, so that they are available when you configure your NiFi processors.

For this dataflow, create two controller services:
  • StandardOauth2AccessTokenProvider
  • JsonRecordSetWriter

For complete details about these Apache NiFi controller services, see NiFi Documentation.

You must have built your dataflow.

  1. To add a controller service to your flow, right-click on the canvas and select Configure from the pop-up menu.

    The Controller Services Configuration window appears.

  2. Select the Controller Services tab.
  3. Click the + button to display the Add Controller Service dialog.
  4. Select the required controller service and click Add.
  5. Click the Configure icon in the right-hand column and configure the necessary options.
  6. Click Apply to save the changes.
  7. Click the Enable button (flash) in the far-right column of the Controller Services tab to enable the controller service.

You require the following controller services for this example of a NiFi dataflow moving data out of Salesforce.


This controller service allows NiFi to interact with the Salesforce database. The Salesforce REST API authorization is handled by the OAuth2 Access Token Provider Service.

You configure the following properties:
  • Authorization Server URL
  • Username
  • Password
  • Client ID
  • Client secret

For more information about the properties, see StandardOauth2AccessTokenProvider configurations.


You use this controller service as the writer, when writing the data as JSON array or one JSON object per line in NiFi. You can choose another writer depending on your requirements.

In general, you may accept the default configurations.

After you have finished configuring your controller services:
  • Configure your source processor
  • Configure your target processor