app icon
Salesforce Integration
0.0.1

Seamlessly integrate with Salesforce to access and interact with your organization's data and records.

eric-2369/salesforce321 installs

salesforce-dify-plugin

A comprehensive Dify plugin that enables seamless integration with Salesforce, providing powerful data access and
interaction capabilities for your AI workflows.

  • Author: eric-2369
  • Version: 0.0.1
  • Type: tool

Features

  • Secure Authentication: Robust authentication with automatic credential management
  • Smart Session Management: Intelligent session handling with automatic token storage and refresh
  • Auto Recovery: Automatic error handling and session recovery for uninterrupted workflows
  • Comprehensive Logging: Full logging integration with Dify's plugin logging system
  • Multi-language Support: English, Chinese, and Portuguese interface support
  • High Performance: Optimized for efficient Salesforce data operations

Installation

  1. Install the plugin in your Dify environment
  2. Configure your Salesforce credentials in the plugin settings

Configuration

Required Credentials

  1. Salesforce Login URL

    • Production:
    • Sandbox:
  2. Salesforce Username

    • Your Salesforce account username
  3. Salesforce Password + Security Token

    • Your password concatenated with your security token (no space between them)
    • Example: If password is and token is , enter

Getting Your Security Token

  1. Log in to Salesforce
  2. Go to Setup → My Personal Information → Reset My Security Token
  3. Click "Reset Security Token"
  4. Check your email for the new security token

Usage

Data Retrieval

Retrieve account information:

Query contacts with specific criteria:

Access related data across objects:

API Response Format

The plugin returns results in the following JSON format:

Technical Architecture

Session Management

  • Secure Authentication: Robust authentication with Salesforce
  • Token Storage: Persistent session storage using Dify's KV storage
  • Automatic Refresh: Intelligent token lifecycle management
  • Error Recovery: Automatic error handling and session recovery

Security Features

  • Secure Credential Storage: All credentials are securely stored in Dify
  • Session Management: Proactive session management and renewal
  • Error Handling: Comprehensive error handling with user-friendly messages

Performance Optimization

  • Session Caching: Efficient session reuse to minimize overhead
  • Optimized Requests: High-performance API communication
  • Memory Management: Efficient resource usage in serverless environment

Error Handling

The plugin provides comprehensive error handling for common scenarios:

  • Invalid Credentials: Clear messages for authentication failures
  • Network Issues: Timeout and connection error handling
  • Query Syntax Errors: Detailed error messages for invalid queries
  • API Limits: Proper handling of Salesforce API limits
  • Session Expiry: Automatic session refresh and retry

Logging

The plugin uses Dify's logging system to record:

  • Authentication attempts and results
  • Data query executions
  • Session refresh operations
  • Error conditions and resolutions

Troubleshooting

Common Issues

  1. Authentication Failed

    • Verify your username and password
    • Ensure security token is current and correctly concatenated
    • Check if your Salesforce org allows API access
  2. Invalid Query

    • Verify query syntax is correct
    • Ensure you have permission to access the queried objects
    • Check field names and object names are correct
  3. Network Timeouts

    • Check your network connection
    • Verify the Salesforce login URL is correct
    • Ensure firewall allows outbound HTTPS connections

Development

Project Structure

Key Components

  • SalesforceSessionManager: Handles authentication and session management
  • SalesforceProvider: Validates credentials during plugin configuration
  • SoqlQueryTool: Executes data queries with automatic error handling

License

This project is licensed under the terms specified in the LICENSE file.

Support

For issues and questions:

  1. Check the troubleshooting section above
  2. Review Salesforce API documentation
  3. Contact the plugin author
CATEGORY
Tool
VERSION
0.0.1
eric-2369·06/23/2025 01:59 AM
REQUIREMENTS
Maximum memory
256MB
Maximum storage
4KB