diff --git a/docs/docs/cloud/how-tos/cron_jobs.md b/docs/docs/cloud/how-tos/cron_jobs.md index 72205e46d..3a4eb5e47 100644 --- a/docs/docs/cloud/how-tos/cron_jobs.md +++ b/docs/docs/cloud/how-tos/cron_jobs.md @@ -1,4 +1,4 @@ -# Cron Jobs +# Use cron jobs Sometimes you don't want to run your graph based on user interaction, but rather you would like to schedule your graph to run on a schedule - for example if you wish for your graph to compose and send out a weekly email of to-dos for your team. LangGraph Platform allows you to do this without having to write your own script by using the `Crons` client. To schedule a graph job, you need to pass a [cron expression](https://crontab.cronhub.io/) to inform the client when you want to run the graph. `Cron` jobs are run in the background and do not interfere with normal invocations of the graph. diff --git a/docs/docs/cloud/how-tos/webhooks.md b/docs/docs/cloud/how-tos/webhooks.md index cb32da710..4cada4c9f 100644 --- a/docs/docs/cloud/how-tos/webhooks.md +++ b/docs/docs/cloud/how-tos/webhooks.md @@ -1,10 +1,10 @@ -# Using Webhooks +# Use webhooks When working with LangGraph Platform, you may want to use webhooks to receive updates after an API call completes. Webhooks are useful for triggering actions in your service once a run has finished processing. To implement this, you need to expose an endpoint that can accept `POST` requests and pass this endpoint as a `webhook` parameter in your API request. Currently, the SDK does not provide built-in support for defining webhook endpoints, but you can specify them manually using API requests. -## Supported Endpoints +## Supported endpoints The following API endpoints accept a `webhook` parameter: @@ -20,7 +20,7 @@ The following API endpoints accept a `webhook` parameter: In this guide, we’ll show how to trigger a webhook after streaming a run. -## Setting Up Your Assistant and Thread +## Set up your assistant and thread Before making API calls, set up your assistant and thread. @@ -56,7 +56,8 @@ curl --request POST \ --data '{}' ``` -### Example Response +Example response: + ```json { "thread_id": "9dde5490-2b67-47c8-aa14-4bfec88af217", @@ -69,7 +70,7 @@ curl --request POST \ } ``` -## Using a Webhook with a Graph Run +## Use a webhook with a graph run To use a webhook, specify the `webhook` parameter in your API request. When the run completes, LangGraph Platform sends a `POST` request to the specified webhook URL. @@ -119,11 +120,11 @@ curl --request POST \ }' ``` -## Webhook Payload +## Webhook payload LangGraph Platform sends webhook notifications in the format of a [Run](../../cloud/concepts/runs.md). See the [API Reference](https://langchain-ai.github.io/langgraph/cloud/reference/api/api_ref.html#model/run) for details. The request payload includes run input, configuration, and other metadata in the `kwargs` field. -## Securing Webhooks +## Secure webhooks To ensure only authorized requests hit your webhook endpoint, consider adding a security token as a query parameter: @@ -133,7 +134,7 @@ https://my-server.app/my-webhook-endpoint?token=YOUR_SECRET_TOKEN Your server should extract and validate this token before processing requests. -## Testing Webhooks +## Test webhooks You can test your webhook using online services like: @@ -141,7 +142,3 @@ You can test your webhook using online services like: - **[Webhook.site](https://webhook.site/)** – View, debug, and log incoming webhook requests in real time. These tools help you verify that LangGraph Platform is correctly triggering and sending webhooks to your service. - ---- - -By following these steps, you can integrate webhooks into your LangGraph Platform workflow, automating actions based on completed runs.