Set up bi-directional webhook for the GitHub spoke

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 6분
  • Configure webhook to subscribe to GitHub with a ServiceNow callback URL.

    시작하기 전에

    • Request Integration Hub subscription
    • Activate the GitHub spoke
    • Role required: admin

    Register GitHub webhook in ServiceNow

    Register a GitHub in ServiceNow to notify the ServiceNow app when certain events occur in GitHub.

    시작하기 전에

    Role required: admin

    프로시저

    1. Navigate to All > GitHub Webhooks > GitHub Webhook Registries.
    2. Click New.
    3. On the form, fill in the fields.
      표 1. GitHub Webhook Registry form
      Field Description
      Name Unique name to identify the record. For example, GitHub webhook.
      Description Description of the record.
    4. Right-click the form header and click Save.
    5. Click Callback URL.
      The system displays the Webhook Callback URL and Webhook Secret.

      Values of the generated Webhook Callback URL and Webhook Secret.

    6. Copy and record the values of Webhook Callback URL and Webhook Secret.

    결과

    The GitHub webhook is registered in your ServiceNow instance.

    Add Callback URL in GitHub

    Provide Webhook Callback URL in GitHub account to create webhook.

    시작하기 전에

    Role required: admin

    프로시저

    1. Log in to your GitHub account.
    2. Navigate to the required repository.
    3. Select Settings.
    4. On the left panel, select, Webhooks.
    5. Select Add Webhook.
    6. Enter Webhook Callback URL in Payload URL and Secret in Secret.

      See the GitHub Developer documentation for instructions on creating and configuring a webhook.

      주:
      GitHub spoke supports application/json payload. Configure the GitHub webhook accordingly. See the GitHub Developer documentation for instructions on creating and configuring a webhook.

    결과

    The Callback URL is added in the GitHub account. You can create routing policies and subflows as per your requirement. See Customize a bi-directional webhook for information regarding creating new routing policies and subflows.

    Customize bi-directional webhook in the GitHub spoke

    Create webhook routing policy and subflow as per your requirement in the GitHub spoke.

    시작하기 전에

    Role required: admin

    이 태스크 정보

    The default routing policy in the GitHub WebHook Routing Policies modules triggers the relevant GitHub subflow and notifies the ServiceNow app when certain events occur in GitHub. See GitHub Spoke for information about the GitHub fields that the default routing policy supports and the GitHub events that the subflows support. To use any other fields in your custom subflow and customize conditions in the routing policy, perform these steps.

    프로시저

    1. Navigate to All > Process Automation > Workflow Studio.
    2. Click Subflows.
    3. Create a copy of the required subflow.
    4. Customize the required subflow as per your requirement and publish it.
      See Building subflows for more information about creating and using subflows and GitHub Spoke for information about the GitHub fields that the default routing policy supports and the GitHub events that the subflows support.
    5. Navigate to GitHub Webhooks > GitHub WebHook Routing Policies.
    6. Click New.
    7. On the form, fill in the fields.
      표 2. Decision form
      Field Description
      Label Unique label to identify the routing policy.
      Default answer Option to specify if this is the default answer. Default answer is applicable when the conditions are not met.
      Condition Conditions to be met when the required events occur in GitHub. See GitHub Spoke for information about the supported fields.
      Answer Subflow that has to be triggered when the specified conditions are met.
      1. Click the Lookup icon.
      2. Select the required subflow from the Document: list.
        주:
        Ensure that the Table name is Flow [sys_hub_flow].
    8. Click Submit.
      주:
      These routing policies are saved in the Decision tables. Users are cautioned against directly updating or modifying data in these tables.

    결과

    Routing policy and subflow are created.