Version loading...

Snow-Flow Documentation

Snow-Flow is an open-source, autonomous ServiceNow development platform. Use your approved AI models (Claude, GPT, DeepSeek, or local models) to build ServiceNow solutions through natural conversation in your terminal.

Installation

Requirements

  • Node.js 18+ - Required runtime
  • npm 8.0+ - Package manager
  • ServiceNow instance - With OAuth configured
  • LLM provider - API key or local Ollama

Install via npm

bash
# Global installation (recommended)
npm install -g snow-flow

# Verify installation
snow-flow --version
Tip

For the best experience, we recommend using Snow-Flow with snow-code - our AI-powered terminal interface based on Claude Code.

Quick Start

1. Initialize Project

bash
# Initialize Snow-Flow in your project
snow-flow init

# This creates:
# - .mcp.json (MCP server configuration)
# - CLAUDE.md (AI agent instructions)

2. Authenticate

bash
# Login to ServiceNow and configure LLM provider
snow-flow auth login

# Check authentication status
snow-flow auth status

3. Start Building

bash
# Run an autonomous task
snow-flow agent "Create a widget showing high-priority incidents"

# Query data
snow-flow agent "Show me all incidents from last week"

# Create automation
snow-flow agent "Create a business rule for auto-assignment"

Authentication Overview

Snow-Flow uses OAuth 2.0 for secure ServiceNow authentication. Credentials are stored securely and automatically refreshed.

Authentication Priority

Snow-Flow checks credentials in this order:

  1. Environment variables - Highest priority
  2. auth.json - Auto-loaded from snow-code
  3. .mcp.json credentials - Project-specific
  4. Interactive login - Prompts if none found

ServiceNow OAuth Setup

Create an OAuth application in your ServiceNow instance:

  1. Navigate to System OAuth → Application Registry
  2. Click New → Create an OAuth API endpoint for external clients
  3. Configure:
    • Name: Snow-Flow
    • Redirect URL: http://localhost:3005/callback
    • Refresh Token Lifespan: 0 (unlimited)
  4. Copy the Client ID and Client Secret
Security Note

Never commit OAuth credentials to version control. Use environment variables or the secure credential storage.

Credential Storage

Snow-Flow stores credentials securely at:

path
~/.local/share/snow-code/auth.json

This file is:

  • Created automatically by snow-flow auth login
  • Contains encrypted OAuth tokens
  • Tokens are automatically refreshed
  • Never synced to cloud or version control

Environment Variables (Alternative)

bash
# ServiceNow credentials
SERVICENOW_INSTANCE_URL=https://your-instance.service-now.com
SERVICENOW_CLIENT_ID=your-client-id
SERVICENOW_CLIENT_SECRET=your-client-secret

# Optional: Pre-configured refresh token
SERVICENOW_REFRESH_TOKEN=your-refresh-token

LLM Providers

Snow-Flow supports 75+ AI providers via Models.dev. Configure via environment variables:

Provider Environment Variable Notes
Claude (Anthropic) ANTHROPIC_API_KEY Recommended
GPT-4 (OpenAI) OPENAI_API_KEY
Gemini (Google) GOOGLE_API_KEY
DeepSeek DEEPSEEK_API_KEY
Ollama (Local) OLLAMA_BASE_URL 100% Free, runs locally

Using Ollama (Free, Local)

bash
# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh

# Pull a model
ollama pull llama3.3

# Configure Snow-Flow
DEFAULT_LLM_PROVIDER=ollama
OLLAMA_BASE_URL=http://localhost:11434
DEFAULT_OLLAMA_MODEL=llama3.3
All Supported Models

For the complete list of 75+ supported AI providers and models, visit models.dev. Snow-Flow uses their unified API to support Claude, GPT, Gemini, DeepSeek, Mistral, Llama, and many more.

CLI Commands

Command Description
snow-flow init Initialize project with config files
snow-flow auth login Authenticate with ServiceNow & LLM provider
snow-flow auth status Check authentication status
snow-flow agent "task" Execute any ServiceNow task autonomously
snow-flow status Show system status
snow-flow monitor Real-time monitoring dashboard

Auth Commands

bash
# Full interactive login
snow-flow auth login

# Check current authentication
snow-flow auth status

