AI HelpCenter | YourGPT

Find answers to your questions

How to Create and Test Webhooks in Studio?
Learn how to create, configure, and test webhooks to Connect Your AI Agent with External Services

Webhooks allow your AI Agent to interact with external services by sending and receiving data in real time. This guide walks you through setting up a webhook in Studio.


1. Setting Up a Webhook

Step 1: Create a Webhook Endpoint

webhook-node-add-in-canvas
  1. Open Studio and navigate to the Flows section.

  2. From Start Category, add the Webhook node.

add-webhook-name
  1. In the setup panel, enter a name for the webhook.

  2. Click Create Webhook to generate the endpoint.

Step 2: Copy the Webhook URL

Copy-webhook-endpoint-url-or-start-testing
  • After creating the webhook, you will receive a Webhook URL.

  • Copy this URL for further integration with external services.

  • Use the copied Webhook URL to send the required data in the request body.

Step 3: Test the Webhook in Studio

webhook-test-output-(stripe-example)
  • In the Webhook section in Studio, click Start Testing.

  • Send test requests to verify that the webhook is functioning as expected.

Step 4: Verify Incoming Webhook Data

  • The webhook will receive data from the external system, confirming the event.

  • Click Continue Mapping to proceed with structuring the response data.

Step 5: Map Incoming Data

webhook-data-mapping
  • Match the received data fields with corresponding variables in your AI Agent flow.

  • Ensure correct mapping to process responses efficiently.

  • Store the retrieved data in a Flow Variable to use further in decision-making or responses.


Example: Webhook for Payment Processing

Scenario:

An AI Agent is used in an e-commerce platform to process customer payments securely. When a user makes a payment, the AI Agent sends a webhook request to the payment gateway and receives a confirmation response.

Implementation:

  1. Webhook Name: Payment Processing

  2. Webhook Request:

    • Method: POST

    • URL: https://payment-gateway.com/api/charge

    • Payload:

      {
        "user_id": "12345",
        "order_id": "67890",
        "amount": "99.00",
        "currency": "USD",
        "payment_method": "card",
        "metadata":{
         "session_uid":1292383920
       }
      }
  3. Webhook Response Mapping:

    • Transaction Status: success

    • Transaction ID: txn_abc123

    • Payment Mode: UPI

    • Amount: $99.00

  4. Final AI Response:

    • "Your payment of $99.00 has been successfully processed via UPI. Transaction ID: txn_abc123. Thank you for your purchase!"


Was this article helpful?
©2025
Powered by YourGPT