Skip to content

docs: prompt webhooks #805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 22, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/prompt_engineering/how_to_guides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Organize and manage prompts in LangSmith to streamline your LLM development work
- [Manage prompts programmatically](./how_to_guides/manage_prompts_programatically)
- [Prompt tags](./how_to_guides/prompt_tags)
- [LangChain Hub](./how_to_guides/langchain_hub)
- [Trigger a webhook on prompt commit](./how_to_guides/trigger_webhook)

## Playground

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions docs/prompt_engineering/how_to_guides/trigger_webhook.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
sidebar_position: 10
---

# Trigger a webhook on prompt commit

You can configure a webhook to be triggered whenever a commit is made to a prompt.

Some common use cases of this include:

- Triggering a CI/CD pipeline when prompts are updated
- Synchronizing prompts with a GitHub repository
- Notifying team members about prompt modifications

## Configure a webhook

Navigate to the **Prompts** section in the left-hand sidebar or from the application homepage.
In the top right corner, click on the `+ Webhook` button.

Add a webhook **url** and any required **headers**.

To test out your webhook, click the "Send test notification" button. This will send a test notification to the webhook url you provided with a sample payload.

The sample payload is a JSON object with the following fields:

- `prompt_id`: The id of the prompt that was committed.
- `prompt_name`: The name of the prompt that was committed.
- `commit_hash`: The commit hash of the prompt.
- `created_at`: The date of the commit.
- `created_by`: The author of the commit.
- `manifest`: The manifest of the prompt.

## Trigger the webhook

Commit to a prompt to trigger the webhooks you've configured.

### Using the Playground

If you do this in the Playground, you'll be prompted to deselect any webhooks you'd like to avoid triggering.

![](./static/commit_prompt_playground.png)

### Using the API

If you commit via the API, you can specify to skip triggering all webhooks by setting the `skip_webhooks` parameter to `true` or to specify specific webhooks to trigger by setting the `ignore_webhook_ids` parameter to a list of webhook ids.
See API docs [here](https://api.smith.langchain.com/redoc#tag/commits/operation/create_commit_api_v1_commits__owner___repo__post) for more information.
Loading