# Logout and clear credentials
snow-flow auth logout

# Refresh OAuth token manually
snow-flow auth refresh

Agent Mode

Agent mode enables autonomous, multi-agent task execution:

bash
# Create a widget
snow-flow agent "Create a dashboard widget for incident metrics"

# Automate a process
snow-flow agent "Create business rule to auto-assign incidents by category"

# Query and analyze
snow-flow agent "Analyze incident trends from the past month"

# Complex task with multiple agents
snow-flow agent "Build a complete workspace for IT support"
Automatic Update Sets

Agent mode automatically creates isolated update sets for each task, ensuring clean deployments and easy rollbacks.

MCP Tools Overview

Snow-Flow provides 385+ MCP tools across 80 functional domains, all accessible through natural language commands via the unified MCP architecture.

385+ Tools
Comprehensive coverage of all ServiceNow capabilities in one unified server.
80 Domains
From incident management to UI Builder, CMDB to ML analytics.
Single OAuth
One authentication flow for all tools, no duplication.
Auto-Discovery
Tools automatically discovered and loaded on-demand.

Complete Tool Reference

All tools follow the snow_* naming convention. Below is the complete list organized by domain.

Operations (24 tools)

Core CRUD operations and data management.

ToolDescription
snow_query_tableUniversal table querying with filters and pagination
snow_create_incidentCreate new incidents
snow_query_incidentsQuery incidents with advanced filters
snow_update_incidentUpdate existing incidents
snow_query_problemsQuery problem records
snow_query_requestsQuery service requests
snow_user_lookupFind users by various criteria
snow_create_user_groupCreate user groups
snow_manage_group_membershipAdd/remove users from groups
snow_record_manageGeneric record CRUD operations
snow_discover_table_fieldsDiscover table schema and fields
snow_cmdb_searchSearch CMDB configuration items
snow_comprehensive_searchSearch across multiple tables
snow_cleanup_test_artifactsRemove test data from instance
snow_attach_fileAttach files to records
snow_assign_taskAssign tasks to users/groups
snow_analyze_incidentAI-powered incident analysis
snow_auto_resolve_incidentAuto-resolve with known solutions
snow_operational_metricsGet operational KPIs
snow_pattern_analysisAnalyze patterns in data
snow_predictive_analysisPredictive analytics on records
snow_catalog_item_searchSearch service catalog items
snow_catalog_item_managerManage catalog items
snow_get_by_sysidGet any record by sys_id

Security & Compliance (18 tools)

Security policies, vulnerability scanning, and compliance management.

ToolDescription
snow_create_security_policyCreate security policies
snow_create_compliance_ruleDefine compliance rules
snow_create_audit_ruleCreate audit rules
snow_create_access_controlCreate ACL rules
snow_scan_vulnerabilitiesRun vulnerability scans
snow_run_compliance_scanExecute compliance scans
snow_create_vulnerability_scanConfigure vulnerability scans
snow_audit_trail_analysisAnalyze audit trails
snow_analyze_threat_intelligenceThreat intelligence analysis
snow_automate_threat_responseAutomated threat response
snow_execute_security_playbookRun security playbooks
snow_escalate_permissionsEscalate user permissions
snow_discover_security_policiesDiscover existing policies
snow_discover_security_frameworksList security frameworks
snow_create_security_incidentCreate security incidents
snow_security_risk_assessmentAssess security risks
snow_vulnerability_risk_assessmentAssess vulnerability risks
snow_security_dashboardSecurity dashboard data

Automation (18 tools)

Script execution, scheduling, and workflow automation.

ToolDescription
snow_execute_script_with_outputExecute scripts with full output capture
snow_execute_background_scriptRun background scripts (with confirmation)
snow_execute_script_syncSynchronous script execution
snow_trace_executionTrace script execution for debugging
snow_get_logsRetrieve system logs
snow_get_script_outputGet previous script output
snow_confirm_script_executionConfirm pending script execution
snow_schedule_jobCreate scheduled jobs
snow_test_scheduled_jobTest scheduled job configuration
snow_discover_schedulesList existing schedules
snow_test_rest_connectionTest REST endpoint connectivity
snow_rest_message_test_suiteRun REST message test suites
snow_create_event_ruleCreate event rules
snow_discover_eventsDiscover system events
snow_create_escalation_ruleCreate escalation rules
snow_create_sla_definitionDefine SLA configurations
snow_create_workflow_activityCreate workflow activities
snow_property_managerManage system properties

