{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":21600,"path":"integrate-applications/integration-hub/setup-webhook-salesforce.md","title":"Set up a bidirectional webhook","bundle":null,"doc_type":null,"release":"australia","body":"\n# Set up a bidirectional webhook\n\nConfigure a webhook to subscribe to Salesforce events with a ServiceNow callback URL.\n\n## Before you begin\n\n-   Role required: admin\n\n## Procedure\n\n1.  Log in as an administrator to your Salesforce instance.\n\n2.  Obtain the Salesforce instance details.\n\n    For more information, see the [View instance information for your Salesforce Organization](https://help.salesforce.com/articleView?id=000322728&language=en_US&type=1&mode=1) knowledge article in [Salesforce Trailblazer forum](https://success.salesforce.com/).\n\n    1.  If you don't have Salesforce custom domains, obtain the Salesforce instance name from the Company Information page.\n\n    2.  If you have custom domains, navigate to **Domain Management** &gt; **My Domain** and copy the domain name.\n\n        For example, if the complete domain name on the page is **newdomain-customdomain.my.salesforce.com**, copy and record the value `newdomain-customdomain`.\n\n3.  Obtain the 18-digit Organization ID of your Salesforce instance.\n\n    1.  Navigate to the Developer Console in your Salesforce instance and run this query:\n\n        ```\n        Select Id from Organization\n        ```\n\n    2.  Copy and record the value of the 18-digit Organization ID.\n\n4.  Log in to your ServiceNow instance.\n\n5.  Create a webhook registry.\n\n    1.  Navigate to **Salesforce Webhook Registry** &gt; **Salesforce Webhook Registries**.\n\n    2.  Click **New**.\n\n    3.  On the form, fill these values:\n\n        |Field|Description|\n        |-----|-----------|\n        |Organization ID|18-digit Organization ID of your Salesforce instance.|\n        |Instance Name|Name of the Salesforce instance obtained from the Company Information page or custom domain of the Salesforce instance obtained from **Domain Management** &gt; **My Domain**.|\n\n    4.  Right-click the form header and click **Save**.\n\n6.  Obtain the resource path from your ServiceNow instance.\n\n    1.  Navigate to **System Web Services** &gt; **Scripted Web Services** &gt; **Scripted REST APIs**.\n\n    2.  Open the record, **Salesforce Webhook Callbacks**.\n\n    3.  In the **Resources** tab, click the **Default Callback** record.\n\n    4.  Copy and record the value of **Resource path**.\n\n        The required ServiceNow endpoint URL is: `https://<intance-name>.service-now.com/<resource-path>`\n\n7.  Configure the default subflows or create customsubflows.\n\n    These subflows are triggered when the required events occur in Salesforce instance. For more information, see [Building subflows](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/subflows.md).\n\n8.  Configure the webhook routing policy.\n\n    1.  Navigate to **System Definition** &gt; **Decision Tables**.\n\n    2.  Open the record, **Salesforce Decision Webhook Policy**.\n\n    3.  In the **Decisions** tab, click **New**.\n\n    4.  On the form, fill these values:\n\n        |Field|Description|\n        |-----|-----------|\n        |Label|Unique label to identify the routing policy.|\n        |Answer|Subflow that must be triggered when the specified conditions are met.|\n        |Default Answer|Option to specify if this is the default answer.|\n        |Condition|Conditions to be met when the required events occur in Salesforce.|\n\n        **Note:** By default, these Salesforce objects are supported in the webhook routing policies:\n\n        -   Account\n        -   Case\n        -   Contract\n        -   Opportunity\n        You can configure the default decision table to support other Salesforce objects as per your requirement.\n\n    5.  Click **Save**.\n\n9.  From your Salesforce instance, create outbound message.\n\n    For information about creating the outbound message, see [Outbound Message Actions](https://help.salesforce.com/articleView?id=workflow_managing_outbound_messages.htm&type=5) in [Salesforce Trailblazer forum](https://success.salesforce.com/).\n\n10. In the Endpoint URL, enter the endpoint URL in this format: https://&lt;intance-name&gt;.service-now.com/&lt;resource-path&gt;.\n\n\n"}}