deployment-workflow
Skill40 starsChanged 4 months agoApache-2.0View on GitHub
Complete instance-to-instance deployment workflow including update set export, import, preview, conflict resolution, validation, and rollback procedures
In this repository184 other files it gives its agents.
- happy-platform-skillsSkill
- application-scopeSkill
- batch-operationsSkill
- configuration-validationSkill
- generic-crud-operationsSkill
- instance-managementSkill
- schema-discoverySkill
- script-executionSkill
- script-syncSkill
- smart-assessmentSkill
- task-analysisSkill
- task-summarizationSkill
- update-set-managementSkill
- user-provisioningSkill
- workflow-creationSkill
- workspace-insightsSkill
- approval-summarizationSkill
- approval-workflowsSkill
- catalog-builder-aiSkill
- catalog-item-generationSkill
- item-creationSkill
- multi-turn-orderingSkill
- request-fulfillmentSkill
- ui-policiesSkill
- variable-managementSkill
- ci-discoverySkill
- cmdb-search-analysisSkill
- data-qualitySkill
- impact-analysisSkill
- relationship-mappingSkill
- service-graph-diagnosisSkill
- activity-responseSkill
- csm-case-summarizationSkill
- chat-recommendationSkill
- email-recommendationSkill
- csm-kb-generationSkill
- resolution-notesSkill
- csm-sentiment-analysisSkill
- csm-sidebar-summarizationSkill
- csm-suggested-stepsSkill
- trending-topicsSkill
- automated-testingSkill
- business-rulesSkill
- client-scriptsSkill
- code-assistSkill
- code-reviewSkill
- data-importSkill
- debugging-techniquesSkill
- fluent-sdkSkill
- glide-api-referenceSkill
- mcp-server-installationSkill
- mcp-serverSkill
- notificationsSkill
- performance-optimizationSkill
- scheduled-jobsSkill
- scripted-rest-apisSkill
- script-includesSkill
- servicenow-docs-mcpSkill
- test-generationSkill
- ui-actionsSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. About 0 are common, 19 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 39
Update set export and import processes
- Distinctive: line 44
When to use: When promoting configuration changes through the SDLC pipeline or migrating customizations between ServiceNow instances.
- Distinctive: line 76
Before deployment, thoroughly review what will be deployed.
- Distinctive: line 107
Check for common deployment issues.
- Distinctive: line 174
Ensure update set is marked complete before export.
- Distinctive: line 189
Create a backup clone before deployment.
- Distinctive: line 209
If instances are connected:
- Distinctive: line 230
Import Update Set from XML
- Distinctive: line 271
Wait for preview to complete
- Distinctive: line 357
Before committing, verify all conflicts are resolved.
- Distinctive: line 369
If count > 0, resolve all problems before proceeding.
- Distinctive: line 375
Verify state is "Previewed" and no unresolved conflicts
- Distinctive: line 507
If you created a backup clone:
- Distinctive: line 572
Always Preview First: Never commit without previewing
- Distinctive: line 576
Deploy in Order: Follow DEV → TEST → PROD pipeline strictly
- Distinctive: line 604
Use Data Preservers for data records
- Distinctive: line 612
Check for unnecessary queries in loops
- Distinctive: line 613
Add proper indexing for new fields
- Distinctive: line 614
Consider rollback if severe
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Deployment Workflow
Overview
This skill provides a complete framework for deploying ServiceNow configurations between instances (Dev → Test → Prod). It covers the entire deployment lifecycle:
- Pre-deployment validation and preparation
- Update set export and import processes
- Preview and conflict resolution strategies
- Post-deployment validation
- Rollback procedures for failed deployments
When to use: When promoting configuration changes through the SDLC pipeline or migrating customizations between ServiceNow instances.
Who should use this: Administrators, DevOps engineers, and developers responsible for ServiceNow deployments.
Prerequisites
- Roles:
adminorupdate_set_adminon both source and target instances - Access: sys_update_set, sys_update_xml, sys_remote_update_set tables
- Environment: Properly configured instance connections (for automated retrieval)
- Related Skills:
admin/update-set-managementshould be completed first
Deployment Pipeline Overview
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ DEV │────►│ TEST │────►│ PROD │
│ (develop) │ │ (validate) │ │ (release) │
└─────────────┘ └─────────────┘ └─────────────┘
│ │ │
▼ ▼ ▼
Create Preview Preview
Update Set & Test & Commit
Complete Commit Validate
Export ValidateProcedure
Phase 1: Pre-Deployment Validation
Step 1.1: Inspect Update Set Contents
Before deployment, thoroughly review what will be deployed.
Using MCP:
Tool: SN-Inspect-Update-Set
Parameters:
update_set_sys_id: [your_update_set_sys_id]
instance: devDetailed Content Query:
Tool: SN-Query-Table
Parameters:
table_name: sys_update_xml
query: update_set=[update_set_sys_id]
fields: name,type,target_name,action,sys_created_on,sys_created_by
limit: 500
instance: devExpected Output Categories:
| Type | Count | Description |
| sys_script | 5 | Business Rules |
| sys_ui_policy | 3 | UI Policies |
| sys_script_include | 2 | Script Includes |
| sys_ui_action | 1 | UI Actions |
Step 1.2: Validate Configuration Quality
Check for common deployment issues.
Script Validation:
Tool: SN-Execute-Background-Script
Parameters:
script: |
var updateSetId = '[update_set_sys_id]';
var issues = [];
// Check for hardcoded sys_ids (potential issue)
var gr = new GlideRecord('sys_update_xml');
gr.addQuery('update_set', updateSetId);
gr.addQuery('payload', 'CONTAINS', 'sys_id');
gr.query();
while (gr.next()) {
if (gr.payload.indexOf("'32") > -1 || gr.payload.indexOf('"32') > -1) {
issues.push('Potential hardcoded sys_id in: ' + gr.name);
}
}
// Check for instance-specific URLs
var gr2 = new GlideRecord('sys_update_xml');
gr2.addQuery('update_set', updateSetId);
gr2.addQuery('payload', 'CONTAINS', '.service-now.com');
gr2.query();
if (gr2.getRowCount() > 0) {
issues.push('WARNING: ' + gr2.getRowCount() + ' records contain instance-specific URLs');
}
gs.info('Validation Issues: ' + JSON.stringify(issues));
description: Pre-deployment validation check
instance: devStep 1.3: Document Dependencies
Identify and document update set dependencies.
Check for Related Update Sets:
Tool: SN-Query-Table
Parameters:
table_name: sys_update_set
query: parent=[update_set_sys_id]^ORbase_update_set=[update_set_sys_id]
fields: name,sys_id,state,description
instance: devDependency Documentation Template:
UPDATE SET: PROJ123-FEAT-CustomerPortal-v1
DEPENDS ON:
1. PROJ123-BASE-TableSchema-v1 (must be deployed first)
2. PROJ123-DATA-ReferenceData-v1 (required reference data)
CONFLICTS WITH:
- None identified
NOTES:
- Requires system property: com.glide.custom.portal.enabled=truePhase 2: Export Update Set
Step 2.1: Complete the Update Set
Ensure update set is marked complete before export.
Using MCP:
Tool: SN-Update-Record
Parameters:
table_name: sys_update_set
sys_id: [update_set_sys_id]
data:
state: complete
instance: devStep 2.2: Clone for Backup (Recommended)
Create a backup clone before deployment.
Using MCP:
Tool: SN-Clone-Update-Set
Parameters:
source_update_set_sys_id: [update_set_sys_id]
new_name: "PROJ123-FEAT-CustomerPortal-v1-BACKUP-20260206"
instance: devStep 2.3: Export Options
Option A: XML Export (Manual)
- Navigate to System Update Sets → Local Update Sets
- Open the update set
- Related Links → Export to XML
- Save the XML file
Option B: Automated Remote Instance Retrieval If instances are connected:
Tool: SN-Execute-Background-Script
Parameters:
script: |
var source = new GlideRecord('sys_update_set_source');
source.get('name', 'Development Instance');
var updateSet = '[update_set_name]';
// Trigger retrieval via update set source
gs.info('Retrieval must be initiated from target instance UI');
description: Check update set source configuration
instance: testPhase 3: Import to Target Instance
Step 3.1: Import Update Set
Option A: XML Import (Manual)
- On target instance: System Update Sets → Retrieved Update Sets
- Import Update Set from XML
- Select the exported XML file
- Click Upload
Option B: Remote Retrieval (Connected Instances)
- On target instance: System Update Sets → Update Sources
- Select the source instance
- Click Retrieve Update Sets
- Select the update set to retrieve
Step 3.2: Verify Import Success
Check Retrieved Update Set:
Tool: SN-Query-Table
Parameters:
table_name: sys_remote_update_set
query: name=[update_set_name]
fields: name,state,remote_sys_id,description,collision_count
instance: testStates:
| State | Meaning |
| Loaded | Ready for preview |
| Previewing | Preview in progress |
| Previewed | Ready for commit |
| Committing | Commit in progress |
| Committed | Successfully applied |
| Error | Failed - check logs |
Phase 4: Preview and Conflict Resolution
Step 4.1: Preview Update Set
Preview identifies potential conflicts before committing.
Initiate Preview (Manual):
- Open the retrieved update set
- Click "Preview Update Set"
- Wait for preview to complete
Check Preview Status:
Tool: SN-Query-Table
Parameters:
table_name: sys_remote_update_set
query: name=[update_set_name]
fields: name,state,collision_count,error_count
instance: testStep 4.2: Analyze Conflicts
Query Preview Problems:
Tool: SN-Query-Table
Parameters:
table_name: sys_update_preview_problem
query: remote_update_set=[remote_update_set_sys_id]
fields: description,type,status,disposition
limit: 100
instance: testConflict Types and Resolution:
| Type | Description | Resolution |
| Collision | Same record modified in target | Choose which version to keep |
| Missing Reference | Referenced record doesn't exist | Create dependency or skip |
| Validation Error | Script/config validation failed | Fix source and re-export |
| Permission Issue | Insufficient rights to modify | Grant necessary permissions |
Step 4.3: Resolve Conflicts
For Collisions - Accept Remote (Source Wins):
Tool: SN-Update-Record
Parameters:
table_name: sys_update_preview_problem
sys_id: [problem_sys_id]
data:
disposition: Accept remote update
instance: testFor Collisions - Skip (Target Wins):
Tool: SN-Update-Record
Parameters:
table_name: sys_update_preview_problem
sys_id: [problem_sys_id]
data:
disposition: Skip remote update
instance: testBulk Resolution Script:
Tool: SN-Execute-Background-Script
Parameters:
script: |
var remoteSetId = '[remote_update_set_sys_id]';
// Accept all remote updates (source wins for all)
var gr = new GlideRecord('sys_update_preview_problem');
gr.addQuery('remote_update_set', remoteSetId);
gr.addQuery('disposition', ''); // Unresolved only
gr.query();
var count = 0;
while (gr.next()) {
gr.disposition = 'Accept remote update';
gr.update();
count++;
}
gs.info('Resolved ' + count + ' conflicts by accepting remote updates');
description: Bulk resolve conflicts - accept remote
instance: testPhase 5: Commit Update Set
Step 5.1: Final Validation
Before committing, verify all conflicts are resolved.
Check for Unresolved Problems:
Tool: SN-Query-Table
Parameters:
table_name: sys_update_preview_problem
query: remote_update_set=[remote_update_set_sys_id]^dispositionISEMPTY
fields: description,type
instance: testIf count > 0, resolve all problems before proceeding.
Step 5.2: Commit the Update Set
Commit (Manual):
- Open the retrieved update set
- Verify state is "Previewed" and no unresolved conflicts
- Click "Commit Update Set"
- Monitor progress
Verify Commit Success:
Tool: SN-Query-Table
Parameters:
table_name: sys_remote_update_set
query: name=[update_set_name]
fields: name,state,committed_on,committed_by
instance: testExpected state: "Committed"
Phase 6: Post-Deployment Validation
Step 6.1: Verify Deployed Records
Check Committed Changes:
Tool: SN-Query-Table
Parameters:
table_name: sys_update_version
query: source_update_set=[remote_update_set_sys_id]
fields: name,type,state,action
limit: 100
instance: testStep 6.2: Functional Testing
Create Test Checklist:
Tool: SN-Create-Record
Parameters:
table_name: sys_user_task
data:
short_description: "Post-Deployment Testing: [update_set_name]"
description: |
Deployment Validation Checklist:
[ ] Business Rules execute correctly
[ ] UI Policies display/hide fields correctly
[ ] ACLs enforce proper access
[ ] Forms render without errors
[ ] Scripts run without errors
[ ] Integration points functional
[ ] No console errors in browser
assigned_to: [tester_sys_id]
priority: 2
instance: testStep 6.3: Monitor System Logs
Check for Errors After Deployment:
Tool: SN-Query-Table
Parameters:
table_name: syslog
query: level=2^sys_created_on>javascript:gs.hoursAgo(1)
fields: message,source,sys_created_on
limit: 50
instance: testPhase 7: Rollback Procedures
Step 7.1: When to Rollback
Rollback Indicators:
- Critical functionality broken
- System performance degraded
- Unexpected errors in logs
- Business process failures
Step 7.2: Immediate Rollback Options
Option A: Back Out Individual Records
Tool: SN-Execute-Background-Script
Parameters:
script: |
var remoteSetId = '[remote_update_set_sys_id]';
// Get all versions from this update set
var gr = new GlideRecord('sys_update_version');
gr.addQuery('source_update_set', remoteSetId);
gr.query();
gs.info('Found ' + gr.getRowCount() + ' records to potentially back out');
// List records for review
while (gr.next()) {
gs.info('Record: ' + gr.name + ' | Type: ' + gr.type + ' | Action: ' + gr.action);
}
description: List records from committed update set for rollback planning
instance: testOption B: Revert to Previous Version
For individual records, use sys_update_version to restore:
Tool: SN-Execute-Background-Script
Parameters:
script: |
var recordSysId = '[record_to_revert_sys_id]';
var tableName = '[table_name]';
// Find previous version
var version = new GlideRecord('sys_update_version');
version.addQuery('name', tableName + '_' + recordSysId);
version.orderByDesc('sys_recorded_at');
version.setLimit(2); // Current and previous
version.query();
version.next(); // Skip current
if (version.next()) {
gs.info('Previous version found from: ' + version.sys_recorded_at);
// Restore would require loading the payload
} else {
gs.info('No previous version found');
}
description: Find previous version for rollback
instance: testOption C: Full Rollback via Backup Clone
If you created a backup clone:
- Deploy the backup update set
- Conflicts will restore previous versions
Step 7.3: Document Rollback
Tool: SN-Create-Record
Parameters:
table_name: sys_update_set
data:
name: "ROLLBACK-PROJ123-FEAT-CustomerPortal-v1-20260206"
description: |
ROLLBACK RECORD
Original Update Set: PROJ123-FEAT-CustomerPortal-v1
Deployed: 2026-02-06 14:00 UTC
Rolled Back: 2026-02-06 16:30 UTC
Reason: [Document the failure reason]
Records Affected:
- [List affected records]
Resolution:
- [Document fix approach]
state: complete
instance: testDeployment Checklist
Pre-Deployment
- Update set reviewed and contents validated
- No hardcoded sys_ids or instance URLs
- Dependencies identified and documented
- Backup clone created
- Change request approved (if required)
During Deployment
- Update set imported successfully
- Preview completed without errors
- All conflicts reviewed and resolved
- Commit completed successfully
Post-Deployment
- All records committed verified
- Functional testing completed
- No new errors in system logs
- Stakeholders notified of deployment
- Documentation updated
Tool Usage Summary
| Operation | MCP Tool | Purpose |
| Inspect | SN-Inspect-Update-Set | Review update set contents |
| Clone | SN-Clone-Update-Set | Create backup before deployment |
| Move Records | SN-Move-Records-To-Update-Set | Fix records in wrong set |
| Query | SN-Query-Table | Check states and conflicts |
| Update | SN-Update-Record | Resolve conflicts, update states |
| Script | SN-Execute-Background-Script | Complex validation and rollback |
Best Practices
- Always Preview First: Never commit without previewing
- Create Backups: Clone update sets before major deployments
- Document Everything: Record all decisions and conflict resolutions
- Test Thoroughly: Complete functional testing in each environment
- Deploy in Order: Follow DEV → TEST → PROD pipeline strictly
- Schedule Wisely: Deploy during low-usage periods
- Have a Rollback Plan: Know how to revert before deploying
- Notify Stakeholders: Communicate deployment windows and status
Troubleshooting
Preview Hangs or Times Out
Cause: Large update set or complex dependencies Solution:
- Split update set into smaller pieces
- Increase system job timeout
- Schedule preview during off-hours
Commit Fails with Errors
Cause: Validation errors in scripts or missing dependencies Solution:
- Review error messages in logs
- Fix issues in source instance
- Re-export and re-import update set
Missing References After Commit
Cause: Referenced records not included in update set Solution:
- Export missing records in separate update set
- Use Data Preservers for data records
- Deploy dependency update set first
Performance Degradation After Deployment
Cause: Inefficient scripts or queries in deployed code Solution:
- Review business rules and script includes
- Check for unnecessary queries in loops
- Add proper indexing for new fields
- Consider rollback if severe
Related Skills
admin/update-set-management- Creating and managing update setsadmin/batch-operations- Bulk record operations for deploymentadmin/script-execution- Background script execution for validationitsm/change-management- Change process for production deployments
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

