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 🙏

© 2025 – Pkg Stats / Ryan Hefner

n8n-nodes-plex-datasource

v1.0.17

Published

n8n node for calling Plex ERP Data Sources

Downloads

57

Readme

n8n Plex ERP Data Source Node

An n8n community node for calling Plex ERP Data Sources via REST API. This node enables seamless integration with Plex ERP systems by executing data source queries with configurable parameters, authentication, and retry mechanisms.

Features

  • 🌐 Multi-Environment Support: Production and test environments
  • 🏢 Flexible Deployment: Support for both cloud and on-premise (colo) Plex deployments
  • 🔐 Secure Authentication: Basic Auth credentials with secure storage
  • 🛠️ Configurable Body Parameters: Form-based key-value pairs or raw JSON input
  • 🔄 Retry Mechanism: Configurable retry logic with exponential backoff
  • 📊 Data Type Conversion: Automatic conversion for strings, numbers, booleans, and dates
  • ⚙️ Advanced Settings: Timeout configuration, redirect handling
  • 🚫 Null Handling: Optional null value filtering

Installation

To install this community node in n8n:

Option 1: n8n Community Nodes (Recommended)

  1. Go to SettingsCommunity Nodes in your n8n instance
  2. Click Install a community node
  3. Enter: n8n-nodes-plex-datasource
  4. Click Install

Option 2: Manual Installation

# For n8n installed via npm
npm install n8n-nodes-plex-datasource

# For n8n installed via Docker
# Add the package to your Docker setup

Option 3: Local Development

# Clone this repository
git clone https://github.com/your-username/n8n-nodes-plex-datasource.git
cd n8n-nodes-plex-datasource

# Install dependencies
pnpm install

# Build the project
pnpm run build

# Link to your n8n installation
npm link

Configuration

1. Credentials Setup

Before using the node, set up your Plex API credentials:

  1. Go to Credentials in n8n
  2. Click Add Credential
  3. Select Plex Basic Auth API
  4. Enter your Plex username and password
  5. Test the connection
  6. Save the credential

2. Node Configuration

Basic Settings

  • Description: Free text description of what this data source call does
  • Environment: Choose between Production or Test
  • Colo Name: Enter colo name for on-premise deployments (leave blank for cloud)
  • Data Source ID: The unique identifier for your Plex data source

URL Generation

The node automatically generates the correct API URL based on your configuration:

  • Cloud Production: https://cloud.plex.com/api/datasources/{ID}/execute?format=2
  • Cloud Test: https://test.cloud.plex.com/api/datasources/{ID}/execute?format=2
  • Colo Production: https://{colo}.on.plex.com/api/datasources/{ID}/execute?format=2
  • Colo Test: https://{colo}.test.on.plex.com/api/datasources/{ID}/execute?format=2

Body Configuration

Choose between two input methods:

Key-Value Form
  • Key: Parameter name
  • Value: Parameter value
  • Data Type: string, number, boolean, or date
  • Skip if Null: Skip parameter if value is null/empty
  • Data Format: Format specification for dates (e.g., YYYY-MM-DD)
Raw JSON

Direct JSON input for complex request bodies.

Advanced Settings

  • Retry on Failure: Enable automatic retry
  • Max Retry Attempts: 1-10 attempts
  • Retry Wait Time: 100-30000ms between retries
  • Request Timeout: 1000-300000ms timeout
  • Follow Redirects: Enable/disable redirect following

Usage Examples

Simple Data Source Query

{
  "environment": "production",
  "dataSourceId": "12345",
  "bodyInputMethod": "form",
  "bodyParameters": {
    "parameter": [
      {
        "key": "startDate",
        "value": "2024-01-01",
        "dataType": "date",
        "format": "YYYY-MM-DD"
      },
      {
        "key": "limit",
        "value": "100",
        "dataType": "number"
      }
    ]
  }
}

Complex JSON Query

{
  "environment": "test",
  "coloName": "mycompany",
  "dataSourceId": "67890",
  "bodyInputMethod": "json",
  "jsonBody": {
    "filters": {
      "dateRange": {
        "start": "2024-01-01",
        "end": "2024-12-31"
      },
      "departments": ["manufacturing", "quality"]
    },
    "groupBy": ["department", "shift"],
    "metrics": ["count", "average"]
  }
}

Response Format

The node returns a structured response:

{
  "statusCode": 200,
  "headers": {
    "content-type": "application/json",
    "content-length": "1234"
  },
  "body": {
    // Plex API response data
  },
  "requestUrl": "https://cloud.plex.com/api/datasources/12345/execute?format=2",
  "executionTime": 1500
}

Error Handling

The node provides comprehensive error handling:

  • Connection Errors: Network connectivity issues
  • Authentication Errors: Invalid credentials
  • API Errors: Plex-specific error responses
  • Timeout Errors: Request timeout exceeded
  • Validation Errors: Invalid parameters

Retry Logic

When retry is enabled:

  • Exponential backoff between attempts
  • Configurable max attempts (1-10)
  • Configurable wait time (100-30000ms)

Troubleshooting

Common Issues

Authentication Failed

  • Verify your credentials are correct
  • Test the credential connection
  • Check if your account has API access

Timeout Errors

  • Increase the timeout setting
  • Check network connectivity
  • Verify the data source exists

Invalid Data Source ID

  • Ensure the ID is numeric
  • Verify the data source exists in your Plex environment
  • Check environment (production vs test)

Invalid JSON Body

  • Validate your JSON syntax
  • Use the form-based input for simpler parameters
  • Check for special characters or encoding issues

Debug Mode

Enable debug mode in n8n to see detailed request/response information:

  1. Set N8N_LOG_LEVEL=debug in your environment
  2. Check n8n logs for detailed HTTP request information
  3. Verify the generated URL is correct

Development

Requirements

  • Node.js 18+
  • pnpm 7+
  • TypeScript 5+

Setup

# Clone the repository
git clone https://github.com/your-username/n8n-nodes-plex-datasource.git
cd n8n-nodes-plex-datasource

# Install dependencies
pnpm install

# Development build with watch
pnpm run dev

# Production build
pnpm run build

# Run tests
pnpm test

# Lint code
pnpm run lint

# Format code
pnpm run format

Project Structure

├── credentials/           # Credential type definitions
├── nodes/                # Node implementations
│   └── PlexDataSource/   # Main node
├── icons/                # Node icons
├── test/                 # Test files
├── dist/                 # Compiled output
└── docs/                 # Additional documentation

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Run pnpm run lint and pnpm test
  6. Submit a pull request

License

MIT License - see LICENSE file for details.

Support

Changelog

Version 1.0.0

  • Initial release
  • Basic Auth support
  • Multi-environment support (production/test)
  • Cloud and on-premise deployment support
  • Configurable retry mechanism
  • Form-based and JSON body input
  • Comprehensive error handling
  • Data type conversion
  • Null value filtering