Salesforce Listener
Salesforce Listener
- Updated on May 5, 2026
- Published on Sep 16, 2024
- 8 minute(s) read
With the Salesforce Listener Block, you can configure your flow to ingest files stored in Salesforce for processing within the Hyperscience application.
The Salesforce Listener Block is available in both SaaS and on-premise versions of the Hyperscience application.
Sample use cases
- Clients attach files to the records of specific objects in Salesforce. Hyperscience ingests all of these client files automatically for processing. You can then use these files to update client records using the Salesforce Notifier Block.
Block settings table
| Name | Required? | Description |
|---|---|---|
| Topic Name | Yes | The name of the topic you configured in Salesforce for the Salesforce Listener |
| Associated Username | Yes | The username associated with the Salesforce Connected App or External Client App |
| Consumer Key | Yes | The Consumer Key from the Salesforce Connected App or External Client App |
| Private Key | Yes | The key generated during the authentication-configuration process. The private key is a long string that begins with ----BEGIN PRIVATE KEY---- and ends with \n----END PRIVATE KEY----\n. Include both of these tags and all characters between them when entering the private key. |
| Sandbox Environment | Yes | Indicates whether the connected Salesforce instance is a sandbox environment |
Setting up Salesforce Listener
Setup within Salesforce
Install and set up Hyperscience Package
- Install the Hyperscience package in the desired Salesforce org.
- Go to the Salesforce AppExchange’s Hyperscience Platform listing.
- Click the Get It Now button.
- Enter your details and click the Contact Me button.
- A Hyperscience representative will contact you and provide you with the Hyperscience package.
- Once you have the Hyperscience package, install it in the desired Salesforce org.
- Add Hyperscience Permission Set to users that should have access to the Hyperscience application.
- Enable the Query All Files permission.
Configure authentication
The steps required to configure the authentication for the connection depend on whether you’re using a Salesforce Connected App or an External Client App. The External Client App offers improved security and packaging options compared to Connected Apps.
Salesforce Connected App
Generate private key
- Create the private key (
salesforce.key) and certificate (salesforce.crt) by running the following command:
openssl req -x509 -sha256 -nodes -days 36500 -newkey rsa:2048 -keyout salesforce.key -out salesforce.crt
- Copy the private key to your clipboard.
cat [private.key file] | sed 's/$/\n/' | tr -d '\n' | pbcopy
- Paste the private key into a text file and save it. Later, you will need to paste it into your Salesforce Listener Block within Hyperscience.
Create your JWT Connected App
- Log in to Salesforce and go to Setup.
- In the side navigation, go to Apps > App Manager and click New Connected App.
- Enter the information in the Basic Information section.
- In API (Enable OAuth Settings), complete the following steps:
- Select Enable OAuth Settings.
- In Callback URL, enter “http://localhost”.
- Select Use digital signatures, and upload the
salesforce.crtfile that was generated when you created your private key. - In Selected OAuth Scopes, add the following permissions:
- Manage user data via APIs (api)
- Perform requests at any time (refresh_token, offline_access)
- Click Save.
- On the resulting page, click Manage.
- Click Edit Policies.
- In the OAuth policies section, change Permitted Users to Admin approved users are pre-authorized.
- Click Save.
Create and link the Salesforce topic
- Create a Streaming Channel or choose an existing one that you will use. Note that channel names in Salesforce should start with
/u/. - Obtain the ID of the
streamingChannel. - Create a record of
Hyperscience__Channel_Object_Link__c.
Hyperscience__Channel_Object_Link__c channelObjectLink = new Hyperscience__Channel_Object_Link__c();
channelObjectLink.Hyperscience__Channel_Name__c = '/u/channelName';
channelObjectLink.Hyperscience__Channel_Id__c = 'channelId';
channelObjectLink.Hyperscience__Object_Api_Name__c = 'objectApiName';
insert channelObjectLink;
The above script creates a link between a Salesforce object and a Streaming channel.
After completing these steps, every time that a file is attached to a record of an object with API name objectApiName, a message will be published into the channel with the name /u/channelName and ID channelId.
Known limitations
- If you upload a file and then add it to an object, adding it a second time will not cause re-processing due to how Salesforce keeps track of new files. To re-process the file, upload the file again.