What You’ll Build#
By the end of this guide, you’ll have created a Dify plugin that:
- Connects to the Flomo note-taking API
- Allows users to save notes from AI conversations directly to Flomo
- Handles authentication and error states properly
- Is ready for distribution in the Dify Marketplace
10 minutes
Basic Python knowledge and a Flomo account
Step 1: Install the Dify Plugin CLI and Create a Project#
Install Dify Plugin CLI
Download the latest binary from the Dify Plugin Daemon releases page. Pick dify-plugin-linux-amd64 for x86_64 or dify-plugin-linux-arm64 for ARM.
Verify the installation:
Initialize a plugin project
Create a new plugin project using:
Follow the prompts to set up your plugin:
- Name it
flomo - Select
toolas the plugin type - Complete the other required fields
Navigate to the project
The project contains the basic structure for your plugin with all necessary files.
Step 2: Define Your Plugin Manifest#
The manifest.yaml file defines your plugin’s metadata, permissions, and capabilities.
Create a manifest.yaml file:
Step 3: Create the Tool Definition#
A tool plugin uses two YAML files: a provider file that declares credentials and lists the tools, and one tool file per callable tool. See General Specifications for the full schema.
Create provider/flomo.yaml:
Create tools/flomo.yaml:
Step 4: Implement Core Utility Functions#
Create a utility module in utils/flomo_utils.py for API interaction:
Step 5: Implement the Tool Provider#
The Tool Provider handles credential validation. Create provider/flomo.py:
Step 6: Implement the Tool#
The Tool class handles actual API calls when the user invokes the plugin. Create tools/flomo.py:
Always handle exceptions gracefully and return user-friendly error messages. Remember that your plugin represents your brand in the Dify ecosystem.
Step 7: Test Your Plugin#
Set up debug environment
Copy the example environment file:
Edit the .env file with your Dify environment details:
You can find your debug URL and key in the Dify dashboard: click the Plugins icon in the top-right corner, then click the debug icon. Copy the API Key and Host Address (the host already includes the port).
Install dependencies and run
Your plugin will connect to your Dify instance in debug mode.
Test functionality
In your Dify instance, open the Plugins page and find your plugin (marked as debugging). Add your Flomo API credentials and test sending a note.
Step 8: Package and Distribute#
When you’re ready to share your plugin:
This creates a plugin.difypkg file you can upload to the Dify Marketplace.
FAQ and Troubleshooting#
Plugin doesn't appear in debug mode
Make sure your .env file is properly configured and you’re using the correct debug key.
API authentication errors
Double-check your Flomo API URL format. It should be in the form: https://flomoapp.com/iwh/{token}/{secret}/
Packaging fails
Ensure all required files are present and the manifest.yaml structure is valid.
Summary#
You’ve built a functioning Dify plugin that connects with an external API service. The same pattern works for integrating with thousands of services—from databases and search engines to productivity tools and custom APIs.
Write your README.md in English (en_US) describing functionality, setup, and usage examples
Create additional README files like readme/README_zh_Hans.md for other languages