https://github.com/flow-ai/example-node-webhook
Flow.ai Node.js Webhook example
https://github.com/flow-ai/example-node-webhook
example
Last synced: 11 months ago
JSON representation
Flow.ai Node.js Webhook example
- Host: GitHub
- URL: https://github.com/flow-ai/example-node-webhook
- Owner: flow-ai
- License: mit
- Created: 2017-12-18T13:56:47.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-09-11T21:26:31.000Z (over 1 year ago)
- Last Synced: 2025-01-28T18:13:49.118Z (about 1 year ago)
- Topics: example
- Language: JavaScript
- Size: 115 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flow.ai Node.js Webhook Example
[Webhooks](https://docs.flow.ai/overview/code/webhook.html) are an integration method of Flow.ai based on a *we call you* principle.

## Getting started
### 1. Install [Node.js](https://nodejs.org)
### 2. Clone this repo and install packages
```bash
git clone https://github.com/flow-ai/example-node-webhook.git
cd flowai-example-node-webhook
npm install
```
### 3. Run the webhook server
```bash
npm start
```
The server will run on http://localhost:3009 and print incoming webhooks.
### 4. Deploy online or fire up a ngrok tunnel
**Deploy to heroku**
[](https://heroku.com/deploy)
**Run a local [ngrok](https://ngrok.com/) tunnel**
```bash
ngrok http -subdomain=inconshreveable 80
```
This tells `ngrok` to tunnel all requests to `https://inconshreveable.ngrok.com` to your `localhost:3009`.
### 5. Configure your webhook
To get started, go the the [Flow.ai dashboard](https://app.flow.ai/integrations) and create a new webhook integration.
Enter the url of your webhook endpoint and press save.
### 6. Receive calls
Next, configure a flow with the [design app](https://app.flow.ai/design) that triggers an action. For the action select the webhook you just created.
That's really all it takes to start responding to webhook calls.
## Further reading
Please view our [webhook documentation](https://flow.ai/docs/actions/webhook) for more info about the messages you receive and how to send messages back.