A plugin can reverse invoke an App within Dify to access its data, with both streaming and non-streaming calls. If you are unfamiliar with the basics of reverse invocation, first read Reverse Invocation of Dify Services.
Interface Types:
- Chat Interface:
Chatbot,Agent, andChatflowapplications are all chat-based and share the same input and output parameter types, so they share this interface. - Workflow Interface: Used by Workflow applications.
- Completion Interface: Used by Completion (text generation) applications.
Plugins can only access Apps within the Workspace where the plugin resides.
Call the Chat Interface#
Entry Point#
Interface Specification#
When response_mode is streaming, this interface returns Generator[dict]; otherwise it returns dict. For the specific interface fields, see the return results of ServiceApi.
Use Case#
This example calls a Chat type App within an Endpoint and returns the result directly:
Call the Workflow Interface#
Entry Point#
Interface Specification#
Call 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