ServiceNow · Arazzo Workflow

ServiceNow Publish Knowledge Article

Version 1.0.0

Create a knowledge article draft on the kb_knowledge table, read it, then publish it.

1 workflow 1 source API 1 provider
View Spec View on GitHub AutomationCloud ServicesDigital WorkflowsEnterprise PlatformIT Service ManagementITSMProcessesT1Workflow AutomationWorkflowsArazzoWorkflows

Provider

servicenow

Workflows

publish-knowledge-article
Author a knowledge article draft and publish it.
Creates a kb_knowledge draft, reads it back, and moves it to a published state.
3 steps inputs: category, knowledgeBase, publishedState, shortDescription, text outputs: articleSysId
1
createDraft
createRecord
Create a draft article in the kb_knowledge table.
2
getArticle
getRecord
Read the draft article back by sys_id to confirm it persisted before publishing.
3
publishArticle
patchRecord
Patch the article's workflow_state to move it into the published state.

Source API Descriptions

Arazzo Workflow Specification

servicenow-publish-knowledge-article-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: ServiceNow Publish Knowledge Article
  summary: Create a knowledge article draft on the kb_knowledge table, read it, then publish it.
  description: >-
    The knowledge-base authoring flow over the Table API. ServiceNow has no
    dedicated knowledge write API, so the generic Table API drives the
    kb_knowledge table. The workflow creates a draft article, reads it back by
    sys_id to confirm it persisted, and then patches its workflow_state to
    publish it. The Table API wraps each single record under a result object.
    Every request is written inline.
  version: 1.0.0
sourceDescriptions:
- name: tableApi
  url: ../openapi/servicenow-table-api-openapi.yml
  type: openapi
workflows:
- workflowId: publish-knowledge-article
  summary: Author a knowledge article draft and publish it.
  description: >-
    Creates a kb_knowledge draft, reads it back, and moves it to a published
    state.
  inputs:
    type: object
    required:
    - shortDescription
    - text
    properties:
      shortDescription:
        type: string
        description: The article title / short description.
      text:
        type: string
        description: The article body content.
      knowledgeBase:
        type: string
        description: The sys_id of the knowledge base to file the article under.
      category:
        type: string
        description: The sys_id of the article category.
      publishedState:
        type: string
        description: The workflow_state value representing Published (e.g. "published").
  steps:
  - stepId: createDraft
    description: >-
      Create a draft article in the kb_knowledge table.
    operationId: createRecord
    parameters:
    - name: tableName
      in: path
      value: kb_knowledge
    requestBody:
      contentType: application/json
      payload:
        short_description: $inputs.shortDescription
        text: $inputs.text
        kb_knowledge_base: $inputs.knowledgeBase
        kb_category: $inputs.category
        workflow_state: draft
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      articleSysId: $response.body#/result/sys_id
  - stepId: getArticle
    description: >-
      Read the draft article back by sys_id to confirm it persisted before
      publishing.
    operationId: getRecord
    parameters:
    - name: tableName
      in: path
      value: kb_knowledge
    - name: sys_id
      in: path
      value: $steps.createDraft.outputs.articleSysId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      confirmedSysId: $response.body#/result/sys_id
  - stepId: publishArticle
    description: >-
      Patch the article's workflow_state to move it into the published state.
    operationId: patchRecord
    parameters:
    - name: tableName
      in: path
      value: kb_knowledge
    - name: sys_id
      in: path
      value: $steps.createDraft.outputs.articleSysId
    requestBody:
      contentType: application/json
      payload:
        workflow_state: $inputs.publishedState
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      articleSysId: $response.body#/result/sys_id
      updatedOn: $response.body#/result/sys_updated_on
  outputs:
    articleSysId: $steps.publishArticle.outputs.articleSysId