Set up a bidirectional webhook
- UpdatedJan 30, 2025
- 2 minutes to read
- Yokohama
- Now Platform Capabilities
Configure a webhook to subscribe to Salesforce events with a ServiceNow callback URL.
Before you begin
- Role required: admin
Procedure
- Log in as an administrator to your Salesforce instance.
-
Obtain the Salesforce instance details.
For more information, see the View instance information for your Salesforce Organization knowledge article in Salesforce Trailblazer forum.
- If you don't have Salesforce custom domains, obtain the Salesforce instance name from the Company Information page.
-
If you have custom domains, navigate to Domain Management > My Domain and copy the domain name.
For example, if the complete domain name on the page is newdomain-customdomain.my.salesforce.com, copy and record the value newdomain-customdomain.
-
Obtain the 18-digit Organization ID of your Salesforce instance.
-
Navigate to the Developer Console in your Salesforce instance and run this query:
Select Id from Organization
- Copy and record the value of the 18-digit Organization ID.
-
Navigate to the Developer Console in your Salesforce instance and run this query:
- Log in to your ServiceNow instance.
-
Create a webhook registry.
- Navigate to Salesforce Webhook Registry > Salesforce Webhook Registries.
- Click New.
-
On the form, fill these values:
Field Description Organization ID 18-digit Organization ID of your Salesforce instance. Instance Name Name of the Salesforce instance obtained from the Company Information page or custom domain of the Salesforce instance obtained from Domain Management > My Domain. - Right-click the form header and click Save.
-
Obtain the resource path from your ServiceNow
instance.
- Navigate to System Web Services > Scripted Web Services > Scripted REST APIs.
- Open the record, Salesforce Webhook Callbacks.
- In the Resources tab, click the Default Callback record.
-
Copy and record the value of Resource
path.
The required ServiceNow endpoint URL is: https://<intance-name>.service-now.com/<resource-path>
-
Configure the default subflows or create customsubflows.
These subflows are triggered when the required events occur in Salesforce instance. For more information, see Building subflows.
-
Configure the webhook routing policy.
- Navigate to System Definition > Decision Tables.
- Open the record, Salesforce Decision Webhook Policy.
- In the Decisions tab, click New.
-
On the form, fill these values:
Field Description Label Unique label to identify the routing policy. Answer Subflow that must be triggered when the specified conditions are met. Default Answer Option to specify if this is the default answer. Condition Conditions to be met when the required events occur in Salesforce. Note: By default, these Salesforce objects are supported in the webhook routing policies:- Account
- Case
- Contract
- Opportunity
- Click Save.
-
From your Salesforce instance, create outbound message.
For information about creating the outbound message, see Outbound Message Actions in Salesforce Trailblazer forum.
- In the Endpoint URL, enter the endpoint URL in this format: https://<intance-name>.service-now.com/<resource-path>.