The ServiceNow HubSpot integration synchronizes customer relationship management data between HubSpot's CRM platform and ServiceNow's IT service management environment. This integration solves critical business alignment challenges by ensuring customer information, deal progress, and support interactions are visible across both sales and IT operations teams. Organizations use this integration to create seamless handoffs between sales processes and service delivery workflows. The integration supports bi-directional data flows using HubSpot's REST API, with primary automation patterns including scheduled data synchronization and real-time webhook processing. Data flows are managed through ServiceNow's Integration Hub platform, utilizing Connection & Credential Aliases for authentication and the HubSpot spoke for standardized API operations.
Prerequisites
- •ServiceNow Quebec release or later with Integration Hub Professional license
- •HubSpot Professional or Enterprise account with API access enabled
- •ServiceNow admin role or integration_admin role for credential management
- •HubSpot super admin or app marketplace access for private app creation
- •Knowledge of ServiceNow Flow Designer and IntegrationHub concepts
- •Understanding of REST API fundamentals and JSON data structures
- •Access to ServiceNow Connection & Credentials application menu
Architecture Overview
The integration leverages ServiceNow's IntegrationHub HubSpot spoke, which provides pre-built Actions for common HubSpot operations including contact management, company synchronization, and deal processing. Authentication is established through OAuth 2.0 private app credentials stored securely in ServiceNow Connection & Credential Alias records, eliminating the need for hardcoded API keys in scripts. Data flows are primarily outbound from ServiceNow to HubSpot and inbound via scheduled synchronization jobs or real-time webhooks processed through Scripted REST APIs. A MID Server is not required since HubSpot's REST API endpoints are publicly accessible over HTTPS, but connection testing should verify firewall configurations allow outbound HTTPS traffic on port 443. Rate limiting considerations include HubSpot's standard API limits of 100 requests per 10 seconds for Professional accounts and 150 requests per 10 seconds for Enterprise accounts, requiring proper error handling and retry logic in Flow Designer actions.
Sourdough: ServiceNow Monitoring and Analytics
A Chrome extension for ServiceNow Admins and Developers with essential tools, analytics, graphs and monitoring features.
Free to install. Pro $5/month after a 14-day no-card trial.
Pro requires the ServiceNow admin role. Upgrade inside the extension.
Implementation Steps
Create HubSpot Private App and obtain API credentials
Navigate to your HubSpot account and go to Settings > Integrations > Private Apps, then click 'Create a private app'. Configure the app with a descriptive name like 'ServiceNow Integration' and grant the necessary scopes including crm.objects.contacts.read, crm.objects.contacts.write, crm.objects.companies.read, crm.objects.companies.write, and crm.objects.deals.read. Copy the generated Access Token immediately as it will only be displayed once. Ensure you also enable any webhook scopes if you plan to implement real-time data synchronization from HubSpot to ServiceNow.
Configure ServiceNow Connection and Credential records
Navigate to Connections & Credentials > Credentials in ServiceNow and create a new Basic Auth credential record with name 'HubSpot API Credential'. Set the User name field to 'token' and paste the HubSpot Access Token into the Password field. Next, navigate to Connections & Credentials > Connection Aliases and create a new record named 'HubSpot Connection' with Connection URL set to 'https://api.hubapi.com' and associate it with the credential record created above. Test the connection using the Test Connection button to verify authentication is working properly.
Install and configure the HubSpot IntegrationHub spoke
Navigate to System Applications > All Available Applications > All and search for 'HubSpot' to locate the official HubSpot spoke application. Install the spoke and verify it appears in the Flow Designer Action list under the HubSpot category. Configure the spoke's default connection by navigating to the HubSpot spoke configuration and associating it with the Connection Alias created in the previous step. Test the spoke functionality by creating a simple Flow with a HubSpot 'Get Contact' action to verify the authentication and connection are working correctly.
Create scheduled job for contact synchronization
Navigate to Process Automation > Flow Designer and create a new Flow named 'HubSpot Contact Sync' with a Schedule trigger set to run daily at midnight. Add a HubSpot 'Get All Contacts' action configured to retrieve contacts modified within the last 24 hours using the 'lastmodifieddate' filter. Follow this with a 'For Each' loop that processes each contact record and either creates or updates corresponding records in the Customer table (customer_account) using Create Record or Update Record actions. Include proper error handling using Try/Catch actions to log any synchronization failures to the Event Log for troubleshooting.
// Example data transformation script within Flow Designer
var contactData = fd_data.lookup('hubspot_contact');
var customerRecord = new GlideRecord('customer_account');
customerRecord.initialize();
customerRecord.name = contactData.properties.firstname + ' ' + contactData.properties.lastname;
customerRecord.email = contactData.properties.email;
customerRecord.phone = contactData.properties.phone;
customerRecord.u_hubspot_id = contactData.id;
customerRecord.insert();
fd_data.setValue('servicenow_customer_id', customerRecord.getUniqueValue());Implement incident creation from HubSpot deals
Create a new Flow named 'HubSpot Deal to Incident' with a Record trigger on a custom table that stores HubSpot deal data or use a Schedule trigger to periodically check for deals in specific stages. Configure a HubSpot 'Get Deals' action filtered for deals in 'closedwon' stage that require service implementation. Add logic to create Incident records automatically with appropriate categorization, assignment group, and priority based on deal properties like deal value and service type. Ensure the incident description includes relevant deal information and establishes a link between the CRM opportunity and the service delivery process through a custom reference field.
// Script to create incident from HubSpot deal data
var dealData = fd_data.lookup('hubspot_deal');
var incident = new GlideRecord('incident');
incident.initialize();
incident.short_description = 'Service implementation for deal: ' + dealData.properties.dealname;
incident.description = 'Customer: ' + dealData.properties.hs_deal_associated_company + '\nDeal Value: $' + dealData.properties.amount + '\nClose Date: ' + dealData.properties.closedate;
incident.category = 'Service Request';
incident.subcategory = 'Implementation';
incident.priority = dealData.properties.amount > 50000 ? '2' : '3';
incident.assignment_group = 'Implementation Team';
incident.u_hubspot_deal_id = dealData.id;
var incidentSysId = incident.insert();
fd_data.setValue('incident_number', incident.getDisplayValue('number'));Configure webhook endpoint for real-time HubSpot updates
Navigate to System Web Services > Scripted Web Services > Scripted REST APIs and create a new API named 'HubSpot Webhooks' with resource path '/hubspot/webhook'. Implement a POST method that accepts HubSpot webhook payloads and processes contact, company, or deal updates in real-time. Configure the webhook in HubSpot to point to your ServiceNow instance URL followed by '/api/now/hubspot/webhook' and set it to trigger on contact and deal property changes. Include proper authentication validation in the webhook handler to ensure requests are coming from HubSpot using the webhook signature verification process.
// Scripted REST API webhook handler
(function process(request, response) {
try {
var requestBody = request.body.data;
var objectType = requestBody.subscriptionType;
if (objectType === 'contact.propertyChange') {
var contactId = requestBody.objectId;
var gr = new GlideRecord('customer_account');
gr.addQuery('u_hubspot_id', contactId);
gr.query();
if (gr.next()) {
// Update existing customer record
gr.setValue('last_updated', new GlideDateTime());
gr.update();
}
}
response.setStatus(200);
response.setBody({"status": "success"});
} catch (e) {
gs.error('HubSpot webhook processing error: ' + e.message);
response.setStatus(500);
}
})(request, response);Set up company data synchronization workflow
Create a new Flow named 'HubSpot Company Sync' that retrieves company records from HubSpot and synchronizes them to ServiceNow's Customer table or a custom Company table. Use the HubSpot 'Get All Companies' action with appropriate filters to retrieve companies modified within a specific timeframe. Implement data mapping logic that handles company properties like name, domain, industry, employee count, and annual revenue, creating or updating corresponding ServiceNow records. Add relationship handling to ensure contacts are properly associated with their respective companies through reference fields and maintain data integrity across both systems.
// Company synchronization logic
var companyData = fd_data.lookup('hubspot_company');
var companyRecord = new GlideRecord('core_company');
companyRecord.addQuery('u_hubspot_id', companyData.id);
companyRecord.query();
if (!companyRecord.next()) {
companyRecord.initialize();
companyRecord.u_hubspot_id = companyData.id;
}
companyRecord.name = companyData.properties.name || '';
companyRecord.u_domain = companyData.properties.domain || '';
companyRecord.u_industry = companyData.properties.industry || '';
companyRecord.u_employee_count = companyData.properties.numberofemployees || 0;
companyRecord.u_annual_revenue = companyData.properties.annualrevenue || 0;
if (companyRecord.isNewRecord()) {
companyRecord.insert();
} else {
companyRecord.update();
}Test integration and implement monitoring
Execute comprehensive testing by manually triggering each Flow and verifying data synchronization in both directions between ServiceNow and HubSpot. Test the webhook endpoint using HubSpot's webhook testing tool or by making actual changes to test records in HubSpot and confirming they appear in ServiceNow Event Logs. Set up monitoring by creating Event Rules that alert administrators when integration Flows fail or when webhook processing encounters errors. Create a dashboard widget that displays integration health metrics including successful synchronizations, failed attempts, and API rate limit consumption to ensure ongoing operational visibility.
// Integration monitoring script
var integrationStatus = new GlideRecord('sys_flow_context');
integrationStatus.addQuery('flow.name', 'CONTAINS', 'HubSpot');
integrationStatus.addQuery('state', 'failed');
integrationStatus.addQuery('sys_created_on', '>=', gs.hoursAgoStart(24));
integrationStatus.query();
if (integrationStatus.getRowCount() > 5) {
gs.eventQueue('hubspot.integration.failure_threshold_exceeded', null,
'Integration failure count: ' + integrationStatus.getRowCount(),
gs.getUserID());
}
// Log successful sync counts for reporting
gs.log('HubSpot Integration Daily Summary: ' + integrationStatus.getRowCount() + ' failures in last 24 hours', 'HubSpotIntegration');Common Use Cases
Automated incident creation from closed deals
When a sales deal reaches 'closed-won' status in HubSpot, the integration automatically creates a corresponding incident or service request in ServiceNow for implementation teams. The incident inherits key deal properties including customer information, service requirements, timeline, and deal value to ensure proper prioritization and resource allocation. This eliminates manual handoff processes and reduces the time between sales closure and service delivery initiation. The integration maintains bidirectional references allowing service teams to update deal records with implementation progress and completion status.
Customer service ticket enrichment with CRM context
When customers submit service requests through ServiceNow's service portal, the integration automatically enriches ticket records with relevant HubSpot data including account history, previous purchases, support tier, and relationship details. Service agents gain immediate visibility into customer value, contract status, and interaction history without switching between systems. This context enables more personalized service delivery and helps agents prioritize requests based on customer lifetime value and support agreement terms. The integration also logs service interactions back to HubSpot contact timelines for comprehensive customer journey tracking.
Proactive outreach automation from service events
Critical incidents, major changes, or service disruptions in ServiceNow trigger automated creation of tasks and activities in HubSpot for account managers and customer success teams. The integration ensures customer-facing teams are immediately aware of technical issues affecting their accounts and can proactively communicate with customers. Task details include incident severity, estimated resolution time, and affected services, enabling informed customer conversations. This automation prevents customer surprise and maintains trust by ensuring consistent communication during service events.
Lead qualification through service interaction history
The integration synchronizes ServiceNow service interaction data to HubSpot contact and company records, providing sales teams with technical engagement context for lead qualification and opportunity development. Service usage patterns, support ticket volume, and technical satisfaction scores become available in HubSpot for lead scoring and account prioritization. Sales representatives can identify expansion opportunities based on service adoption patterns and technical requirements indicated through support interactions. This data-driven approach improves sales qualification accuracy and identifies the most promising upgrade or expansion prospects.
Customer health monitoring and renewal risk assessment
The integration creates comprehensive customer health dashboards by combining HubSpot relationship data with ServiceNow service metrics including incident frequency, resolution times, and satisfaction scores. Customer success teams receive automated alerts when service quality metrics indicate potential renewal risk or expansion opportunities. The system correlates support ticket trends with contract renewal dates to identify accounts requiring proactive attention. This integration enables data-driven customer success strategies and early intervention for at-risk renewals based on service delivery performance.
Troubleshooting
HTTP 401 Unauthorized errors when calling HubSpot API
First, verify the HubSpot private app access token is correctly stored in the ServiceNow Credential record and hasn't expired or been regenerated. Navigate to System Logs > Outbound HTTP Requests to examine the exact authorization header being sent and compare it with HubSpot's expected format. Check that the private app in HubSpot still has the necessary scopes enabled for the operations being performed. If the token appears correct, test the connection directly using a REST client to isolate whether the issue is with ServiceNow's request formatting or HubSpot's API response.
Flow execution fails with 'Rate limit exceeded' errors
Review the Flow Designer execution history to identify patterns in API call frequency and implement proper rate limiting controls using Wait actions between API calls. Configure retry logic in your Flows using the built-in error handling capabilities to automatically retry failed requests after appropriate delay periods. Monitor HubSpot's rate limit headers in the HTTP response logs to understand current usage levels and adjust batch sizes accordingly. Consider implementing a queue-based approach for high-volume synchronization operations to distribute API calls over longer time periods and stay within HubSpot's limits.
Webhook payloads received but ServiceNow records not updating
Enable debug logging for the Scripted REST API webhook handler and examine the System Logs > Application Logs for detailed payload processing information. Verify that the webhook signature validation is not preventing legitimate HubSpot requests from being processed by temporarily disabling signature checks during testing. Check the webhook payload format in HubSpot's webhook testing tool matches the expected structure in your ServiceNow handler code. Ensure the webhook processing logic includes proper error handling and logging to identify data mapping or record update failures that might be occurring silently.
Data synchronization creating duplicate records in ServiceNow
Review the query logic in your synchronization Flows to ensure proper use of unique identifiers like HubSpot record IDs for duplicate detection. Implement upsert logic that queries for existing records using the HubSpot ID before attempting to create new records. Add data validation rules to check for existing records based on multiple criteria such as email address or company domain when HubSpot IDs are missing. Consider implementing a staging table approach where HubSpot data is first imported to a temporary table, deduplicated, and then processed into final ServiceNow tables to prevent duplicate creation during high-volume synchronizations.
Slow performance during large-scale data synchronization
Optimize Flow Designer performance by implementing pagination in HubSpot API calls using the 'limit' and 'offset' parameters to process records in smaller batches. Replace individual record processing with bulk operations where possible, using GlideRecord batch processing techniques to reduce database transaction overhead. Implement incremental synchronization by storing last-sync timestamps and filtering HubSpot queries to only retrieve records modified since the last successful run. Consider running large synchronization jobs during off-peak hours and using MID Server clusters if processing large datasets that might impact instance performance.
Webhook endpoint returning 500 errors intermittently
Add comprehensive try-catch blocks around all webhook processing logic to prevent unhandled exceptions from causing 500 responses to HubSpot. Implement input validation to verify webhook payload structure before attempting to process data, returning appropriate 400 responses for malformed requests. Review the webhook handler code for potential null pointer exceptions or undefined property access that could cause intermittent failures based on varying payload contents. Enable detailed error logging and implement webhook retry logic in HubSpot to handle temporary processing failures while maintaining data synchronization reliability.
Pro Tips
- →Implement field-level change tracking by storing HubSpot property modification timestamps in ServiceNow custom fields, enabling sophisticated conflict resolution when the same record is modified in both systems simultaneously. Use GlideRecord's setWorkflow(false) method during bulk synchronization operations to prevent unnecessary business rule execution and improve performance by up to 60% during large data imports.
- →Configure HubSpot webhook subscriptions at the property level rather than object level to reduce unnecessary API calls and processing overhead, focusing only on the specific fields that require real-time synchronization to ServiceNow. Create custom Application Properties to store integration configuration values like batch sizes and sync intervals, making the integration more maintainable and tunable without code changes.
- →Leverage ServiceNow's Transform Maps for complex HubSpot data imports, especially when dealing with multi-select properties or custom field mappings that require data transformation. Set up automated data quality monitoring using ServiceNow's Data Quality Management features to identify and alert on synchronization anomalies like missing required fields or data format inconsistencies between systems.
- →Use ServiceNow's Connection & Credential testing capabilities to implement automated health checks for your HubSpot integration, creating scheduled jobs that verify API connectivity and credential validity before critical synchronization windows. Implement custom metrics collection in your Flow Designer actions to track integration performance and create operational dashboards showing sync success rates, processing times, and error patterns.
- →Create dedicated ServiceNow users with restricted roles specifically for HubSpot integration operations, improving security audit trails and allowing fine-grained permission control over which ServiceNow tables and fields can be modified by the integration. Use ServiceNow's Data Export functionality to create regular backups of synchronized data before implementing major integration changes, enabling quick rollback if synchronization logic errors corrupt production data.
- →Implement intelligent retry mechanisms using exponential backoff algorithms in your Flow Designer error handling to optimize recovery from temporary HubSpot API failures without overwhelming the service. Configure Connection Aliases with multiple endpoint URLs and implement automatic failover logic to handle HubSpot API regional outages or maintenance windows that could disrupt critical business processes.
Known Limitations
- —HubSpot's REST API enforces rate limits of 100 requests per 10 seconds for Professional accounts and 150 for Enterprise accounts, requiring careful batch sizing and potentially limiting real-time synchronization capabilities for high-transaction environments. The API also has daily limits of 250,000 requests for Professional and 500,000 for Enterprise accounts, which may constrain large-scale data synchronization operations.
- —ServiceNow's IntegrationHub HubSpot spoke actions have built-in timeouts of 30 seconds per API call, which may cause issues when processing large datasets or during HubSpot API performance degradation. Complex data transformations within Flow Designer can consume significant instance resources and may require MID Server deployment for high-volume processing scenarios.
- —HubSpot webhook deliveries are not guaranteed and do not include built-in retry mechanisms beyond the initial delivery attempt plus two retries, potentially causing data synchronization gaps during ServiceNow maintenance windows or network connectivity issues. Webhook payloads also have a maximum size limit of 1MB, which may truncate large contact or deal records with extensive custom properties or long text fields.
- —The integration cannot synchronize HubSpot file attachments or documents stored in deal or contact records to ServiceNow attachment tables due to API limitations, requiring separate file transfer mechanisms for complete record synchronization. Custom HubSpot properties created after the integration setup may not automatically appear in ServiceNow synchronization jobs without manual Flow Designer updates.
- —ServiceNow's Flow Designer has execution time limits that may prevent processing of very large HubSpot datasets in a single run, requiring batch processing approaches and potentially causing delays in data synchronization for organizations with extensive CRM databases. The IntegrationHub Professional license is required for the HubSpot spoke, adding licensing costs that may not be justified for smaller ServiceNow implementations with limited integration requirements.
Frequently Asked Questions
Can I synchronize custom fields from HubSpot to ServiceNow custom tables?
Yes, custom field synchronization is fully supported through Flow Designer data mapping and the HubSpot spoke's flexible property handling. You'll need to create corresponding custom fields in your ServiceNow tables and map them explicitly in your synchronization Flows using data transformation scripts. The HubSpot API returns all custom properties in the same response as standard properties, making them equally accessible for synchronization. Remember to handle data type conversions appropriately, especially for HubSpot's enumeration and multi-select properties that may need special formatting in ServiceNow.
How do I handle HubSpot deal stages that don't map directly to ServiceNow incident states?
Create a custom mapping table in ServiceNow that defines the relationship between HubSpot deal stages and appropriate ServiceNow record states or categories. Use this mapping table within your Flow Designer logic to dynamically determine the correct ServiceNow values based on incoming HubSpot data. Consider creating custom choice lists in ServiceNow that mirror your HubSpot deal stages if direct mapping isn't suitable for your business process. You can also implement conditional logic in Flow Designer that applies different processing rules based on deal stage, allowing for more sophisticated workflow automation that matches your organization's sales and service delivery processes.
Is it possible to create HubSpot contacts from ServiceNow customer records automatically?
Absolutely, bidirectional synchronization is achievable using ServiceNow Flow Designer with HubSpot spoke actions for contact creation and updates. Create a Flow triggered by customer record changes in ServiceNow that uses the HubSpot 'Create Contact' or 'Update Contact' actions to push data to HubSpot. Implement proper duplicate checking logic by querying HubSpot for existing contacts with matching email addresses before creating new records. Include error handling to manage cases where ServiceNow customer data doesn't meet HubSpot's validation requirements, and consider implementing a staging process for data quality verification before pushing records to HubSpot.
What happens if my ServiceNow instance is down when HubSpot sends webhook notifications?
HubSpot will attempt webhook delivery with automatic retries over a limited period, but extended ServiceNow downtime will result in lost webhook notifications that won't be automatically recovered. Implement a recovery mechanism using scheduled synchronization jobs that compare HubSpot record modification timestamps with your last successful sync to identify and process missed updates. Configure HubSpot webhooks with appropriate timeout values and consider implementing a queue-based system using ServiceNow's Event Management to buffer webhook processing during high-load periods. Monitor webhook delivery failures through HubSpot's webhook dashboard and set up alerting to notify administrators when delivery success rates drop below acceptable thresholds.
Can I use this integration with HubSpot's free tier account?
HubSpot's free tier has significant API limitations that may restrict the integration's functionality, including reduced rate limits and limited access to certain API endpoints required for comprehensive synchronization. The free tier allows basic contact and company management through the API, but advanced features like custom properties, deal management, and webhook subscriptions may require paid HubSpot plans. Evaluate your specific integration requirements against HubSpot's free tier API documentation to determine if the available functionality meets your needs. Consider that ServiceNow's IntegrationHub Professional license costs may exceed HubSpot paid plan costs, making a comprehensive evaluation of total ownership costs important for smaller implementations.
How do I monitor and troubleshoot integration performance issues?
ServiceNow provides comprehensive monitoring capabilities through Flow Designer execution history, System Logs, and the IntegrationHub dashboard that shows spoke usage and performance metrics. Create custom Event Rules that trigger alerts when HubSpot integration Flows fail or exceed normal execution times, and implement custom logging in your Flow actions to track processing volumes and timing. Use ServiceNow's Performance Analytics to create dashboards showing integration success rates, API response times, and data synchronization volumes over time. Set up proactive monitoring by creating synthetic transactions that test the integration periodically and alert when connectivity or authentication issues arise before they impact production operations.
Is there a way to sync HubSpot email communication history to ServiceNow?
While direct email content synchronization isn't supported through standard HubSpot API endpoints, you can synchronize email engagement metadata and communication summaries using HubSpot's Timeline API and Communications preferences endpoints. Create custom tables in ServiceNow to store communication history data and use Flow Designer to periodically retrieve and store email interaction records from HubSpot. Consider integrating with ServiceNow's Email client to create a unified communication view that combines HubSpot marketing emails with ServiceNow service communications. For complete email content access, you may need to explore HubSpot's Private App scopes for email access or implement additional integration points with your email system directly.
Test Your Knowledge
Quick 3-question quiz — see how your ServiceNow skills stack up.
A list view on a table with millions of records is slow. Best fix?
Select an answer to continue