Webhook Input
Webhook Input gives your flow its own address on the internet. When another application sends data to that address, for example your online shop when it receives an order, or your CRM when a customer is created, the flow runs and receives that data.
It is the starting point of flows that must react to what happens in other tools, without anyone having to start them by hand.
When to use it
- Process every new order your online shop notifies you about.
- Send a welcome email to every customer who signs up on your website.
- Record in a spreadsheet the forms your visitors submit.
- Connect NappAI with any tool that lets you set up notifications to a web address.
Configuration
| Field | What it does |
|---|---|
| Data | Used to test the flow in the editor: paste a sample of the data the other application will send. When the flow runs through its webhook, this field is filled with the data received. |
Getting the webhook address
- Deploy a version of the flow: webhook calls run the deployed version. See Versions and publishing.
- Open the API Access window and go to the Webhook tab.
- Pick the API Key the call will use and copy the address. See API keys.
- Paste that address in the other application, where its notifications or webhooks are set up.
Testing the webhook from the editor
When the flow has a Webhook Input, the editor shows the Test Webhook button. Click it and the editor starts Listening …: when the next call reaches the webhook, its data appears in the Data field and the flow runs in the editor, so you can see the result step by step.
Output
The Data output returns the data received, with the same structure the other application sent. If what arrives is not in a valid data format, it comes through as it is, as a single text inside the data.
Connect it to Parse Data or Get Value By Key to pick out the values you need, or straight to an agent.
Example
An online shop wants to notify its warehouse of each order:
- Add Webhook Input and paste a sample order in Data to build the flow.
- Connect Data to an agent that writes a summary with the products and the shipping address.
- Email the summary to the warehouse.
- Deploy the flow, copy the address from the Webhook tab and set it up in your shop as the new-order notification.
Good practices
- A flow can only have one webhook component.
- Don’t share the webhook address: it includes the API key, and anyone who has it can run the flow.
Related components
- Telegram Webhook: starts the flow with the messages of a Telegram bot.