You can have your agents send information to external services, like third-party apps or your organization's internal tools, using a webhook step. A webhook sends an HTTP request to a specific URL you provide. For example, you could post a message to a Slack channel.
Important: When you add variables to third-party integration steps, add-on steps, or the webhook step, they might contain your Google Account data, such as the contents of a message in Gmail or Chat, or event information from Calendar. The agent can then share your Google Account data with a third-party service. Make sure you trust the third-party service.
Add a webhook step
- Go to https://studio.workspace.google.com and create an agent.
- In your agent, click Add step and then click Send a webhook.
- Set up the webhook step with these options:
- Webhook or API URL (required): Enter the full destination URL, including http:// or https://. This box requires a static URL. It doesn't allow variables for security reasons. The URL is stored securely.
- Method (required): Choose the HTTP method for your request. The default is POST.
- GET: Retrieve data from a URL.
- POST: Send data to create something, like a message or record..
- PUT: Send data to replace existing data.
- PATCH: Send data to do a partial update.
- DELETE: Remove data.
- Payload (optional): Enter the content for the request body. Payload is ignored for GET requests.
Note: Payload is sent as plain text. You can use any format, but we recommend using JSON format to easily send data to web services. If you use a variable to add content to the payload, make sure the variable’s content doesn't break the payload’s format. On this page, see Example payloads.
- (Optional) Add a step to use the webhook’s response. The webhook step outputs the response as plain text in a variable that you can add to later steps. You can add an AI powered step that cleans up or extracts content from the response.
- (Optional) To try your agent, click Test run. A test run runs your agent once, taking real actions so you can see the outcome. Select the starting conditions, then click Start. Learn more about test runs.
- When your agent is ready, click Turn on.
Example payloads
|
Method |
Example payload |
|
POST |
{ "text": "Hello world!" } |
|
GET |
payload is ignored for GET requests |
|
PUT |
{ "contactId": "<variable>", "email": "[email protected]" } |
|
DELETE |
{ "recordId": "<variable>", } |
|
PATCH |
{ "recordId": "<variable>", } |
Monitor your webhook activity
After an agent runs, you can check the Activity tab to see what the webhook did.
- If it worked, you see the data that was sent and the response that was returned.
- If it had issues, you see an error message with the full error code and response from the destination URL to help you troubleshoot.
Google, Google Workspace, and related marks and logos are trademarks of Google LLC. All other company and product names are trademarks of the companies with which they are associated.