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
# Global installation (recommended) npm install -g snow-flow # Verify installation snow-flow --version
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
# Initialize Snow-Flow in your project snow-flow init # This creates: # - .mcp.json (MCP server configuration) # - CLAUDE.md (AI agent instructions)
2. Authenticate
# Login to ServiceNow and configure LLM provider snow-flow auth login # Check authentication status snow-flow auth status
3. Start Building
# 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:
- Environment variables - Highest priority
- auth.json - Auto-loaded from snow-code
- .mcp.json credentials - Project-specific
- Interactive login - Prompts if none found
ServiceNow OAuth Setup
Create an OAuth application in your ServiceNow instance:
- Navigate to System OAuth → Application Registry
- Click New → Create an OAuth API endpoint for external clients
- Configure:
Name: Snow-FlowRedirect URL:http://localhost:3005/callbackRefresh Token Lifespan:0(unlimited)
- Copy the Client ID and Client Secret
Never commit OAuth credentials to version control. Use environment variables or the secure credential storage.
Credential Storage
Snow-Flow stores credentials securely at:
~/.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)
# 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)
# 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
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
# 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:
# 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"
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.
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.
| Tool | Description |
|---|---|
snow_query_table | Universal table querying with filters and pagination |
snow_create_incident | Create new incidents |
snow_query_incidents | Query incidents with advanced filters |
snow_update_incident | Update existing incidents |
snow_query_problems | Query problem records |
snow_query_requests | Query service requests |
snow_user_lookup | Find users by various criteria |
snow_create_user_group | Create user groups |
snow_manage_group_membership | Add/remove users from groups |
snow_record_manage | Generic record CRUD operations |
snow_discover_table_fields | Discover table schema and fields |
snow_cmdb_search | Search CMDB configuration items |
snow_comprehensive_search | Search across multiple tables |
snow_cleanup_test_artifacts | Remove test data from instance |
snow_attach_file | Attach files to records |
snow_assign_task | Assign tasks to users/groups |
snow_analyze_incident | AI-powered incident analysis |
snow_auto_resolve_incident | Auto-resolve with known solutions |
snow_operational_metrics | Get operational KPIs |
snow_pattern_analysis | Analyze patterns in data |
snow_predictive_analysis | Predictive analytics on records |
snow_catalog_item_search | Search service catalog items |
snow_catalog_item_manager | Manage catalog items |
snow_get_by_sysid | Get any record by sys_id |
Security & Compliance (18 tools)
Security policies, vulnerability scanning, and compliance management.
| Tool | Description |
|---|---|
snow_create_security_policy | Create security policies |
snow_create_compliance_rule | Define compliance rules |
snow_create_audit_rule | Create audit rules |
snow_create_access_control | Create ACL rules |
snow_scan_vulnerabilities | Run vulnerability scans |
snow_run_compliance_scan | Execute compliance scans |
snow_create_vulnerability_scan | Configure vulnerability scans |
snow_audit_trail_analysis | Analyze audit trails |
snow_analyze_threat_intelligence | Threat intelligence analysis |
snow_automate_threat_response | Automated threat response |
snow_execute_security_playbook | Run security playbooks |
snow_escalate_permissions | Escalate user permissions |
snow_discover_security_policies | Discover existing policies |
snow_discover_security_frameworks | List security frameworks |
snow_create_security_incident | Create security incidents |
snow_security_risk_assessment | Assess security risks |
snow_vulnerability_risk_assessment | Assess vulnerability risks |
snow_security_dashboard | Security dashboard data |
Automation (18 tools)
Script execution, scheduling, and workflow automation.
| Tool | Description |
|---|---|
snow_execute_script_with_output | Execute scripts with full output capture |
snow_execute_background_script | Run background scripts (with confirmation) |
snow_execute_script_sync | Synchronous script execution |
snow_trace_execution | Trace script execution for debugging |
snow_get_logs | Retrieve system logs |
snow_get_script_output | Get previous script output |
snow_confirm_script_execution | Confirm pending script execution |
snow_schedule_job | Create scheduled jobs |
snow_test_scheduled_job | Test scheduled job configuration |
snow_discover_schedules | List existing schedules |
snow_test_rest_connection | Test REST endpoint connectivity |
snow_rest_message_test_suite | Run REST message test suites |
snow_create_event_rule | Create event rules |
snow_discover_events | Discover system events |
snow_create_escalation_rule | Create escalation rules |
snow_create_sla_definition | Define SLA configurations |
snow_create_workflow_activity | Create workflow activities |
snow_property_manager | Manage system properties |
Integration (14 tools)
REST/SOAP integrations, data mapping, and external connections.
| Tool | Description |
|---|---|
snow_create_rest_message | Create REST message definitions |
snow_test_integration | Test integration endpoints |
snow_batch_api | Batch API operations |
snow_create_web_service | Create web service endpoints |
snow_create_field_map | Create field mappings |
snow_create_email_config | Configure email settings |
snow_detect_code_patterns | Detect patterns in code |
snow_discover_integration_endpoints | Discover existing integrations |
snow_discover_data_sources | List data sources |
snow_analyze_query | Analyze query performance |
snow_generate_docs | Generate API documentation |
snow_workflow_analyze | Analyze workflow performance |
snow_create_transform_map | Create data transform maps |
snow_create_import_set | Create import set tables |
CMDB (13 tools)
Configuration Management Database operations.
| Tool | Description |
|---|---|
snow_create_ci | Create configuration items |
snow_update_ci | Update configuration items |
snow_get_ci_details | Get CI details |
snow_get_ci_relationships | Get CI relationships |
snow_get_ci_history | Get CI change history |
snow_get_ci_impact | Analyze CI impact |
snow_create_ci_relationship | Create CI relationships |
snow_search_cmdb | Search CMDB |
snow_run_discovery | Run discovery jobs |
snow_reconcile_ci | Reconcile CI data |
snow_ci_health_check | CI health assessment |
snow_impact_analysis | Run impact analysis |
snow_get_event_correlation | Get correlated events |
UI Builder (12 tools)
Next Experience UI Builder pages and components.
| Tool | Description |
|---|---|
snow_create_uib_page | Create UI Builder pages |
snow_uib_page_manage | Manage UIB pages |
snow_create_uib_component | Create UIB components |
snow_uib_component_manage | Manage UIB components |
snow_create_uib_data_broker | Create data brokers |
snow_configure_uib_data_broker | Configure data brokers |
snow_create_uib_event | Create UIB events |
snow_create_uib_page_registry | Register UIB pages |
snow_create_uib_client_script | Create UIB client scripts |
snow_create_uib_client_state | Manage client state |
snow_uib_discover | Discover UIB artifacts |
snow_analyze_uib_page_performance | Analyze page performance |
Deployment (11 tools)
Artifact deployment and management.
| Tool | Description |
|---|---|
snow_create_artifact | Create widgets, pages, scripts |
snow_validate_deployment | Pre-deployment validation |
snow_rollback_deployment | Rollback failed deployments |
snow_export_artifact | Export artifacts to XML |
snow_import_artifact | Import artifacts from XML |
snow_deployment_status | Check deployment status |
snow_deployment_debug | Debug deployment issues |
snow_clone_instance_artifact | Clone artifacts between instances |
snow_create_solution_package | Create solution packages |
snow_update | Update existing artifacts |
snow_auth_diagnostics | Diagnose authentication issues |
Workspace (10 tools)
Agent Workspace and UX configuration.
| Tool | Description |
|---|---|
snow_create_complete_workspace | Create complete agent workspace |
snow_create_configurable_agent_workspace | Create configurable workspace |
snow_create_ux_app_config | Create UX app configuration |
snow_create_ux_app_route | Create UX routes |
snow_create_ux_experience | Create UX experiences |
snow_create_ux_page_macroponent | Create macroponents |
snow_create_ux_page_registry | Register UX pages |
snow_discover_all_workspaces | List all workspaces |
snow_update_ux_app_config_landing_page | Update landing pages |
snow_validate_workspace_configuration | Validate workspace config |
Development Assistant (10 tools)
Intelligent development helpers.
| Tool | Description |
|---|---|
snow_find_artifact | Find artifacts by name/type |
snow_edit_artifact | Edit existing artifacts |
snow_analyze_artifact | Analyze artifact structure |
snow_analyze_requirements | Analyze development requirements |
snow_edit_by_sysid | Edit records by sys_id |
snow_memory_search | Search in-memory data |
snow_orchestrate_development | Orchestrate dev tasks |
snow_sync_data_consistency | Sync data consistency |
snow_validate_live_connection | Validate instance connection |
snow_get_instance_info | Get instance information |
Platform Development (12 tools)
Business rules, client scripts, UI policies.
| Tool | Description |
|---|---|
snow_create_business_rule | Create business rules |
snow_create_client_script | Create client scripts |
snow_create_script_include | Create script includes |
snow_create_ui_action | Create UI actions |
snow_create_ui_page | Create UI pages |
snow_create_ui_policy | Create UI policies |
snow_create_ui_macro | Create UI macros |
snow_create_ui_script | Create UI scripts |
snow_discover_platform_tables | Discover platform tables |
snow_table_schema_discovery | Discover table schemas |
snow_create_acl | Create access control lists |
snow_create_notification | Create notifications |
Update Sets (8 tools)
Change management and deployment.
| Tool | Description |
|---|---|
snow_update_set_manage | Create, complete, switch update sets |
snow_update_set_query | Query update set status |
snow_update_set_current | Get current update set |
snow_update_set_export | Export update set to XML |
snow_update_set_import | Import update set from XML |
snow_update_set_preview | Preview update set changes |
snow_update_set_commit | Commit update set |
snow_ensure_active_update_set | Ensure update set is active |
Service Portal (10 tools)
Widgets, pages, and portal configuration.
| Tool | Description |
|---|---|
snow_create_widget | Create Service Portal widgets |
snow_update_widget | Update existing widgets |
snow_create_portal_page | Create portal pages |
snow_create_portal_theme | Create portal themes |
snow_check_widget_coherence | Validate widget coherence |
snow_preview_widget | Preview widget rendering |
snow_widget_test | Test widget functionality |
snow_pull_artifact | Pull widget to local files |
snow_push_artifact | Push local changes back |
snow_discover_widgets | Discover existing widgets |
Virtual Agent (7 tools)
Virtual Agent NLU and conversations.
| Tool | Description |
|---|---|
snow_create_va_topic | Create VA topics |
snow_create_va_topic_block | Create topic blocks |
snow_discover_va_topics | Discover VA topics |
snow_get_va_conversation | Get VA conversation history |
snow_send_va_message | Send VA messages |
snow_handoff_to_agent | Handoff to live agent |
snow_train_va_nlu | Train VA NLU model |
Mobile (7 tools)
Mobile app configuration.
| Tool | Description |
|---|---|
snow_configure_mobile_app | Configure mobile applications |
snow_configure_offline_sync | Configure offline sync |
snow_create_mobile_action | Create mobile actions |
snow_create_mobile_layout | Create mobile layouts |
snow_discover_mobile_configs | Discover mobile configs |
snow_get_mobile_analytics | Get mobile analytics |
snow_send_push_notification | Send push notifications |
AI & Machine Learning (8 tools)
Predictive intelligence and ML features.
| Tool | Description |
|---|---|
snow_ai_classify | AI-powered classification |
snow_ml_predict | ML predictions |
snow_anomaly_detection | Detect anomalies in data |
snow_duplicate_detection | Find duplicate records |
snow_fuzzy_search | Fuzzy text search |
snow_autocomplete | AI autocomplete suggestions |
snow_sentiment_analysis | Analyze text sentiment |
snow_recommendation_engine | Get AI recommendations |
Asset Management (8 tools)
Asset lifecycle and license management.
| Tool | Description |
|---|---|
snow_create_asset | Create assets |
snow_manage_software_license | Manage software licenses |
snow_optimize_licenses | Optimize license usage |
snow_retire_asset | Retire assets |
snow_transfer_asset | Transfer asset ownership |
snow_track_asset_lifecycle | Track asset lifecycle |
snow_asset_discovery | Discover assets |
snow_asset_compliance_report | Generate compliance reports |
Change Management (8 tools)
Change requests and CAB management.
| Tool | Description |
|---|---|
snow_create_change_request | Create change requests |
snow_update_change_request | Update change requests |
snow_query_changes | Query change records |
snow_change_risk_assessment | Assess change risk |
snow_change_collision_detection | Detect change collisions |
snow_change_calendar | View change calendar |
snow_cab_workbench | CAB workbench operations |
snow_change_manage | Comprehensive change management |
Knowledge Management (7 tools)
Knowledge base articles and management.
| Tool | Description |
|---|---|
snow_create_knowledge_article | Create KB articles |
snow_update_knowledge_article | Update KB articles |
snow_search_knowledge | Search knowledge base |
snow_publish_knowledge_article | Publish articles |
snow_retire_knowledge_article | Retire articles |
snow_knowledge_feedback | Manage article feedback |
snow_knowledge_analytics | KB analytics |
Flow Designer (8 tools)
Flow Designer automation.
| Tool | Description |
|---|---|
snow_create_flow | Create Flow Designer flows |
snow_create_subflow | Create subflows |
snow_create_action | Create flow actions |
snow_test_flow | Test flow execution |
snow_activate_flow | Activate flows |
snow_discover_flows | Discover existing flows |
snow_flow_execution_history | View execution history |
snow_flow_debug | Debug flow issues |
Reporting & Analytics (8 tools)
Reports, dashboards, and analytics.
| Tool | Description |
|---|---|
snow_create_report | Create reports |
snow_create_dashboard | Create dashboards |
snow_create_widget_indicator | Create dashboard indicators |
snow_define_kpi | Define KPIs |
snow_schedule_report | Schedule report delivery |
snow_export_report | Export reports |
snow_analyze_data_quality | Analyze data quality |
snow_performance_analytics | Performance Analytics |
Automated Test Framework (6 tools)
Test automation and validation.
| Tool | Description |
|---|---|
snow_create_atf_test | Create ATF tests |
snow_create_atf_suite | Create test suites |
snow_run_atf_test | Run ATF tests |
snow_run_atf_suite | Run test suites |
snow_get_atf_results | Get test results |
snow_discover_atf_tests | Discover existing tests |
Notifications (7 tools)
Notification management and delivery.
| Tool | Description |
|---|---|
snow_send_notification | Send notifications |
snow_create_notification_template | Create notification templates |
snow_send_push | Send push notifications |
snow_schedule_notification | Schedule notifications |
snow_emergency_broadcast | Send emergency broadcasts |
snow_notification_preferences | Manage preferences |
snow_notification_analytics | Notification analytics |
Agent Orchestration (12 tools)
Multi-agent coordination via snow-flow-mcp.
| Tool | Description |
|---|---|
agent_init | Initialize agent orchestration |
agent_spawn | Create specialized agents |
agent_status | Monitor agent health |
agent_discover | Discover agent types |
neural_train | Train TensorFlow.js neural networks |
neural_status | Check training progress |
neural_patterns | Analyze patterns with ML |
memory_search | Search in-memory data |
memory_usage | Manage memory storage |
task_categorize | Categorize tasks for agents |
performance_report | Generate performance reports |
token_usage | Analyze token consumption |
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:
{
"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:
# macOS config location ~/Library/Application Support/Claude/claude_desktop_config.json # Windows config location %APPDATA%\Claude\claude_desktop_config.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"
}
}
}
}
Claude Desktop uses mcpServers with command + args format.
Other tools (Cursor, Windsurf, Continue.dev) use mcp with command array format.
Setup for Cursor
# 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
# After snow-flow init, copy config to Windsurf
cp .mcp.json mcp_config.json
Setup for Continue.dev
# Continue.dev config location
~/.continue/config.json
Add the MCP servers to your Continue.dev config:
{
"experimental": {
"modelContextProtocolServers": [
{
"transport": {
"type": "stdio",
"command": "node",
"args": ["/path/to/snow-flow/dist/mcp/servicenow-mcp-unified/index.js"]
}
}
]
}
}
To find the path to your snow-flow installation:
# 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
ServiceNow runs on Mozilla Rhino (2009), which ONLY supports ES5 JavaScript. Any ES6+ syntax will cause runtime errors.
ES6+ Features That WILL CRASH
// 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
// 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;
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
// 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' });
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
// 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.propertyin server is used in HTML/client - Every
ng-click="method()"in HTML has matchingc.methodin client - Every
c.server.get({action})in client has matchingif(input.action)in server
Enterprise Features Enterprise
Snow-Flow Enterprise adds powerful integrations for team workflows:
Integration Setup
# 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"
Manage licenses, users, and integrations at portal.snow-flow.dev