skills/genai/flow-generation/SKILL.md
Generate ServiceNow Flow Designer flows from natural language descriptions including triggers, actions, conditions, subflows, approval flows, notification flows, and data manipulation flows
npx skillsauth add happy-technologies-llc/happy-servicenow-skills flow-generationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill covers generating ServiceNow Flow Designer flows from natural language descriptions:
When to use: When automating business processes, generating approval workflows, building notification logic, or creating data manipulation pipelines in Flow Designer.
flow_designer or admincom.glide.hub.flow_designer (Flow Designer), com.glide.hub.action_type (Action Designer)genai/playbook-generation for Process Automation, genai/spoke-generation for integrationsParse the user's request to identify:
MCP Approach:
Use SN-Query-Table on sys_hub_flow:
- query: active=true^trigger_type=RECORD_CREATED^table=incident
- fields: sys_id,name,description,trigger_type,table,status
- limit: 10
REST Approach:
GET /api/now/table/sys_hub_flow
?sysparm_query=active=true^trigger_type=RECORD_CREATED^table=incident
&sysparm_fields=sys_id,name,description,trigger_type,table,status
&sysparm_limit=10
MCP Approach:
Use SN-Create-Record on sys_hub_flow:
- name: "Auto-Assign Priority Incidents"
- description: "Automatically assigns high-priority incidents to the on-call team"
- trigger_type: "RECORD_CREATED"
- table: "incident"
- status: "draft"
- run_as: "system"
- scope: "global"
REST Approach:
POST /api/now/table/sys_hub_flow
Body: {
"name": "Auto-Assign Priority Incidents",
"description": "Automatically assigns high-priority incidents to the on-call team",
"trigger_type": "RECORD_CREATED",
"table": "incident",
"status": "draft",
"run_as": "system",
"scope": "global"
}
Key trigger types and their configurations:
| Trigger Type | Value | Configuration Fields | |-------------|-------|---------------------| | Record Created | RECORD_CREATED | table, conditions | | Record Updated | RECORD_UPDATED | table, conditions, fields_to_monitor | | Record Deleted | RECORD_DELETED | table, conditions | | Scheduled | SCHEDULED | schedule, time_zone, repeat_interval | | Inbound Email | INBOUND_EMAIL | target_table, conditions | | REST API | REST | endpoint_path, http_method | | Service Catalog | SC_REQ_ITEM | catalog_item, conditions |
MCP Approach:
Use SN-Create-Record on sys_hub_trigger_instance:
- flow: "<flow_sys_id>"
- trigger_type: "RECORD_UPDATED"
- table: "incident"
- condition: "priority=1^state!=6"
- fields_to_monitor: "priority,assignment_group"
REST Approach:
POST /api/now/table/sys_hub_trigger_instance
Body: {
"flow": "<flow_sys_id>",
"trigger_type": "RECORD_UPDATED",
"table": "incident",
"condition": "priority=1^state!=6",
"fields_to_monitor": "priority,assignment_group"
}
Common action types and their sys_hub_action_type_definition references:
| Action | Type Definition | Key Inputs | |--------|----------------|------------| | Create Record | sn_fd.create_record | table, field_values | | Update Record | sn_fd.update_record | record, field_values | | Delete Record | sn_fd.delete_record | record | | Look Up Record | sn_fd.look_up_record | table, conditions | | Ask for Approval | sn_fd.ask_for_approval | record, approvers, approval_type | | Send Email | sn_fd.send_email | to, subject, body | | Send Notification | sn_fd.send_notification | notification, recipients | | Log Message | sn_fd.log | message, level | | Run Script | sn_fd.run_script | script | | Wait for Condition | sn_fd.wait_for_condition | table, condition, timeout |
MCP Approach:
Use SN-Create-Record on sys_hub_action_instance:
- flow: "<flow_sys_id>"
- action_type: "<action_type_sys_id>"
- order: 100
- name: "Look Up Assignment Group"
- inputs: {
"table": "sys_user_group",
"conditions": "name=Network Operations"
}
Build if/else branches using flow logic steps:
MCP Approach:
Use SN-Create-Record on sys_hub_action_instance:
- flow: "<flow_sys_id>"
- action_type: "sn_fd.if"
- order: 200
- name: "Check Priority Level"
- inputs: {
"condition": "trigger.current.priority == 1"
}
For nested conditions, use the parent field to link child actions to the if/else block.
Sequential Approval Pattern:
Use SN-Create-Record on sys_hub_action_instance:
- flow: "<flow_sys_id>"
- action_type: "sn_fd.ask_for_approval"
- order: 300
- name: "Manager Approval"
- inputs: {
"record": "trigger.current",
"approval_type": "approve_reject",
"approvers": "trigger.current.opened_by.manager",
"due_date_interval": "3 days"
}
Parallel Approval Pattern: Add multiple approval actions inside a parallel block:
Use SN-Create-Record on sys_hub_action_instance:
- flow: "<flow_sys_id>"
- action_type: "sn_fd.parallel"
- order: 300
- name: "Parallel Approvals"
Then add child approval actions with parent referencing the parallel block.
MCP Approach:
Use SN-Create-Record on sys_hub_sub_flow:
- name: "Send Escalation Notification"
- description: "Reusable subflow for sending escalation notifications"
- status: "draft"
- inputs: "record,escalation_level,notify_group"
- access: "public"
REST Approach:
POST /api/now/table/sys_hub_sub_flow
Body: {
"name": "Send Escalation Notification",
"description": "Reusable subflow for sending escalation notifications",
"status": "draft",
"access": "public"
}
MCP Approach:
Use SN-Create-Record on sys_hub_flow_input:
- flow: "<flow_sys_id>"
- name: "assignment_group"
- label: "Assignment Group"
- type: "reference"
- reference_table: "sys_user_group"
- mandatory: true
Use SN-Create-Record on sys_hub_flow_output:
- flow: "<flow_sys_id>"
- name: "approval_status"
- label: "Approval Status"
- type: "string"
MCP Approach:
Use SN-Update-Record on sys_hub_flow:
- sys_id: "<flow_sys_id>"
- status: "published"
Verify the flow is active:
Use SN-Query-Table on sys_hub_flow:
- query: sys_id=<flow_sys_id>
- fields: sys_id,name,status,active
| Tool | Purpose | When to Use | |------|---------|-------------| | SN-Query-Table | Find existing flows and action types | Pattern discovery and validation | | SN-Create-Record | Create flows, triggers, actions | Building new flow components | | SN-Update-Record | Modify flow settings, activate flows | Editing and publishing | | SN-Get-Table-Schema | Discover flow table fields | Understanding available configurations |
| Issue | Cause | Resolution | |-------|-------|------------| | Flow not triggering | Trigger conditions too restrictive or flow inactive | Check sys_hub_flow.active and trigger conditions | | Action fails with permission error | Run-as user lacks table access | Change run_as or grant roles to flow user | | Flow executes multiple times | Trigger lacks update-field filter | Add fields_to_monitor to limit re-triggers | | Subflow not found | Subflow is in draft or wrong scope | Publish subflow and check access setting | | Approval stuck in pending | No approvers matched | Verify approver reference resolves to active users | | Flow context shows error | Script action has runtime exception | Check sys_flow_context.error_message for details |
Generate a flow that automatically assigns P1 incidents to the Network Operations team and sends a notification:
incident where priority=1sys_user_group where name=Network Operationsassignment_group to lookup resultGenerate a multi-level approval flow for change requests:
change_request where state=assessrisk=high, request CAB approval (parallel)risk=moderate, request manager approval (sequential)authorizeclosed with rejection notesGenerate a scheduled flow to archive old resolved incidents:
incident where state=6^resolved_at<javascript:gs.daysAgo(90)u_incident_archivegenai/playbook-generation - Process Automation Designer playbooksgenai/spoke-generation - Integration Hub spoke creationcatalog/approval-workflows - Catalog-specific approval configurationitsm/incident-management - Incident table structure and fieldstesting
Manage supplier onboarding, qualification, performance monitoring, and offboarding with auditable lifecycle controls
tools
Identify emerging risks, prioritize intake signals, and route candidates into formal GRC risk assessment workflows
documentation
Screen inbound documents for completeness, policy risk, and routing readiness before extraction or case workflows
testing
Generate concise task summaries with status, timeline, blockers, SLA risk, and recommended next actions