> ## Documentation Index
> Fetch the complete documentation index at: https://www.composer.id/llms.txt
> Use this file to discover all available pages before exploring further.

# ServiceNow

> Developer notes for the ServiceNow upstream connector: Service Portal widgets, Employee Center, Glide session auth and the round trip into the instance.

These are developer notes for the ServiceNow upstream connector: how Triage's diagnostic embeds in ServiceNow's Service Portal and Employee Center as a widget, authenticated through the requester's existing ServiceNow session. With ServiceNow the journey is a round trip: the request starts in the instance, Triage diagnoses it, and composerID publishes the decision back into the same instance. This page documents the upstream half; the destination half is on the [ServiceNow destination page](/destinations/servicenow), and the gateway itself is described in [Upstream connectors](/connectors/overview).

<Info>
  The ServiceNow connector is on the roadmap. The reference implementation ships renderers for Microsoft Teams, Slack and Google Chat; the ServiceNow widget described here is not yet in the repository. Every platform fact on this page is grounded in ServiceNow's developer documentation, listed under Developer references.
</Info>

## Platform at a glance

<AccordionGroup>
  <Accordion title="Embedding surface" icon="layers">
    A Service Portal widget (`sp_widget`) embedded in a portal page or an Employee Center topic page. The widget runs inside ServiceNow's AngularJS runtime and has access to server-side GlideRecord through its server script.
  </Accordion>

  <Accordion title="Employee Center" icon="building-2">
    Employee Center is ServiceNow's unified request experience, built on top of Service Portal. A topic page can host the Triage widget so the diagnostic appears alongside the Service Catalog and Knowledge Base.
  </Accordion>

  <Accordion title="Authentication" icon="key-round">
    The requester is already signed in to ServiceNow. The widget's server script runs in the user's Glide session, giving access to `gs.getUserID()` and `gs.getUserName()` with no separate login. Outbound calls to Triage carry an OAuth 2.0 token issued by a ServiceNow OAuth application registry entry.
  </Accordion>

  <Accordion title="Question rendering" icon="list">
    A standard Service Portal HTML template with AngularJS bindings. Each question is rendered as a card inside the widget; answer options use `ng-click` handlers that post the selection to the server script.
  </Accordion>

  <Accordion title="Lock in place" icon="lock">
    Once the requester selects an answer, the widget replaces the question card with a read-only summary and renders the next question below it. The scroll-forward pattern mirrors the locked-card behaviour on Teams and Slack.
  </Accordion>

  <Accordion title="Back-sync" icon="arrow-right-left">
    ServiceNow is also a composerID [destination](/destinations/servicenow). When the decision publishes, it lands back in the same instance as an Import Set upsert keyed on `correlation_id`, so the record that started the request also carries its outcome and the deep link.
  </Accordion>

  <Accordion title="UI Builder" icon="wrench">
    UI Builder (ServiceNow's Next Experience page builder) cannot build or configure base-system service portals such as Employee Center; ServiceNow's own docs direct you to Service Portal Designer for those. The Service Portal widget is therefore the embedding path for Employee Center, not an interim one.
  </Accordion>

  <Accordion title="Tenancy" icon="server">
    Each ServiceNow instance is a separate tenant. The widget is deployed through an Update Set or a scoped application installed from the ServiceNow Store; per-instance diagnostic configuration lives in Triage.
  </Accordion>
</AccordionGroup>

## How the diagnostic runs in ServiceNow

| Step | What happens on the platform                                                                                                                                                                                                                                                                                                                           |
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 1    | The requester opens a Service Portal page or Employee Center topic that contains the Triage widget. ServiceNow renders the widget inside the portal's AngularJS runtime.                                                                                                                                                                               |
| 2    | The widget's server script reads the requester's identity from the Glide session (`gs.getUserID()`) and passes it to the gateway.                                                                                                                                                                                                                      |
| 3    | The gateway returns the first question. The widget renders it as a card with answer-option buttons bound through `ng-click`.                                                                                                                                                                                                                           |
| 4    | On selection, the widget posts the answer to the server script, which forwards it to the gateway. The answered question card is replaced with a locked summary and the next question is rendered below.                                                                                                                                                |
| 5    | On the final answer the gateway calls the Triage decision core. The Intent Record is minted and the completion card (channel, confidence, `intent://` chip) is rendered in the widget.                                                                                                                                                                 |
| 6    | When composerID publishes downstream, the decision returns to the instance it came from. An [Import Set upsert keyed on `correlation_id`](/destinations/servicenow) updates the originating ServiceNow record with the outcome and a deep link to the created object, whether that object lives in another destination system or in ServiceNow itself. |

## Developer references

ServiceNow's official developer documentation. The platform facts on this page are grounded in these pages.

| Reference                              | Vendor documentation                                                                                                                                |
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| ServiceNow developer portal            | [developer.servicenow.com](https://developer.servicenow.com/)                                                                                       |
| Service Portal widgets                 | [docs.servicenow.com: Portal Widgets](https://docs.servicenow.com/bundle/latest/page/build/service-portal/concept/c_Portal-Widgets.html)            |
| Employee Center                        | [docs.servicenow.com: Employee Center](https://docs.servicenow.com/bundle/latest/page/administer/employee-center/concept/employee-center.html)      |
| REST API (Table API)                   | [docs.servicenow.com: Table API](https://docs.servicenow.com/bundle/latest/page/integrate/inbound-rest/concept/c_TableAPI.html)                     |
| OAuth 2.0 application registry         | [docs.servicenow.com: OAuth Applications](https://docs.servicenow.com/bundle/latest/page/administer/security/concept/c_OAuthApplications.html)      |
| UI Builder overview (scope and limits) | [servicenow.com/docs: UI Builder](https://www.servicenow.com/docs/r/application-development/ui-builder/ui-builder-overview.html)                    |
| Service Portal versus Employee Center  | [servicenow.com/docs: SP versus EC](https://www.servicenow.com/docs/r/employee-service-management/employee-experience-foundation/sp-versus-ec.html) |
| Update Sets                            | [docs.servicenow.com: Update Sets](https://docs.servicenow.com/bundle/latest/page/build/system-update-sets/concept/system-update-sets.html)         |
| Flow Designer REST step                | [docs.servicenow.com: Flow Designer](https://docs.servicenow.com/bundle/latest/page/administer/flow-designer/concept/flow-designer.html)            |

## Next steps

<Columns cols={2}>
  <Card title="ServiceNow as a destination" icon="plug" href="/destinations/servicenow">
    The Import Set upsert that carries the decision back into the instance.
  </Card>

  <Card title="Upstream connectors" icon="messages-square" href="/connectors/overview">
    The Intake Gateway, the card lifecycle and the hand-off to composerID.
  </Card>
</Columns>
