ServiceNow: Retrieve Runbook or Knowledge Base Article

📘

Availability

This workflow action is available on Business and Enterprise for Incident Management pricing plans. Contact the Sales Team to upgrade to an account with this action.

Description

The action obtains a Bearer token using the same OAuth password grant as the Workflow Integration, then reads Knowledge article data from ServiceNow. You can identify an article by URL, sys_id, or KB number; if you leave the identifier blank, the action returns the first 10 articles from the primary Knowledge table query (up to the API limit configured in the integration).

Include Attachments defaults to false. When set to true, the action adds JSON metadata about attachments linked to the article (not the attachment file binaries).

Prerequisites

  • A ServiceNow instance with OAuth password grant configured and a Workflow Integration connection using ServiceNow OAuth Connection fields as described in Creating a Workflow Integration.
  • The integration user and OAuth client must allow successful token exchange and read access to the Knowledge tables and attachment API used by the action.
  • Managed Knowledge / sn_km_mr_st_kb_knowledge available on the instance if you rely on this action’s default code paths.

Instructions

  1. If you have not done so, follow the instructions to Create an Incident Workflow.
  2. When the instructions prompt you to add actions, select this action.
  3. Enter the following Inputs and click Save.
  4. Continue following instructions to Publish the Workflow.
  5. When the action runs, you will see the Outputs listed below.

Inputs

📘

Field References

Fields with the {+} icon accept Field References, which can be useful for referencing incident data or outputs created in prior workflow steps. To add Field References, click {+}, or enter {{, and select relevant fields. Refer to the Field References article for more information.

NameDescription
ServiceNow OAuth ConnectionThe ServiceNow OAuth Workflow Integration connection (URL, OAuth client, and user credentials configured in PagerDuty). If you have not yet configured a ServiceNow OAuth integration, please see the ServiceNow Integration instructions.
Knowledge Article URL or KB NumberA full article URL (including sys_id or sysparm_article as used by your instance), a 32-character sys_id, a KB number (for example KB0012345), or leave blank to retrieve the first 10 articles returned by the default table query.
Include AttachmentsWhen true, retrieves metadata about attachments associated with the article as JSON. Default: false.

How the action resolves articles

  • Article URL — If the value looks like a URL and contains kb_knowledge, sys_id, or sysparm_article, the action extracts a 32-character sys_id from sys_id= or sysparm_article= query parameters. If no sys_id can be parsed, the action fails with an error asking for a valid URL.
  • sys_id only — If you paste a 32-character hexadecimal string, it is treated as sys_id directly.
  • KB number — Otherwise, non-empty text is treated as a KB number (for example KB0012345). The action queries the Knowledge table and selects the matching article from the result set.
  • Blank input — If the field is empty (or only placeholder-like quotes), the action requests the first 10 articles (sysparm_limit=10) without a KB number filter. Downstream steps should handle multiple results only if your workflow expects list behavior.

Outputs

NameDescription
KB NumberArticle identifier (for example KB0012345).
Short DescriptionArticle title.
Article ContentFull article body in plain text as returned by ServiceNow.
AuthorArticle author (display value when provided by the API).
Knowledge BaseName of the knowledge base containing the article (from supplemental fields when available).
Workflow StateCurrent workflow state of the article when returned by ServiceNow.
Last UpdatedTimestamp of the last update.
Last Updated ByUser who last updated the article (display value when available).
AttachmentsJSON attachment metadata when Include Attachments is true and the attachment API succeeds; omitted when attachment retrieval is off or not returned.
ResultSuccess or Failed.
Result SummaryShort description of the outcome.
ErrorPopulated when the action fails (for example missing connection, OAuth failure, article not found, or API errors).