Trigger a dify app from webhook.
This project is a Dify Plugin that enables seamless triggering of Dify applications using webhooks. With this plugin, you can effortlessly initiate both chatflows and workflows through HTTP requests from any third-party system. 🚀
Star and watch our GitHub repository at https://github.com/perzeuss/dify-plugin-webhook to be notified about new releases! The project is open source, feel free to fork and modify it!
Visit the Dify Plugin marketplace, search for the "Webhook" plugin and click the install button. After installation, click on the "Webhook" plugin on the plugins page.
Create Endpoint:
In the Endpoints section, click the "+" icon to create a unique webhook domain. You can choose any name you want. Each endpoint can have its own configuration, such as individualized credentials and request handling.
Configure API Key:
After installing the plugin, ensure you have set up an API key in your settings, unless using the option for the API key location. For other configurations, this key is necessary for authenticating requests.
Configure API Key Location:
The API key can be utilized in various ways for compatibility with 3rd party systems:
Middleware Support:
The plugin supports the use of custom middlewares for request validation, transformations, and more. Built-in support for Discord webhooks is included, and you can add more middleware for other integrations. Please open a GitHub issue before working on custom middlewares - at the moment there is no dedicated middleware api and you might need to modify the main plugin code to support additional middleware features.
Specify Input Handling:
You have the option to specify whether to use or the entire for input variables. This flexibility enhances integration with third-party systems that don't support defining the request payload structure required by Dify.
JSON String Input:
Enable this option to automatically convert the entire request body to a JSON string. This is particularly useful when you want to pass a complex payload through a single input variable in Dify and parse it within your application logic.
Specify Output Handling:
Configure the output data from workflows. The webhook can send res.body.data (Output of the End node) as the response body without Dify metadata. By default the response contains metada which could conflict with the requirements of your integration.
Available Endpoints:
You have access to the following endpoint URLs:
Trigger a chatflow by sending a POST request to the chatflow endpoint:
For endpoints configured with a specific Dify app, use the route. A successful response will include the chatflow output.
To initiate a workflow, send a POST request to the workflow endpoint:
For endpoints configured with a specific Dify app, use the route. The response will contain results from the workflow execution.
The plugin supports middleware for extended functionality:
Discord Webhook Integration:
Built-in support for Discord interaction verification and response handling.
Default Middleware:
Provides JSON string conversion functionality.
Custom Middlewares:
You can develop additional middlewares to:
You can create multiple endpoints with different configurations. For example:
For workflows that need to integrate with systems expecting specific response formats:
Leverage the power of Dify by automating your chatflow and workflow triggers efficiently using this webhook plugin! 🎉
Special thanks to the Dify team for delivering a fantastic developer experience and tools that facilitated the creation of this plugin. The first version of this plugin was developed during a beta program, and we appreciate the support and resources made available throughout the period. ❤️*