App
This document details how plugins can reverse invoke App services within the Dify platform. It covers three types of interfaces Chat interface (for Chatbot/Agent/Chatflow applications), Workflow interface, and Completion interface, providing entry points, invocation specifications, and practical code examples for each.
Reverse invoking an App means that a plugin can access data from an App within Dify. This module supports both streaming and non-streaming App calls. If you are unfamiliar with the basic concepts of reverse invocation, please first read Reverse Invocation of Dify Services.
Interface Types:
- For
Chatbot/Agent/Chatflow
type applications, they are all chat-based applications and thus share the same input and output parameter types. Therefore, they can be uniformly treated as the Chat Interface. - For Workflow applications, they occupy a separate Workflow Interface.
- For Completion (text generation application) applications, they occupy a separate Completion Interface.
Please note that plugins are only allowed to access Apps within the Workspace where the plugin resides.
Calling the Chat Interface
Entry Point
Interface Specification
When response_mode
is streaming
, this interface will directly return Generator[dict]
. Otherwise, it returns dict
. For specific interface fields, please refer to the return results of ServiceApi
.
Use Case
We can call a Chat type App within an Endpoint
and return the result directly.
Calling the Workflow Interface
Entry Point
Interface Specification
Calling the Completion Interface
Entry Point
Interface Specification
Related Resources
- Reverse Invocation of Dify Services - Understand the fundamental concepts of reverse invocation
- Reverse Invocation Model - Learn how to call model capabilities within the platform
- Reverse Invocation Tool - Learn how to call other plugins
- Develop a Slack Bot Plugin - A practical application case using reverse invocation
- Develop Extension Plugins - Learn how to develop extension plugins