[{"data":1,"prerenderedAt":1382},["ShallowReactive",2],{"content-query-6bYymCSbFg":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"layout":10,"head":11,"author":13,"tags":14,"categories":20,"date":22,"faq":23,"image":39,"body":40,"_type":1375,"_id":1376,"_source":1377,"_file":1378,"_stem":1379,"_extension":1380,"sitemap":1381,"readingTime":740},"/blog/servicenow-webhooks","blog",false,"","ServiceNow Webhooks: Send Events to an Internal Server Behind a Firewall","How ServiceNow sends webhooks (outbound REST messages, business rules, Flow Designer), when a MID Server is the right answer, and how to deliver events to an on-prem service with no inbound ports.","post",{"title":12},"ServiceNow Webhooks to an Internal Server","Karolis Rusenas",[15,16,17,18,19],"servicenow","webhooks","on-prem","mid server","guide",[21],"tutorials","2026-11-17 11:00:00",[24,27,30,33,36],{"q":25,"a":26},"Does ServiceNow support outbound webhooks?","Yes, though it doesn't call them webhooks. You define an outbound REST message (an endpoint, method, headers and body) and call it when something happens: from a business rule with the RESTMessageV2 script API, from a workflow REST activity, or from a Flow Designer REST step. The Flow Designer REST step needs an Integration Hub subscription; business rules with RESTMessageV2 don't.",{"q":28,"a":29},"How do I send a ServiceNow webhook when an incident is created or updated?","Create an after or async business rule on the incident table with the conditions you care about, and in its script build a sn_ws.RESTMessageV2 request: set the endpoint, method POST, a JSON content type and body with the incident fields, then call executeAsync(). Point the endpoint at a public Webhook Relay URL if the receiver sits on a private network.",{"q":31,"a":32},"Can ServiceNow call an endpoint on our internal network?","Not directly. A ServiceNow instance runs in ServiceNow's cloud and can only reach public endpoints, unless the REST message runs through a MID Server installed inside your network. The other option is a public Webhook Relay URL with the relay agent running next to the internal service; the agent connects out, so no inbound firewall rule is needed.",{"q":34,"a":35},"Should I use a MID Server or Webhook Relay for ServiceNow outbound REST?","If you already run MID Servers and the integration is a few REST calls that ServiceNow owns end to end, the MID Server is the native choice. Webhook Relay fits when you don't want to run or patch MID Servers for this, when the same events should reach several internal systems, or when you want every request stored, retried and replayable outside ServiceNow.",{"q":37,"a":38},"What IP addresses does ServiceNow send outbound REST requests from?","ServiceNow doesn't publish one public list. Each customer looks up their instance's addresses through the My IP Information request in the Now Support portal. If you restrict a Webhook Relay input by source IP, use those addresses, and add a bearer token or basic auth on the input as well.","/images/blog/heroes/route.jpg",{"type":41,"children":42,"toc":1362},"root",[43,53,65,70,77,109,166,171,177,190,195,229,235,256,289,294,337,343,350,363,407,444,464,470,498,987,1007,1013,1025,1031,1131,1137,1282,1288,1356],{"type":44,"tag":45,"props":46,"children":47},"element","p",{},[48],{"type":44,"tag":49,"props":50,"children":52},"img",{"alt":51,"src":39},"ServiceNow webhooks to an internal server",[],{"type":44,"tag":45,"props":54,"children":55},{},[56,63],{"type":44,"tag":57,"props":58,"children":59},"strong",{},[60],{"type":61,"value":62},"text","To send ServiceNow events to a server on your private network, have ServiceNow call a public Webhook Relay URL from a business rule (or Flow Designer), and run the relay agent next to the internal service.",{"type":61,"value":64}," The agent connects out over HTTPS, so there's no inbound firewall rule, no public IP and no MID Server needed for this. Every request is stored, retried if your side is down, and logged with the response your service returned.",{"type":44,"tag":45,"props":66,"children":67},{},[68],{"type":61,"value":69},"The rest of this guide covers how ServiceNow actually sends outbound HTTP, where the MID Server fits, and a working setup.",{"type":44,"tag":71,"props":72,"children":74},"h2",{"id":73},"how-servicenow-sends-webhooks",[75],{"type":61,"value":76},"How ServiceNow sends webhooks",{"type":44,"tag":45,"props":78,"children":79},{},[80,82,87,89,98,100,107],{"type":61,"value":81},"ServiceNow has no \"Webhooks\" page where you paste a URL. Outbound calls are built from ",{"type":44,"tag":57,"props":83,"children":84},{},[85],{"type":61,"value":86},"outbound REST messages",{"type":61,"value":88},", and the ",{"type":44,"tag":90,"props":91,"children":95},"a",{"href":92,"rel":93},"https://www.servicenow.com/docs/r/api-reference/web-services/c_OutboundRESTWebService.html",[94],"nofollow",[96],{"type":61,"value":97},"ServiceNow docs",{"type":61,"value":99}," describe two ways to send one: a REST workflow activity, or the ",{"type":44,"tag":101,"props":102,"children":104},"code",{"className":103},[],[105],{"type":61,"value":106},"RESTMessageV2",{"type":61,"value":108}," script API. In practice you'll meet three patterns:",{"type":44,"tag":110,"props":111,"children":112},"ol",{},[113,131,149],{"type":44,"tag":114,"props":115,"children":116},"li",{},[117,122,124,129],{"type":44,"tag":57,"props":118,"children":119},{},[120],{"type":61,"value":121},"A stored REST message",{"type":61,"value":123}," under ",{"type":44,"tag":57,"props":125,"children":126},{},[127],{"type":61,"value":128},"System Web Services → Outbound → REST Message",{"type":61,"value":130},": an endpoint, HTTP methods, headers, an authentication profile and a body template with variables. Scripts and flows call it by name.",{"type":44,"tag":114,"props":132,"children":133},{},[134,139,141,147],{"type":44,"tag":57,"props":135,"children":136},{},[137],{"type":61,"value":138},"A business rule",{"type":61,"value":140}," that runs on a table event (insert, update, delete) and builds the request in script with ",{"type":44,"tag":101,"props":142,"children":144},{"className":143},[],[145],{"type":61,"value":146},"sn_ws.RESTMessageV2",{"type":61,"value":148},". This is the closest thing to a classic webhook, and it needs no extra subscription.",{"type":44,"tag":114,"props":150,"children":151},{},[152,157,159,164],{"type":44,"tag":57,"props":153,"children":154},{},[155],{"type":61,"value":156},"A Flow Designer REST step",{"type":61,"value":158}," inside a flow triggered by a record change. ServiceNow's docs say the REST step isn't in the base system and needs an ",{"type":44,"tag":57,"props":160,"children":161},{},[162],{"type":61,"value":163},"Integration Hub",{"type":61,"value":165}," subscription, so check your entitlements before you design around it.",{"type":44,"tag":45,"props":167,"children":168},{},[169],{"type":61,"value":170},"All three send ordinary HTTPS requests from ServiceNow's cloud. That's the core issue for on-prem receivers.",{"type":44,"tag":71,"props":172,"children":174},{"id":173},"the-private-network-problem",[175],{"type":61,"value":176},"The private-network problem",{"type":44,"tag":45,"props":178,"children":179},{},[180,182,188],{"type":61,"value":181},"Your ServiceNow instance runs in ServiceNow's data centres, and the system that should react to an incident (a CMDB sync job, an internal automation API, an on-prem monitoring or ticket bridge) runs on your network with no public address. A REST message pointed at ",{"type":44,"tag":101,"props":183,"children":185},{"className":184},[],[186],{"type":61,"value":187},"http://10.20.0.15:8080/incidents",{"type":61,"value":189}," just times out.",{"type":44,"tag":45,"props":191,"children":192},{},[193],{"type":61,"value":194},"The usual workarounds each cost something:",{"type":44,"tag":196,"props":197,"children":198},"ul",{},[199,209,219],{"type":44,"tag":114,"props":200,"children":201},{},[202,207],{"type":44,"tag":57,"props":203,"children":204},{},[205],{"type":61,"value":206},"Opening an inbound port",{"type":61,"value":208}," with a NAT rule and a public IP needs a firewall change, a security review and a hardened endpoint, and it's yours to look after from then on.",{"type":44,"tag":114,"props":210,"children":211},{},[212,217],{"type":44,"tag":57,"props":213,"children":214},{},[215],{"type":61,"value":216},"Polling the Table API",{"type":61,"value":218}," from inside the network works, but you trade real-time events for a schedule and an API-rate budget.",{"type":44,"tag":114,"props":220,"children":221},{},[222,227],{"type":44,"tag":57,"props":223,"children":224},{},[225],{"type":61,"value":226},"A MID Server",{"type":61,"value":228},", covered next.",{"type":44,"tag":71,"props":230,"children":232},{"id":231},"where-the-mid-server-fits",[233],{"type":61,"value":234},"Where the MID Server fits",{"type":44,"tag":45,"props":236,"children":237},{},[238,240,247,249,254],{"type":61,"value":239},"A ",{"type":44,"tag":90,"props":241,"children":244},{"href":242,"rel":243},"https://www.servicenow.com/docs/r/servicenow-platform/mid-server/mid-server-landing.html",[94],[245],{"type":61,"value":246},"MID Server",{"type":61,"value":248}," is a Java application that runs as a Windows service or UNIX daemon inside your network. It connects ",{"type":44,"tag":57,"props":250,"children":251},{},[252],{"type":61,"value":253},"out",{"type":61,"value":255}," to your instance on TCP 443 and works through the ECC Queue: the instance queues work, the MID Server picks it up, runs it, and writes the result back. ServiceNow notifies it when work is waiting, and it also polls every 40 seconds by default.",{"type":44,"tag":45,"props":257,"children":258},{},[259,261,267,269,274,276,282,284],{"type":61,"value":260},"ServiceNow documents that outbound REST messages \"can run from a MID Server\" to reach REST endpoints on an internal network. In script that's ",{"type":44,"tag":101,"props":262,"children":264},{"className":263},[],[265],{"type":61,"value":266},"setMIDServer()",{"type":61,"value":268}," on the ",{"type":44,"tag":101,"props":270,"children":272},{"className":271},[],[273],{"type":61,"value":106},{"type":61,"value":275}," object, followed by ",{"type":44,"tag":101,"props":277,"children":279},{"className":278},[],[280],{"type":61,"value":281},"executeAsync()",{"type":61,"value":283},". So for some teams the honest answer is: ",{"type":44,"tag":57,"props":285,"children":286},{},[287],{"type":61,"value":288},"if you already run MID Servers for Discovery or Service Mapping, use one.",{"type":44,"tag":45,"props":290,"children":291},{},[292],{"type":61,"value":293},"It's less attractive when:",{"type":44,"tag":196,"props":295,"children":296},{},[297,307,317,327],{"type":44,"tag":114,"props":298,"children":299},{},[300,305],{"type":44,"tag":57,"props":301,"children":302},{},[303],{"type":61,"value":304},"You'd be installing MID Servers only for this.",{"type":61,"value":306}," It's a Java service to size, patch, upgrade with each instance release and keep highly available, often on a host the ServiceNow team doesn't own.",{"type":44,"tag":114,"props":308,"children":309},{},[310,315],{"type":44,"tag":57,"props":311,"children":312},{},[313],{"type":61,"value":314},"The receiving team isn't the ServiceNow team.",{"type":61,"value":316}," With a MID Server, delivery logic, retries and payload shape all live in ServiceNow scripts. The team that owns the internal API can't see what was sent or replay it.",{"type":44,"tag":114,"props":318,"children":319},{},[320,325],{"type":44,"tag":57,"props":321,"children":322},{},[323],{"type":61,"value":324},"The same event should reach several systems",{"type":61,"value":326},", or systems in several network zones, each of which would need MID Server reachability.",{"type":44,"tag":114,"props":328,"children":329},{},[330,335],{"type":44,"tag":57,"props":331,"children":332},{},[333],{"type":61,"value":334},"You need an audit trail of deliveries",{"type":61,"value":336}," outside the instance: what was sent, when, and what the receiver answered.",{"type":44,"tag":71,"props":338,"children":340},{"id":339},"send-servicenow-events-to-an-internal-server-with-webhook-relay",[341],{"type":61,"value":342},"Send ServiceNow events to an internal server with Webhook Relay",{"type":44,"tag":344,"props":345,"children":347},"h3",{"id":346},"_1-create-a-bucket-and-start-the-agent-on-your-network",[348],{"type":61,"value":349},"1. Create a bucket and start the agent on your network",{"type":44,"tag":45,"props":351,"children":352},{},[353,355,361],{"type":61,"value":354},"On a host that can reach the internal service, ",{"type":44,"tag":90,"props":356,"children":358},{"href":357},"/docs/installation/cli/",[359],{"type":61,"value":360},"install the relay CLI",{"type":61,"value":362},", log in, and forward a bucket to the internal URL:",{"type":44,"tag":364,"props":365,"children":369},"pre",{"className":366,"code":367,"language":368,"meta":7,"style":7},"language-bash shiki shiki-themes github-dark","relay forward --bucket servicenow-incidents http://10.20.0.15:8080/incidents\n","bash",[370],{"type":44,"tag":101,"props":371,"children":372},{"__ignoreMap":7},[373],{"type":44,"tag":374,"props":375,"children":378},"span",{"class":376,"line":377},"line",1,[379,385,391,397,402],{"type":44,"tag":374,"props":380,"children":382},{"style":381},"--shiki-default:#B392F0",[383],{"type":61,"value":384},"relay",{"type":44,"tag":374,"props":386,"children":388},{"style":387},"--shiki-default:#9ECBFF",[389],{"type":61,"value":390}," forward",{"type":44,"tag":374,"props":392,"children":394},{"style":393},"--shiki-default:#79B8FF",[395],{"type":61,"value":396}," --bucket",{"type":44,"tag":374,"props":398,"children":399},{"style":387},[400],{"type":61,"value":401}," servicenow-incidents",{"type":44,"tag":374,"props":403,"children":404},{"style":387},[405],{"type":61,"value":406}," http://10.20.0.15:8080/incidents\n",{"type":44,"tag":45,"props":408,"children":409},{},[410,412,418,420,426,428,434,436,442],{"type":61,"value":411},"This creates the bucket, prints its public input URL (",{"type":44,"tag":101,"props":413,"children":415},{"className":414},[],[416],{"type":61,"value":417},"https://my.webhookrelay.com/v1/webhooks/\u003Cinput-id>",{"type":61,"value":419},"), and starts the agent. The agent only makes outbound connections, and it works through a corporate ",{"type":44,"tag":90,"props":421,"children":423},{"href":422},"/docs/installation/behind-proxy/",[424],{"type":61,"value":425},"HTTP proxy",{"type":61,"value":427},". For a long-running setup, run it as a ",{"type":44,"tag":90,"props":429,"children":431},{"href":430},"/docs/installation/docker/",[432],{"type":61,"value":433},"Docker container",{"type":61,"value":435}," or a service, or inside Kubernetes with the ",{"type":44,"tag":90,"props":437,"children":439},{"href":438},"/docs/installation/kubernetes/",[440],{"type":61,"value":441},"operator",{"type":61,"value":443},".",{"type":44,"tag":45,"props":445,"children":446},{},[447,449,454,456,462],{"type":61,"value":448},"In the bucket settings, turn on ",{"type":44,"tag":57,"props":450,"children":451},{},[452],{"type":61,"value":453},"token authentication",{"type":61,"value":455}," (",{"type":44,"tag":90,"props":457,"children":459},{"href":458},"/docs/webhooks/auth/username-password/",[460],{"type":61,"value":461},"how",{"type":61,"value":463},") so only requests carrying your bearer token are accepted.",{"type":44,"tag":344,"props":465,"children":467},{"id":466},"_2-call-it-from-a-business-rule",[468],{"type":61,"value":469},"2. Call it from a business rule",{"type":44,"tag":45,"props":471,"children":472},{},[473,475,481,483,488,490,496],{"type":61,"value":474},"Create a business rule on the ",{"type":44,"tag":101,"props":476,"children":478},{"className":477},[],[479],{"type":61,"value":480},"incident",{"type":61,"value":482}," table: ",{"type":44,"tag":57,"props":484,"children":485},{},[486],{"type":61,"value":487},"When: async",{"type":61,"value":489},", on insert and update, with conditions such as ",{"type":44,"tag":491,"props":492,"children":493},"em",{},[494],{"type":61,"value":495},"Priority is 1 - Critical",{"type":61,"value":497},". Async rules run after the record is saved and keep the HTTP call off the user's transaction. The script:",{"type":44,"tag":364,"props":499,"children":503},{"className":500,"code":501,"language":502,"meta":7,"style":7},"language-javascript shiki shiki-themes github-dark","(function executeRule(current, previous) {\n  var r = new sn_ws.RESTMessageV2();\n  r.setEndpoint('https://my.webhookrelay.com/v1/webhooks/\u003Cinput-id>');\n  r.setHttpMethod('post');\n  r.setRequestHeader('Content-Type', 'application/json');\n  r.setRequestHeader('Authorization', 'Bearer ' + gs.getProperty('x_acme.webhookrelay_token'));\n  r.setRequestBody(JSON.stringify({\n    event: current.operation(),            // insert / update\n    sys_id: current.getUniqueValue(),\n    number: current.getValue('number'),\n    state: current.getValue('state'),\n    priority: current.getValue('priority'),\n    assignment_group: current.getDisplayValue('assignment_group'),\n    short_description: current.getValue('short_description')\n  }));\n  r.executeAsync();\n})(current, previous);\n","javascript",[504],{"type":44,"tag":101,"props":505,"children":506},{"__ignoreMap":7},[507,552,590,618,644,679,738,774,799,818,846,872,898,925,952,961,978],{"type":44,"tag":374,"props":508,"children":509},{"class":376,"line":377},[510,516,522,527,531,537,542,547],{"type":44,"tag":374,"props":511,"children":513},{"style":512},"--shiki-default:#E1E4E8",[514],{"type":61,"value":515},"(",{"type":44,"tag":374,"props":517,"children":519},{"style":518},"--shiki-default:#F97583",[520],{"type":61,"value":521},"function",{"type":44,"tag":374,"props":523,"children":524},{"style":381},[525],{"type":61,"value":526}," executeRule",{"type":44,"tag":374,"props":528,"children":529},{"style":512},[530],{"type":61,"value":515},{"type":44,"tag":374,"props":532,"children":534},{"style":533},"--shiki-default:#FFAB70",[535],{"type":61,"value":536},"current",{"type":44,"tag":374,"props":538,"children":539},{"style":512},[540],{"type":61,"value":541},", ",{"type":44,"tag":374,"props":543,"children":544},{"style":533},[545],{"type":61,"value":546},"previous",{"type":44,"tag":374,"props":548,"children":549},{"style":512},[550],{"type":61,"value":551},") {\n",{"type":44,"tag":374,"props":553,"children":555},{"class":376,"line":554},2,[556,561,566,571,576,581,585],{"type":44,"tag":374,"props":557,"children":558},{"style":518},[559],{"type":61,"value":560},"  var",{"type":44,"tag":374,"props":562,"children":563},{"style":512},[564],{"type":61,"value":565}," r ",{"type":44,"tag":374,"props":567,"children":568},{"style":518},[569],{"type":61,"value":570},"=",{"type":44,"tag":374,"props":572,"children":573},{"style":518},[574],{"type":61,"value":575}," new",{"type":44,"tag":374,"props":577,"children":578},{"style":512},[579],{"type":61,"value":580}," sn_ws.",{"type":44,"tag":374,"props":582,"children":583},{"style":381},[584],{"type":61,"value":106},{"type":44,"tag":374,"props":586,"children":587},{"style":512},[588],{"type":61,"value":589},"();\n",{"type":44,"tag":374,"props":591,"children":593},{"class":376,"line":592},3,[594,599,604,608,613],{"type":44,"tag":374,"props":595,"children":596},{"style":512},[597],{"type":61,"value":598},"  r.",{"type":44,"tag":374,"props":600,"children":601},{"style":381},[602],{"type":61,"value":603},"setEndpoint",{"type":44,"tag":374,"props":605,"children":606},{"style":512},[607],{"type":61,"value":515},{"type":44,"tag":374,"props":609,"children":610},{"style":387},[611],{"type":61,"value":612},"'https://my.webhookrelay.com/v1/webhooks/\u003Cinput-id>'",{"type":44,"tag":374,"props":614,"children":615},{"style":512},[616],{"type":61,"value":617},");\n",{"type":44,"tag":374,"props":619,"children":621},{"class":376,"line":620},4,[622,626,631,635,640],{"type":44,"tag":374,"props":623,"children":624},{"style":512},[625],{"type":61,"value":598},{"type":44,"tag":374,"props":627,"children":628},{"style":381},[629],{"type":61,"value":630},"setHttpMethod",{"type":44,"tag":374,"props":632,"children":633},{"style":512},[634],{"type":61,"value":515},{"type":44,"tag":374,"props":636,"children":637},{"style":387},[638],{"type":61,"value":639},"'post'",{"type":44,"tag":374,"props":641,"children":642},{"style":512},[643],{"type":61,"value":617},{"type":44,"tag":374,"props":645,"children":647},{"class":376,"line":646},5,[648,652,657,661,666,670,675],{"type":44,"tag":374,"props":649,"children":650},{"style":512},[651],{"type":61,"value":598},{"type":44,"tag":374,"props":653,"children":654},{"style":381},[655],{"type":61,"value":656},"setRequestHeader",{"type":44,"tag":374,"props":658,"children":659},{"style":512},[660],{"type":61,"value":515},{"type":44,"tag":374,"props":662,"children":663},{"style":387},[664],{"type":61,"value":665},"'Content-Type'",{"type":44,"tag":374,"props":667,"children":668},{"style":512},[669],{"type":61,"value":541},{"type":44,"tag":374,"props":671,"children":672},{"style":387},[673],{"type":61,"value":674},"'application/json'",{"type":44,"tag":374,"props":676,"children":677},{"style":512},[678],{"type":61,"value":617},{"type":44,"tag":374,"props":680,"children":682},{"class":376,"line":681},6,[683,687,691,695,700,704,709,714,719,724,728,733],{"type":44,"tag":374,"props":684,"children":685},{"style":512},[686],{"type":61,"value":598},{"type":44,"tag":374,"props":688,"children":689},{"style":381},[690],{"type":61,"value":656},{"type":44,"tag":374,"props":692,"children":693},{"style":512},[694],{"type":61,"value":515},{"type":44,"tag":374,"props":696,"children":697},{"style":387},[698],{"type":61,"value":699},"'Authorization'",{"type":44,"tag":374,"props":701,"children":702},{"style":512},[703],{"type":61,"value":541},{"type":44,"tag":374,"props":705,"children":706},{"style":387},[707],{"type":61,"value":708},"'Bearer '",{"type":44,"tag":374,"props":710,"children":711},{"style":518},[712],{"type":61,"value":713}," +",{"type":44,"tag":374,"props":715,"children":716},{"style":512},[717],{"type":61,"value":718}," gs.",{"type":44,"tag":374,"props":720,"children":721},{"style":381},[722],{"type":61,"value":723},"getProperty",{"type":44,"tag":374,"props":725,"children":726},{"style":512},[727],{"type":61,"value":515},{"type":44,"tag":374,"props":729,"children":730},{"style":387},[731],{"type":61,"value":732},"'x_acme.webhookrelay_token'",{"type":44,"tag":374,"props":734,"children":735},{"style":512},[736],{"type":61,"value":737},"));\n",{"type":44,"tag":374,"props":739,"children":741},{"class":376,"line":740},7,[742,746,751,755,760,764,769],{"type":44,"tag":374,"props":743,"children":744},{"style":512},[745],{"type":61,"value":598},{"type":44,"tag":374,"props":747,"children":748},{"style":381},[749],{"type":61,"value":750},"setRequestBody",{"type":44,"tag":374,"props":752,"children":753},{"style":512},[754],{"type":61,"value":515},{"type":44,"tag":374,"props":756,"children":757},{"style":393},[758],{"type":61,"value":759},"JSON",{"type":44,"tag":374,"props":761,"children":762},{"style":512},[763],{"type":61,"value":443},{"type":44,"tag":374,"props":765,"children":766},{"style":381},[767],{"type":61,"value":768},"stringify",{"type":44,"tag":374,"props":770,"children":771},{"style":512},[772],{"type":61,"value":773},"({\n",{"type":44,"tag":374,"props":775,"children":777},{"class":376,"line":776},8,[778,783,788,793],{"type":44,"tag":374,"props":779,"children":780},{"style":512},[781],{"type":61,"value":782},"    event: current.",{"type":44,"tag":374,"props":784,"children":785},{"style":381},[786],{"type":61,"value":787},"operation",{"type":44,"tag":374,"props":789,"children":790},{"style":512},[791],{"type":61,"value":792},"(),            ",{"type":44,"tag":374,"props":794,"children":796},{"style":795},"--shiki-default:#6A737D",[797],{"type":61,"value":798},"// insert / update\n",{"type":44,"tag":374,"props":800,"children":802},{"class":376,"line":801},9,[803,808,813],{"type":44,"tag":374,"props":804,"children":805},{"style":512},[806],{"type":61,"value":807},"    sys_id: current.",{"type":44,"tag":374,"props":809,"children":810},{"style":381},[811],{"type":61,"value":812},"getUniqueValue",{"type":44,"tag":374,"props":814,"children":815},{"style":512},[816],{"type":61,"value":817},"(),\n",{"type":44,"tag":374,"props":819,"children":821},{"class":376,"line":820},10,[822,827,832,836,841],{"type":44,"tag":374,"props":823,"children":824},{"style":512},[825],{"type":61,"value":826},"    number: current.",{"type":44,"tag":374,"props":828,"children":829},{"style":381},[830],{"type":61,"value":831},"getValue",{"type":44,"tag":374,"props":833,"children":834},{"style":512},[835],{"type":61,"value":515},{"type":44,"tag":374,"props":837,"children":838},{"style":387},[839],{"type":61,"value":840},"'number'",{"type":44,"tag":374,"props":842,"children":843},{"style":512},[844],{"type":61,"value":845},"),\n",{"type":44,"tag":374,"props":847,"children":849},{"class":376,"line":848},11,[850,855,859,863,868],{"type":44,"tag":374,"props":851,"children":852},{"style":512},[853],{"type":61,"value":854},"    state: current.",{"type":44,"tag":374,"props":856,"children":857},{"style":381},[858],{"type":61,"value":831},{"type":44,"tag":374,"props":860,"children":861},{"style":512},[862],{"type":61,"value":515},{"type":44,"tag":374,"props":864,"children":865},{"style":387},[866],{"type":61,"value":867},"'state'",{"type":44,"tag":374,"props":869,"children":870},{"style":512},[871],{"type":61,"value":845},{"type":44,"tag":374,"props":873,"children":875},{"class":376,"line":874},12,[876,881,885,889,894],{"type":44,"tag":374,"props":877,"children":878},{"style":512},[879],{"type":61,"value":880},"    priority: current.",{"type":44,"tag":374,"props":882,"children":883},{"style":381},[884],{"type":61,"value":831},{"type":44,"tag":374,"props":886,"children":887},{"style":512},[888],{"type":61,"value":515},{"type":44,"tag":374,"props":890,"children":891},{"style":387},[892],{"type":61,"value":893},"'priority'",{"type":44,"tag":374,"props":895,"children":896},{"style":512},[897],{"type":61,"value":845},{"type":44,"tag":374,"props":899,"children":901},{"class":376,"line":900},13,[902,907,912,916,921],{"type":44,"tag":374,"props":903,"children":904},{"style":512},[905],{"type":61,"value":906},"    assignment_group: current.",{"type":44,"tag":374,"props":908,"children":909},{"style":381},[910],{"type":61,"value":911},"getDisplayValue",{"type":44,"tag":374,"props":913,"children":914},{"style":512},[915],{"type":61,"value":515},{"type":44,"tag":374,"props":917,"children":918},{"style":387},[919],{"type":61,"value":920},"'assignment_group'",{"type":44,"tag":374,"props":922,"children":923},{"style":512},[924],{"type":61,"value":845},{"type":44,"tag":374,"props":926,"children":928},{"class":376,"line":927},14,[929,934,938,942,947],{"type":44,"tag":374,"props":930,"children":931},{"style":512},[932],{"type":61,"value":933},"    short_description: current.",{"type":44,"tag":374,"props":935,"children":936},{"style":381},[937],{"type":61,"value":831},{"type":44,"tag":374,"props":939,"children":940},{"style":512},[941],{"type":61,"value":515},{"type":44,"tag":374,"props":943,"children":944},{"style":387},[945],{"type":61,"value":946},"'short_description'",{"type":44,"tag":374,"props":948,"children":949},{"style":512},[950],{"type":61,"value":951},")\n",{"type":44,"tag":374,"props":953,"children":955},{"class":376,"line":954},15,[956],{"type":44,"tag":374,"props":957,"children":958},{"style":512},[959],{"type":61,"value":960},"  }));\n",{"type":44,"tag":374,"props":962,"children":964},{"class":376,"line":963},16,[965,969,974],{"type":44,"tag":374,"props":966,"children":967},{"style":512},[968],{"type":61,"value":598},{"type":44,"tag":374,"props":970,"children":971},{"style":381},[972],{"type":61,"value":973},"executeAsync",{"type":44,"tag":374,"props":975,"children":976},{"style":512},[977],{"type":61,"value":589},{"type":44,"tag":374,"props":979,"children":981},{"class":376,"line":980},17,[982],{"type":44,"tag":374,"props":983,"children":984},{"style":512},[985],{"type":61,"value":986},"})(current, previous);\n",{"type":44,"tag":45,"props":988,"children":989},{},[990,992,998,1000,1006],{"type":61,"value":991},"Keep the token in a system property rather than in the script. If you prefer a stored REST message, put the same URL in its endpoint, add the ",{"type":44,"tag":101,"props":993,"children":995},{"className":994},[],[996],{"type":61,"value":997},"Authorization",{"type":61,"value":999}," header there (or a basic auth profile, if you chose basic auth on the bucket), and call it with ",{"type":44,"tag":101,"props":1001,"children":1003},{"className":1002},[],[1004],{"type":61,"value":1005},"new sn_ws.RESTMessageV2('Webhook Relay', 'post')",{"type":61,"value":443},{"type":44,"tag":344,"props":1008,"children":1010},{"id":1009},"_3-your-internal-service-receives-a-normal-post",[1011],{"type":61,"value":1012},"3. Your internal service receives a normal POST",{"type":44,"tag":45,"props":1014,"children":1015},{},[1016,1018,1023],{"type":61,"value":1017},"The agent delivers the request with the original headers and JSON body to ",{"type":44,"tag":101,"props":1019,"children":1021},{"className":1020},[],[1022],{"type":61,"value":187},{"type":61,"value":1024},". Nothing in the receiving code knows about ServiceNow's network or Webhook Relay. The bucket log shows each request next to the status and body your service returned, which settles most \"did ServiceNow send it?\" arguments quickly.",{"type":44,"tag":71,"props":1026,"children":1028},{"id":1027},"production-details",[1029],{"type":61,"value":1030},"Production details",{"type":44,"tag":196,"props":1032,"children":1033},{},[1034,1060,1085,1103,1113],{"type":44,"tag":114,"props":1035,"children":1036},{},[1037,1042,1044,1050,1052,1058],{"type":44,"tag":57,"props":1038,"children":1039},{},[1040],{"type":61,"value":1041},"Your side being down doesn't lose events.",{"type":61,"value":1043}," Webhook Relay accepts and stores the request immediately. Requests that arrive while no agent is connected wait in the bucket and can be ",{"type":44,"tag":90,"props":1045,"children":1047},{"href":1046},"/docs/webhooks/replay-on-agent-connect/",[1048],{"type":61,"value":1049},"replayed on reconnect",{"type":61,"value":1051},", and ",{"type":44,"tag":90,"props":1053,"children":1055},{"href":1054},"/features/durable-retries/",[1056],{"type":61,"value":1057},"durable retries",{"type":61,"value":1059}," keep retrying failed deliveries with backoff for up to 30 days. That beats relying on a business rule with no retry logic.",{"type":44,"tag":114,"props":1061,"children":1062},{},[1063,1068,1070,1075,1077,1083],{"type":44,"tag":57,"props":1064,"children":1065},{},[1066],{"type":61,"value":1067},"Lock down the input.",{"type":61,"value":1069}," Use the bucket token from step 1. ServiceNow doesn't publish one public list of outbound IPs. Each customer finds their instance's addresses through the ",{"type":44,"tag":491,"props":1071,"children":1072},{},[1073],{"type":61,"value":1074},"My IP Information",{"type":61,"value":1076}," request in the Now Support portal, and you can put those in an input's ",{"type":44,"tag":90,"props":1078,"children":1080},{"href":1079},"/features/ip-allowlist/",[1081],{"type":61,"value":1082},"source IP allowlist",{"type":61,"value":1084}," as a second layer.",{"type":44,"tag":114,"props":1086,"children":1087},{},[1088,1093,1095,1101],{"type":44,"tag":57,"props":1089,"children":1090},{},[1091],{"type":61,"value":1092},"Reshape without touching ServiceNow.",{"type":61,"value":1094}," If the internal API expects a different body, or a header ServiceNow can't easily set, attach a ",{"type":44,"tag":90,"props":1096,"children":1098},{"href":1097},"/features/transform-webhooks/",[1099],{"type":61,"value":1100},"transform function",{"type":61,"value":1102}," to the output instead of editing scripts in the instance.",{"type":44,"tag":114,"props":1104,"children":1105},{},[1106,1111],{"type":44,"tag":57,"props":1107,"children":1108},{},[1109],{"type":61,"value":1110},"Fan out.",{"type":61,"value":1112}," Add more outputs, or run agents in other network zones against the same bucket, to send one incident to several internal systems.",{"type":44,"tag":114,"props":1114,"children":1115},{},[1116,1121,1123,1129],{"type":44,"tag":57,"props":1117,"children":1118},{},[1119],{"type":61,"value":1120},"Test before wiring production.",{"type":61,"value":1122}," Point the REST message at a free ",{"type":44,"tag":90,"props":1124,"children":1126},{"href":1125},"/webhook-bin/",[1127],{"type":61,"value":1128},"Webhook Bin",{"type":61,"value":1130}," first to see the exact body your script produces.",{"type":44,"tag":71,"props":1132,"children":1134},{"id":1133},"mid-server-vs-webhook-relay",[1135],{"type":61,"value":1136},"MID Server vs Webhook Relay",{"type":44,"tag":1138,"props":1139,"children":1140},"table",{},[1141,1162],{"type":44,"tag":1142,"props":1143,"children":1144},"thead",{},[1145],{"type":44,"tag":1146,"props":1147,"children":1148},"tr",{},[1149,1153,1157],{"type":44,"tag":1150,"props":1151,"children":1152},"th",{},[],{"type":44,"tag":1150,"props":1154,"children":1155},{},[1156],{"type":61,"value":246},{"type":44,"tag":1150,"props":1158,"children":1159},{},[1160],{"type":61,"value":1161},"Webhook Relay",{"type":44,"tag":1163,"props":1164,"children":1165},"tbody",{},[1166,1185,1210,1228,1246,1264],{"type":44,"tag":1146,"props":1167,"children":1168},{},[1169,1175,1180],{"type":44,"tag":1170,"props":1171,"children":1172},"td",{},[1173],{"type":61,"value":1174},"Inbound firewall rule",{"type":44,"tag":1170,"props":1176,"children":1177},{},[1178],{"type":61,"value":1179},"No (outbound 443)",{"type":44,"tag":1170,"props":1181,"children":1182},{},[1183],{"type":61,"value":1184},"No (outbound agent)",{"type":44,"tag":1146,"props":1186,"children":1187},{},[1188,1193,1198],{"type":44,"tag":1170,"props":1189,"children":1190},{},[1191],{"type":61,"value":1192},"What you run on-prem",{"type":44,"tag":1170,"props":1194,"children":1195},{},[1196],{"type":61,"value":1197},"Java MID Server, sized and upgraded with the instance",{"type":44,"tag":1170,"props":1199,"children":1200},{},[1201,1203,1208],{"type":61,"value":1202},"A single ",{"type":44,"tag":101,"props":1204,"children":1206},{"className":1205},[],[1207],{"type":61,"value":384},{"type":61,"value":1209}," binary, container or Kubernetes operator",{"type":44,"tag":1146,"props":1211,"children":1212},{},[1213,1218,1223],{"type":44,"tag":1170,"props":1214,"children":1215},{},[1216],{"type":61,"value":1217},"Who sees the deliveries",{"type":44,"tag":1170,"props":1219,"children":1220},{},[1221],{"type":61,"value":1222},"ServiceNow admins, via the ECC Queue",{"type":44,"tag":1170,"props":1224,"children":1225},{},[1226],{"type":61,"value":1227},"Request log with responses, visible to the receiving team",{"type":44,"tag":1146,"props":1229,"children":1230},{},[1231,1236,1241],{"type":44,"tag":1170,"props":1232,"children":1233},{},[1234],{"type":61,"value":1235},"Events stored and retried if the receiver is down",{"type":44,"tag":1170,"props":1237,"children":1238},{},[1239],{"type":61,"value":1240},"Your script's job",{"type":44,"tag":1170,"props":1242,"children":1243},{},[1244],{"type":61,"value":1245},"Yes, up to 30 days with durable retries",{"type":44,"tag":1146,"props":1247,"children":1248},{},[1249,1254,1259],{"type":44,"tag":1170,"props":1250,"children":1251},{},[1252],{"type":61,"value":1253},"One event to several internal systems",{"type":44,"tag":1170,"props":1255,"children":1256},{},[1257],{"type":61,"value":1258},"One call per target in script",{"type":44,"tag":1170,"props":1260,"children":1261},{},[1262],{"type":61,"value":1263},"Several outputs or agents per bucket",{"type":44,"tag":1146,"props":1265,"children":1266},{},[1267,1272,1277],{"type":44,"tag":1170,"props":1268,"children":1269},{},[1270],{"type":61,"value":1271},"Also receives webhooks from other SaaS",{"type":44,"tag":1170,"props":1273,"children":1274},{},[1275],{"type":61,"value":1276},"No",{"type":44,"tag":1170,"props":1278,"children":1279},{},[1280],{"type":61,"value":1281},"Yes, any provider that can POST to a URL",{"type":44,"tag":71,"props":1283,"children":1285},{"id":1284},"related",[1286],{"type":61,"value":1287},"Related",{"type":44,"tag":196,"props":1289,"children":1290},{},[1291,1302,1313,1332,1343],{"type":44,"tag":114,"props":1292,"children":1293},{},[1294,1300],{"type":44,"tag":90,"props":1295,"children":1297},{"href":1296},"/features/webhook-to-internal-server/",[1298],{"type":61,"value":1299},"Webhooks to internal servers",{"type":61,"value":1301},": how the relay agent works.",{"type":44,"tag":114,"props":1303,"children":1304},{},[1305,1311],{"type":44,"tag":90,"props":1306,"children":1308},{"href":1307},"/blog/azure-relay-alternative/",[1309],{"type":61,"value":1310},"Azure Relay alternative",{"type":61,"value":1312},": when Hybrid Connections fits and when it doesn't.",{"type":44,"tag":114,"props":1314,"children":1315},{},[1316,1322,1324,1330],{"type":44,"tag":90,"props":1317,"children":1319},{"href":1318},"/blog/netsuite-webhooks/",[1320],{"type":61,"value":1321},"NetSuite webhooks",{"type":61,"value":1323}," and ",{"type":44,"tag":90,"props":1325,"children":1327},{"href":1326},"/blog/salesforce-outbound-messages/",[1328],{"type":61,"value":1329},"Salesforce Outbound Messages",{"type":61,"value":1331},": the same pattern for other enterprise systems.",{"type":44,"tag":114,"props":1333,"children":1334},{},[1335,1341],{"type":44,"tag":90,"props":1336,"children":1338},{"href":1337},"/solutions/incident-automation-webhooks/",[1339],{"type":61,"value":1340},"Incident automation webhooks",{"type":61,"value":1342},": routing alerts into on-prem automation.",{"type":44,"tag":114,"props":1344,"children":1345},{},[1346,1348,1354],{"type":61,"value":1347},"Rolling this out across a company? The ",{"type":44,"tag":90,"props":1349,"children":1351},{"href":1350},"/enterprise/",[1352],{"type":61,"value":1353},"enterprise page",{"type":61,"value":1355}," covers SOC 2 Type II, SSO, security reviews and invoice or PO billing.",{"type":44,"tag":1357,"props":1358,"children":1359},"style",{},[1360],{"type":61,"value":1361},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":592,"depth":592,"links":1363},[1364,1365,1366,1367,1372,1373,1374],{"id":73,"depth":554,"text":76},{"id":173,"depth":554,"text":176},{"id":231,"depth":554,"text":234},{"id":339,"depth":554,"text":342,"children":1368},[1369,1370,1371],{"id":346,"depth":592,"text":349},{"id":466,"depth":592,"text":469},{"id":1009,"depth":592,"text":1012},{"id":1027,"depth":554,"text":1030},{"id":1133,"depth":554,"text":1136},{"id":1284,"depth":554,"text":1287},"markdown","content:blog:servicenow-webhooks.md","content","blog/servicenow-webhooks.md","blog/servicenow-webhooks","md",{"loc":4},1794984484111]