Integration (14 tools)

REST/SOAP integrations, data mapping, and external connections.

ToolDescription
snow_create_rest_messageCreate REST message definitions
snow_test_integrationTest integration endpoints
snow_batch_apiBatch API operations
snow_create_web_serviceCreate web service endpoints
snow_create_field_mapCreate field mappings
snow_create_email_configConfigure email settings
snow_detect_code_patternsDetect patterns in code
snow_discover_integration_endpointsDiscover existing integrations
snow_discover_data_sourcesList data sources
snow_analyze_queryAnalyze query performance
snow_generate_docsGenerate API documentation
snow_workflow_analyzeAnalyze workflow performance
snow_create_transform_mapCreate data transform maps
snow_create_import_setCreate import set tables

CMDB (13 tools)

Configuration Management Database operations.

ToolDescription
snow_create_ciCreate configuration items
snow_update_ciUpdate configuration items
snow_get_ci_detailsGet CI details
snow_get_ci_relationshipsGet CI relationships
snow_get_ci_historyGet CI change history
snow_get_ci_impactAnalyze CI impact
snow_create_ci_relationshipCreate CI relationships
snow_search_cmdbSearch CMDB
snow_run_discoveryRun discovery jobs
snow_reconcile_ciReconcile CI data
snow_ci_health_checkCI health assessment
snow_impact_analysisRun impact analysis
snow_get_event_correlationGet correlated events

UI Builder (12 tools)

Next Experience UI Builder pages and components.

ToolDescription
snow_create_uib_pageCreate UI Builder pages
snow_uib_page_manageManage UIB pages
snow_create_uib_componentCreate UIB components
snow_uib_component_manageManage UIB components
snow_create_uib_data_brokerCreate data brokers
snow_configure_uib_data_brokerConfigure data brokers
snow_create_uib_eventCreate UIB events
snow_create_uib_page_registryRegister UIB pages
snow_create_uib_client_scriptCreate UIB client scripts
snow_create_uib_client_stateManage client state
snow_uib_discoverDiscover UIB artifacts
snow_analyze_uib_page_performanceAnalyze page performance

Deployment (11 tools)

Artifact deployment and management.

ToolDescription
snow_create_artifactCreate widgets, pages, scripts
snow_validate_deploymentPre-deployment validation
snow_rollback_deploymentRollback failed deployments
snow_export_artifactExport artifacts to XML
snow_import_artifactImport artifacts from XML
snow_deployment_statusCheck deployment status
snow_deployment_debugDebug deployment issues
snow_clone_instance_artifactClone artifacts between instances
snow_create_solution_packageCreate solution packages
snow_updateUpdate existing artifacts
snow_auth_diagnosticsDiagnose authentication issues

Workspace (10 tools)

Agent Workspace and UX configuration.

ToolDescription
snow_create_complete_workspaceCreate complete agent workspace
snow_create_configurable_agent_workspaceCreate configurable workspace
snow_create_ux_app_configCreate UX app configuration
snow_create_ux_app_routeCreate UX routes
snow_create_ux_experienceCreate UX experiences
snow_create_ux_page_macroponentCreate macroponents
snow_create_ux_page_registryRegister UX pages
snow_discover_all_workspacesList all workspaces
snow_update_ux_app_config_landing_pageUpdate landing pages
snow_validate_workspace_configurationValidate workspace config

Development Assistant (10 tools)

Intelligent development helpers.

ToolDescription
snow_find_artifactFind artifacts by name/type
snow_edit_artifactEdit existing artifacts
snow_analyze_artifactAnalyze artifact structure
snow_analyze_requirementsAnalyze development requirements
snow_edit_by_sysidEdit records by sys_id
snow_memory_searchSearch in-memory data
snow_orchestrate_developmentOrchestrate dev tasks
snow_sync_data_consistencySync data consistency
snow_validate_live_connectionValidate instance connection
snow_get_instance_infoGet instance information

Platform Development (12 tools)

Business rules, client scripts, UI policies.

