HOW TO

Run a notebook as a webhook

First Published: July 24, 2026
Last Published: July 24, 2026

Summary

Webhooks configured for a feature service or an organization can be used as triggers to run a notebook, that is, run the notebook as webhook.  Webhook receivers in this example are created and hosted by ArcGIS Notebook Server. The image below shows webhook URLs for Organization and Service webhooks. These webhook receivers are associated with specific notebook items that will be run as webhooks. 

webhook URLs for Organization and Service webhooks

This article demonstrates how to configure webhooks (service and organization webhooks) that are used to trigger a notebook that captures a payload and saves the received payload as a JSON file. 

Procedure

Create a notebook script in ArcGIS Notebook Server (see image below, payload_to_json notebook) . The notebook item will be created in the My content page in Portal for ArcGIS. The script does the following;

  • It makes a folder in user's workspace if it doesn't exist. for example, a Json folder.
  • It creates a timestamped json file with the current date and time.
  • It writes the payload to JSON, that is, it takes the webhookPayload variable received from ArcGIS Enterprise and converts it to JSON format.

converting the payload to JSON

Organization webhooks

  1. Create an organization webhook: Organization > Settings > Webhooks > Organizations webhooks > Create webhook.
    1. Select the Type that triggers the webhook, for example, All.
    2. Choose Notebook, and associate it with the notebook payload_to_json.

creating the webhook

  1. Secret is optional.
  1. Create an item in Portal to trigger the webhook, for example, create a hosted feature layer item.
  2. This creates an executeNotebookAsWebhook job on the ArcGIS Notebook server. Open the job at the ArcGIS Notebook Server Admin API, as shown in the next image, and note that under Jobs, the payload is injected into the job. The payload shows the item ID for the content added, and other properties for the  webhookpayload.

job shown in the ArcGIS Notebook Server Admin API

details of job

  1. Open the notebook item from the My Content page and notice the json file in Files tab, shown in the next image

JSON file shown in the Files tab

  1. Open the JSON file. It shows the payload injected to the job

details of the JSON file

Service webhooks 

  1. Create a webhook receiver in the ArcGIS Notebook Server admin API. See the related article, "How to create a webhook receiver in ArcGIS Notebook server". Use the item ID associated with the notebook to execute it. that is, the payload_to_Json  notebook.
  2. Create a service webhook: Organization >Settings > Webhooks > service webhooks > Create webhook.
    1. Select a feature service in Service that will trigger the webhook, for example, the below image shows a feature service named Facilities was used.
    2. The Events section pop ups after a feature service is selected, and select All, for example.
    3. In the Webhook URL section, copy and paste the webhook receiver URL created in Step 1.
    4. Secret is optional, but use the secret associated with developer credentials app used when creating the webhook  URL (Step1, and see related article).

creating the service webhook receiver

  1. Make edits on the feature service, for example, add new features.

After this, follow the same steps from 3 throug 5, above, shown for Organization webhooks. The payload however will be different as the webhookPayload variable has properties about the feature service, for example, it includes the property ChangesUrl, the URL that points to a Feature Service operation that returns list of edits made such as adds, updates and deletes.

Article ID: 000041949

Software:
  • ArcGIS Notebook Server

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options