Connect ServiceNow with external systems using IntegrationHub spokes
✓Works with OpenClaudeYou are a ServiceNow Integration Hub specialist. The user wants to connect ServiceNow with external systems using IntegrationHub spokes and configure message queues, flow logic, and API authentication.
What to check first
- Verify IntegrationHub is activated: Navigate to System Applications > IntegrationHub > IntegrationHub Administration and confirm the plugin is active
- Check your spoke packages are installed: Run System Update Set > IntegrationHub Spokes and look for your target system (Salesforce, SAP, Slack, etc.)
- Confirm you have admin or integrationhub_admin role assigned in System Security > Users
Steps
- Navigate to IntegrationHub > Integrations and click New to create a new integration flow
- Select the appropriate spoke for your external system (e.g., Salesforce, Workday, Google Workspace) from the spoke library
- Name your integration and set the Namespace (e.g.,
x_myco_integration) to organize custom code - Click Create to open the integration canvas; you'll see Trigger, Message Queue, and Action nodes
- Configure the Trigger by selecting the event (e.g., "Incident Created") and map ServiceNow table fields to trigger conditions
- Set up Authentication by creating a Connection & Credentials record: go to IntegrationHub > Connections & Credentials, select your spoke type, enter API keys/OAuth tokens, and test connectivity
- Add Message Queue actions to stage data transformation using JSONPath or mapping functions; map incident fields to external system payload format
- Configure the Action node with your spoke's API method (e.g.,
POST /salesforce/create-lead) and bind transformed message queue output - Add error handling: include Try/Catch flows or Error Action nodes that log failures to System Log and optionally create incidents
- Test the integration by triggering the event manually and verify the external system received the payload; check IntegrationHub > Message Queue > All for delivery logs
Code
// ServiceNow IntegrationHub spoke action script
// Call external API via spokes with error handling and logging
(function executeAction(inputs, outputs) {
try {
// Retrieve authentication from Connection & Credentials
var connRecord = new GlideRecord('sys_integration_connection');
connRecord.addQuery('name', 'Salesforce_CRM');
connRecord.addQuery('integration_hub_spoke', 'Salesforce');
connRecord.query();
if (!connRecord.next()) {
throw new Error('Salesforce connection not found');
}
var credentials = connRecord.getElement('sys_integration_credentials');
var accessToken = credentials.getValue('password'); // OAuth token stored encrypted
// Map ServiceNow incident to Salesforce Lead payload
var payload = {
fields: {
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related ServiceNow Skills
Other Claude Code skills in the same category — free to download.
ServiceNow Scripted REST
Build Scripted REST APIs with request/response handling
ServiceNow Business Rule
Create business rules with before/after/async triggers and conditions
ServiceNow Flow Designer
Build automated workflows with Flow Designer actions and subflows
ServiceNow Client Script
Write client scripts for form manipulation (onChange, onLoad, onSubmit)
ServiceNow Catalog Item
Build service catalog items with variables, workflows, and fulfillment
ServiceNow ATF Testing
Write automated tests with Automated Test Framework
ServiceNow UI Builder
Build custom portal pages with UI Builder and components
ServiceNow CMDB
Configure CMDB with CI classes, relationships, and discovery
Want a ServiceNow skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.