ToolDescription
snow_create_business_ruleCreate business rules
snow_create_client_scriptCreate client scripts
snow_create_script_includeCreate script includes
snow_create_ui_actionCreate UI actions
snow_create_ui_pageCreate UI pages
snow_create_ui_policyCreate UI policies
snow_create_ui_macroCreate UI macros
snow_create_ui_scriptCreate UI scripts
snow_discover_platform_tablesDiscover platform tables
snow_table_schema_discoveryDiscover table schemas
snow_create_aclCreate access control lists
snow_create_notificationCreate notifications

Update Sets (8 tools)

Change management and deployment.

ToolDescription
snow_update_set_manageCreate, complete, switch update sets
snow_update_set_queryQuery update set status
snow_update_set_currentGet current update set
snow_update_set_exportExport update set to XML
snow_update_set_importImport update set from XML
snow_update_set_previewPreview update set changes
snow_update_set_commitCommit update set
snow_ensure_active_update_setEnsure update set is active

Service Portal (10 tools)

Widgets, pages, and portal configuration.

ToolDescription
snow_create_widgetCreate Service Portal widgets
snow_update_widgetUpdate existing widgets
snow_create_portal_pageCreate portal pages
snow_create_portal_themeCreate portal themes
snow_check_widget_coherenceValidate widget coherence
snow_preview_widgetPreview widget rendering
snow_widget_testTest widget functionality
snow_pull_artifactPull widget to local files
snow_push_artifactPush local changes back
snow_discover_widgetsDiscover existing widgets

Virtual Agent (7 tools)

Virtual Agent NLU and conversations.

ToolDescription
snow_create_va_topicCreate VA topics
snow_create_va_topic_blockCreate topic blocks
snow_discover_va_topicsDiscover VA topics
snow_get_va_conversationGet VA conversation history
snow_send_va_messageSend VA messages
snow_handoff_to_agentHandoff to live agent
snow_train_va_nluTrain VA NLU model

Mobile (7 tools)

Mobile app configuration.

ToolDescription
snow_configure_mobile_appConfigure mobile applications
snow_configure_offline_syncConfigure offline sync
snow_create_mobile_actionCreate mobile actions
snow_create_mobile_layoutCreate mobile layouts
snow_discover_mobile_configsDiscover mobile configs
snow_get_mobile_analyticsGet mobile analytics
snow_send_push_notificationSend push notifications

AI & Machine Learning (8 tools)

Predictive intelligence and ML features.

ToolDescription
snow_ai_classifyAI-powered classification
snow_ml_predictML predictions
snow_anomaly_detectionDetect anomalies in data
snow_duplicate_detectionFind duplicate records
snow_fuzzy_searchFuzzy text search
snow_autocompleteAI autocomplete suggestions
snow_sentiment_analysisAnalyze text sentiment
snow_recommendation_engineGet AI recommendations

Asset Management (8 tools)

Asset lifecycle and license management.

ToolDescription
snow_create_assetCreate assets
snow_manage_software_licenseManage software licenses
snow_optimize_licensesOptimize license usage
snow_retire_assetRetire assets
snow_transfer_assetTransfer asset ownership
snow_track_asset_lifecycleTrack asset lifecycle
snow_asset_discoveryDiscover assets
snow_asset_compliance_reportGenerate compliance reports

Change Management (8 tools)

Change requests and CAB management.

ToolDescription
snow_create_change_requestCreate change requests
snow_update_change_requestUpdate change requests
snow_query_changesQuery change records
snow_change_risk_assessmentAssess change risk
snow_change_collision_detectionDetect change collisions
snow_change_calendarView change calendar
snow_cab_workbenchCAB workbench operations
snow_change_manageComprehensive change management

Knowledge Management (7 tools)

Knowledge base articles and management.

ToolDescription
snow_create_knowledge_articleCreate KB articles
snow_update_knowledge_articleUpdate KB articles
snow_search_knowledgeSearch knowledge base
snow_publish_knowledge_articlePublish articles
snow_retire_knowledge_articleRetire articles
snow_knowledge_feedbackManage article feedback
snow_knowledge_analyticsKB analytics

Flow Designer (8 tools)

Flow Designer automation.

