Skip to main content

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

Time required

10 minutes

Prerequisites

Basic Python knowledge and a Flomo account

Step 1: Install the Dify CLI and create a project

1

Install Dify CLI

Verify installation:
2

Initialize a plugin project

Create a new plugin project using:
Follow the prompts to set up your plugin:
  • Name it “flomo”
  • Select “tool” as the plugin type
  • Complete other required fields
3

Navigate to the project

This will create 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

Create a flomo.yaml file to define your tool interface:

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

1

Set up debug environment

Copy the example environment file:
Edit the .env file with your Dify environment details:
You can find your debug key and host in the Dify dashboard: click the “Plugins” icon in the top right corner, then click the debug icon. In the pop-up window, copy the “API Key” and “Host Address”.
2

Install dependencies and run

Your plugin will connect to your Dify instance in debug mode.
3

Test functionality

In your Dify instance, navigate to plugins and find your debugging 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

Make sure your .env file is properly configured and you’re using the correct debug key.
Double-check your Flomo API URL format. It should be in the form: https://flomoapp.com/iwh/{token}/{secret}/
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! This same pattern works for integrating with thousands of services - from databases and search engines to productivity tools and custom APIs.

Documentation

Write your README.md in English (en_US) describing functionality, setup, and usage examples

Localization

Create additional README files like readme/README_zh_Hans.md for other languages

Edit this page | Report an issue