npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-dify-chat-model

v1.0.1

Published

N8N custom node for Dify Chat Model API with cache support - Compatible with AI Agent

Readme

N8N Dify Chat Model Node

N8N custom node for integrating Dify Chat Model API with cache support. This node is compatible with N8N's AI Agent and allows you to use Dify's caching capabilities to reduce token costs significantly.

🎯 Features

  • Compatible with N8N AI Agent - Works seamlessly with AI Agent Chat Model output
  • Cache Support - Leverages Dify's cache to reduce token costs
  • Conversation Persistence - Supports continuing existing conversations
  • Flexible Configuration - Configurable response modes (blocking/streaming)
  • Input Variables - Support for custom input variables
  • Secure Credentials - Secure credential management

📦 Installation

Via N8N Community Nodes (Recommended)

  1. Open your N8N instance
  2. Go to SettingsCommunity Nodes
  3. Search for n8n-nodes-dify-chat-model
  4. Click Install
  5. Restart N8N if prompted

Via npm

npm install n8n-nodes-dify-chat-model

Then restart your N8N instance.

🚀 Usage

1. Configure Credentials

  1. Add the Dify Chat Model node to your workflow
  2. Click on Credential to connect with
  3. Click Create New Credential
  4. Select Dify API
  5. Fill in:
    • API Key: Your Dify API key
    • Base URL: https://api.dify.ai (or your self-hosted URL)
  6. Click Save

2. Configure the Node

  • App ID: Your Dify Application ID (required)
  • User ID: User identifier (optional, default: "n8n-user")
  • Conversation ID: To continue existing conversations (optional)
  • Response Mode: "Blocking" (recommended for AI Agent)
  • Input Variables: Additional variables as JSON object (optional)
  • Query: Automatically picks up from AI Agent output

3. Connect to AI Agent

Connect this node to the Chat Model output of your AI Agent node.

💡 Why Use This Node?

  • 💰 Cost Savings: Dify's cache significantly reduces token usage compared to direct LLM calls
  • 🔌 Compatibility: Works seamlessly with N8N's AI Agent
  • 🌐 Flexibility: Supports both cloud and self-hosted Dify instances
  • ⚡ Performance: Faster responses with cached results

📋 Requirements

  • N8N version 1.0.0 or higher
  • Dify API access (cloud or self-hosted)
  • Dify Application ID

🔧 Development

# Install dependencies
npm install

# Build the project
npm run build

# Watch mode for development
npm run dev

# Lint
npm run lint

# Format code
npm run format

📖 Documentation

🐛 Issues & Support

For issues and questions:

📝 License

MIT

🙏 Credits

Built for the N8N community to enable cost-effective AI agent workflows with Dify's caching capabilities.