ToolDescription
snow_create_flowCreate Flow Designer flows
snow_create_subflowCreate subflows
snow_create_actionCreate flow actions
snow_test_flowTest flow execution
snow_activate_flowActivate flows
snow_discover_flowsDiscover existing flows
snow_flow_execution_historyView execution history
snow_flow_debugDebug flow issues

Reporting & Analytics (8 tools)

Reports, dashboards, and analytics.

ToolDescription
snow_create_reportCreate reports
snow_create_dashboardCreate dashboards
snow_create_widget_indicatorCreate dashboard indicators
snow_define_kpiDefine KPIs
snow_schedule_reportSchedule report delivery
snow_export_reportExport reports
snow_analyze_data_qualityAnalyze data quality
snow_performance_analyticsPerformance Analytics

Automated Test Framework (6 tools)

Test automation and validation.

ToolDescription
snow_create_atf_testCreate ATF tests
snow_create_atf_suiteCreate test suites
snow_run_atf_testRun ATF tests
snow_run_atf_suiteRun test suites
snow_get_atf_resultsGet test results
snow_discover_atf_testsDiscover existing tests

Notifications (7 tools)

Notification management and delivery.

ToolDescription
snow_send_notificationSend notifications
snow_create_notification_templateCreate notification templates
snow_send_pushSend push notifications
snow_schedule_notificationSchedule notifications
snow_emergency_broadcastSend emergency broadcasts
snow_notification_preferencesManage preferences
snow_notification_analyticsNotification analytics

Agent Orchestration (12 tools)

Multi-agent coordination via snow-flow-mcp.

ToolDescription
agent_initInitialize agent orchestration
agent_spawnCreate specialized agents
agent_statusMonitor agent health
agent_discoverDiscover agent types
neural_trainTrain TensorFlow.js neural networks
neural_statusCheck training progress
neural_patternsAnalyze patterns with ML
memory_searchSearch in-memory data
memory_usageManage memory storage
task_categorizeCategorize tasks for agents
performance_reportGenerate performance reports
token_usageAnalyze token consumption
Additional Domains

Plus 50+ more domains including: HR Service Delivery, CSM, DevOps, GRC, Project Portfolio, Service Level Management, Event Management, Discovery, Cost Management, and many more. All tools follow the same snow_* naming pattern.

MCP Configuration

The .mcp.json file configures MCP servers:

json
{
  "mcp": {
    "servicenow-unified": {
      "type": "local",
      "command": ["node", "dist/mcp/servicenow-mcp-unified/index.js"],
      "environment": {
        "SERVICENOW_INSTANCE_URL": "{{SNOW_INSTANCE}}",
        "SERVICENOW_CLIENT_ID": "{{SNOW_CLIENT_ID}}",
        "SERVICENOW_CLIENT_SECRET": "{{SNOW_CLIENT_SECRET}}"
      },
      "enabled": true
    }
  }
}

Use With Any AI IDE

Snow-Flow works with any MCP-compatible AI tool. After running snow-flow init, the configuration is generated at .mcp.json and synced to .snow-code/config.json.

AI Tool Config Location Setup
snow-code Recommended Built-in Just run snow-flow agent
Claude Desktop claude_desktop_config.json Copy config with mcpServers key
Cursor .cursor/mcp.json Copy .mcp.json to project
Windsurf mcp_config.json Copy .mcp.json to project
Continue.dev .continue/config.json Add to mcpServers array

Setup for Claude Desktop

Claude Desktop uses a different key (mcpServers) than other tools:

bash
# macOS config location
~/Library/Application Support/Claude/claude_desktop_config.json

# Windows config location
%APPDATA%\Claude\claude_desktop_config.json
json
{
  "mcpServers": {
    "servicenow-unified": {
      "command": "node",
      "args": ["/path/to/snow-flow/dist/mcp/servicenow-mcp-unified/index.js"],
      "env": {
        "SERVICENOW_INSTANCE_URL": "https://your-instance.service-now.com",
        "SERVICENOW_CLIENT_ID": "your-client-id",
        "SERVICENOW_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}
Important: Config Key Differences

Claude Desktop uses mcpServers with command + args format.
Other tools (Cursor, Windsurf, Continue.dev) use mcp with command array format.

Setup for Cursor

bash
# After snow-flow init, copy config to Cursor
cp .mcp.json .cursor/mcp.json

# Or create .cursor directory first
mkdir -p .cursor && cp .mcp.json .cursor/mcp.json

Setup for Windsurf

bash
# After snow-flow init, copy config to Windsurf
cp .mcp.json mcp_config.json

Setup for Continue.dev

bash
# Continue.dev config location
~/.continue/config.json

Add the MCP servers to your Continue.dev config:

json
{
  "experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "stdio",
          "command": "node",
          "args": ["/path/to/snow-flow/dist/mcp/servicenow-mcp-unified/index.js"]
        }
      }
    ]
  }
}
Finding Your Snow-Flow Path

