--- title: Trigger flows with webhooks slug: /webhook --- import Icon from "@site/src/components/icon"; You can use the **Webhook** component to start a flow run in response to an external event. With the **Webhook** component, a flow can receive data directly from external sources. Then, the flow can parse the data and pass it to other components in the flow to initiate other actions, such as calling APIs, writing to databases, and chatting with LLMs. If the input isn't valid JSON, the **Webhook** component wraps it in a `payload` object so that it can be accepted as input to trigger the flow. The **Webhook** component provides a versatile entrypoint that can make your flows more event-driven and integrated with your entire stack of applications and services. For example: * Use an LLM to analyze the sentiment and content of customer feedback or survey responses. * Receive notifications from a monitoring system, and then trigger automated responses based on alert type and severity. * Integrate with e-commerce platforms to process orders and update inventory. ## Configure the Webhook component To use the **Webhook** component in a flow, do the following: 1. In Langflow, open the flow where you want to use the **Webhook** component. 2. Add a [**Webhook** component](/webhook) and a [**Parser** component](/parser) to your flow. These two components are commonly paired together because the **Parser** component extracts relevant data from the raw payload received by the **Webhook** component. 3. Connect the **Webhook** component's **Data** output to the **Parser** component's **Data** input. 4. In the **Parser** component's **Template** field, enter a template to parse the raw payload into structured text. In the template, use variables for payload keys in the same way you would define variables in a [**Prompt Template** component](/components-prompts). For example, assume that you expect your **Webhook** component to receive the following JSON data: ```json { "id": "", "name": "", "email": "" } ``` Then, you can [use curly braces](/components-prompts#define-variables-in-prompts) to reference the JSON keys anywhere in your parser template: ```text ID: {id} - Name: {name} - Email: {email} ``` 5. Connect the **Parser** component's **Parsed Text** output to the next logical component in your flow, such as a **Chat Input** component. If you want to test only the **Webhook** and **Parser** components, you can connect the **Parsed Text** output directly to a **Chat Output** component's **Text** input. Then, you can see the parsed data in the **Playground** after you run the flow. 6. From the **Webhook** component's **Endpoint** field, copy the API endpoint that you will use to send data to the **Webhook** component and trigger the flow. Alternatively, to get a complete `POST /v1/webhook/$FLOW_ID` code snippet, open the flow's [**API access** pane](/concepts-publish#api-access), and then click the **Webhook curl** tab. You can also modify the default curl command in the **Webhook** component's **curl** field. If this field isn't visible by default, click the **Webhook** component to expose the [component inspection panel](/concepts-components#component-menus). 7. Send a POST request with `data` to the flow's `webhook` endpoint to trigger the flow. The following example sends a payload containing `id`, `name`, and `email` strings: ```bash curl -X POST "http://localhost:7860/api/v1/webhook/FLOW_ID" \ -H "Content-Type: application/json" \ -H "x-api-key: LANGFLOW_API_KEY" \ -d '{"id": "12345", "name": "alex", "email": "alex@email.com"}' ``` A successful response indicates that Langflow started the flow. The response doesn't include the output for the entire flow, only an indication that the flow started. ```json { "message": "Task started in the background", "status": "in progress" } ``` 8. To view the flow's most recent parsed payload, click the **Parser** component, and then click