To find the path to your snow-flow installation:

bash
# Global npm installation
npm root -g
# Output: /usr/local/lib/node_modules
# Full path: /usr/local/lib/node_modules/snow-flow/dist/mcp/...

# Or use which to find the binary
which snow-flow

ES5 JavaScript Requirement

Critical: ServiceNow Only Supports ES5

ServiceNow runs on Mozilla Rhino (2009), which ONLY supports ES5 JavaScript. Any ES6+ syntax will cause runtime errors.

ES6+ Features That WILL CRASH

javascript
// ALL OF THESE BREAK SERVICENOW:
const x = 5;                    // SyntaxError
let items = [];                 // SyntaxError
const fn = () => {};            // SyntaxError
var msg = `Hello ${name}`;      // SyntaxError
for (let item of items) {}    // SyntaxError
var {name, id} = user;          // SyntaxError
array.map(x => x.id);           // SyntaxError
class MyClass {}                // SyntaxError

Correct ES5 Syntax

javascript
// THESE WORK IN SERVICENOW:
var x = 5;
var items = [];
function fn() { return 'result'; }
var msg = 'Hello ' + name;
for (var i = 0; i < items.length; i++) {
  var item = items[i];
}
var name = user.name;
var id = user.id;
Automatic Validation

Snow-Flow automatically validates all scripts for ES5 compliance before deployment.

Update Set Management

Update Sets track ALL changes for deployment between instances. Always create an Update Set before making changes.

Workflow

javascript
// 1. Create Update Set FIRST
snow_update_set_manage({
  action: 'create',
  name: "Feature: Incident Dashboard",
  description: "Widget showing incident metrics"
});

// 2. Develop (changes auto-tracked)
snow_create_artifact({...});
snow_create_business_rule({...});

// 3. Complete Update Set
snow_update_set_manage({
  action: 'complete',
  update_set_id: 'sys_id_here'
});
OAuth Context

Snow-Flow uses a service account for API calls. Update Sets are automatically set as current for this account when auto_switch=true (default).

Widget Coherence

ServiceNow widgets require perfect synchronization between Server Script, Client Script, and HTML Template.

The Three-Way Contract

javascript
// SERVER SCRIPT - Initialize data
data.message = "Hello";
data.items = [];
if (input.action === 'loadItems') {
  data.items = getItems();
}

// CLIENT SCRIPT - Handle UI interactions
c.loadItems = function() {
  c.server.get({action: 'loadItems'}).then(function() {
    console.log(c.data.items);
  });
};

// HTML TEMPLATE - Display data
<button ng-click="loadItems()">Load</button>
<div ng-repeat="item in data.items">{{item}}</div>

Coherence Checklist

  • Every data.property in server is used in HTML/client
  • Every ng-click="method()" in HTML has matching c.method in client
  • Every c.server.get({action}) in client has matching if(input.action) in server

Enterprise Features Enterprise

Snow-Flow Enterprise adds powerful integrations for team workflows:

Jira Integration
Pull stories, auto-update tickets, bidirectional sync with your sprint backlog.
Azure DevOps
Connect to Azure Boards, complete work items, integrate with pipelines.
Confluence
Auto-generate technical documentation, keep wiki in sync with code.
Stakeholder Seats
Read-only access for non-developers to query and get answers safely.

Integration Setup

bash
# Login with enterprise features
snow-flow auth login

# Connect Jira
# (Follow prompts to authorize)

# Complete a Jira story autonomously
snow-flow agent "Complete JIRA-1234"
Enterprise Portal

Manage licenses, users, and integrations at portal.snow-flow.dev