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-pcloud

v1.6.3

Published

n8n node for pCloud cloud storage integration

Readme

n8n-nodes-pcloud# n8n-nodes-pcloud

npm versionnpm version

License: MITLicense: MIT

Build Status

A comprehensive n8n community node for integrating with pCloud cloud storage service.

A comprehensive n8n community node for integrating with pCloud cloud storage service.

📋 Table of Contents

Features

Installation

✨ Features

  1. Install the node from npm:
  • File Operations: Upload, download, delete, move, and get file information

  • Folder Operations: Create, delete, list, and rename folders ```bash

  • Trigger Support: Automatically trigger workflows when files/folders are created or modified npm install @n8n/n8n-nodes-pcloud

  • OAuth 2.0 Support: Secure OAuth2 authentication ```

  • 2FA Support: Works with accounts that have two-factor authentication enabled

  • Multiple Auth Methods: Username/password, access token, or OAuth22. Restart your n8n instance

  • Region Support: Works with both EU and US pCloud regions

  • Binary Data Handling: Full support for binary file data in workflows3. The pCloud node will be available in the node palette under "Community Nodes"

  • Error Handling: Comprehensive error handling with human-readable messages

Dependencies

📦 Installation

pCloud SDK Integration

Install in n8n

While the pCloud n8n node is designed to work independently without requiring the official pCloud JavaScript SDK, it incorporates several design patterns and fallback strategies inspired by the SDK for enhanced reliability and performance.

  1. Community Installation (Recommended):

    
    cd ~/.n8n/custom
    
    npm install n8n-nodes-pcloudFor advanced use cases or when you need features not covered by the n8n node, you can optionally integrate the official pCloud SDK alongside your n8n workflows:
    

2. Restart your n8n instance:npm install pcloud-sdk-js

   ```bash```

   systemctl restart n8n

   # orThe n8n node and SDK can work together seamlessly:

   pm2 restart n8n

   ```- **n8n Node**: Handles standard file/folder operations within workflows

- **pCloud SDK**: Provides access to advanced features like bulk operations, detailed metadata, or custom API calls

3. The pCloud node will be available in the node palette

#### SDK-Inspired Features

## 🔐 Authentication Setup

The n8n node implements several reliability patterns from the pCloud SDK:

### For Accounts WITH 2FA Enabled (Recommended)

- **Automatic API Server Switching**: Falls back to alternative pCloud API servers during outages

If your pCloud account has two-factor authentication enabled, you **cannot** use username/password directly. Instead, generate an access token:- **Intelligent Retry Logic**: Categorizes errors and applies appropriate retry strategies

- **Connection Pooling**: Reuses HTTP connections for better performance

#### Step 1: Generate Access Token- **Request Batching**: Groups multiple operations for efficiency

- **Metadata Caching**: Caches frequently accessed file/folder information

Run the token generator script:

#### When to Use the SDK Directly

```bash

cd ~/.n8n/custom/node_modules/n8n-nodes-pcloudConsider using the pCloud SDK directly when you need:

node scripts/generate-access-token.js

```- Bulk operations across thousands of files

- Advanced sharing and permission management

The script will prompt you for:- Real-time file monitoring

- Region (EU or US)- Custom API integrations

- Email address- Features not yet supported by the n8n node

- Password

- 2FA code (6 digits from your authenticator app)### Core Dependencies



**Example output:**The pCloud n8n node has minimal dependencies for optimal performance:

╔════════════════════════════════════════════════════════════╗- axios (^1.6.0): HTTP client for API communication

║ ✓ SUCCESS! ║- form-data (^4.0.0): Multipart form data handling for file uploads

╚════════════════════════════════════════════════════════════╝- n8n-workflow (^1.0.0): n8n workflow engine integration

Your pCloud Access Token:## Usage

┌────────────────────────────────────────────────────────────┐### Credentials

│ kSDe5LnVbZvBJy7v3xXZHWkZ7cHnZGX7vXZ │

└────────────────────────────────────────────────────────────┘Configure your pCloud credentials in n8n:


1. Go to Settings > Credentials

#### Step 2: Configure n8n Credentials2. Create a new credential for "pCloud API"

3. Select your region (EU or US)

1. In n8n, go to **Settings → Credentials**4. Choose authentication method:

2. Click **Create New** → Select **pCloud API**   - **Username & Password**: Enter your pCloud email and password

3. Configure:   - **Access Token**: Enter your pCloud access token

   - **Region**: Select EU or US (same as your account)

   - **Authentication Method**: Select **Access Token**### Node Configuration

   - **Access Token**: Paste the token from Step 1

4. Click **Save**The pCloud node supports the following operations:



✅ The token will remain valid until you change your pCloud password or revoke it.#### File Operations



---- **Upload**: Upload files to pCloud

- **Download**: Download files from pCloud

### For Accounts WITHOUT 2FA- **Delete**: Delete files from pCloud

- **Move**: Move or rename files

1. In n8n, go to **Settings → Credentials**- **Get Info**: Get file metadata

2. Click **Create New** → Select **pCloud API**

3. Configure:#### Folder Operations

   - **Region**: Select EU or US

   - **Authentication Method**: Select **Username & Password**- **Create**: Create new folders

   - **Username**: Your pCloud email- **Delete**: Delete folders

   - **Password**: Your pCloud password- **List**: List folder contents

4. Click **Save**- **Rename**: Rename folders



---### Example Workflow



## 🔧 Nodes```

[Webhook] → [pCloud Upload] → [pCloud Get Info] → [HTTP Response]

### pCloud Node```



The main node for performing file and folder operations.This example workflow:



### pCloud Trigger Node (NEW!)1. Receives a file via webhook

2. Uploads it to pCloud

Automatically trigger workflows when changes occur in your pCloud account.3. Gets file information

4. Returns the file info as a response

**Trigger Events:**

- **File Created**: Trigger when a new file is added## SDK Integration Examples

- **File Modified**: Trigger when a file is updated

- **File Deleted**: Trigger when a file is removedThe pCloud n8n node is designed to work seamlessly with the official pCloud JavaScript SDK. Here are some examples showing how to combine n8n workflows with direct SDK usage:

- **Folder Created**: Trigger when a new folder is created

- **Any Change**: Trigger on any file or folder change### File Upload with SDK Validation



**Configuration:**```javascript

- **Folder Path**: Which folder to monitor// Using pCloud SDK for validation before n8n upload

- **Recursive**: Monitor subfolders as wellimport { createClient } from 'pcloud-sdk-js';

- **File Name Filter**: Filter by pattern (e.g., `*.pdf`)

- **Poll Interval**: How often to check (1-1440 minutes)const client = createClient('your-access-token');



---// Validate folder exists before upload

try {

## 📚 Examples  const folderInfo = await client.listfolder({ path: '/uploads' });

  console.log('Folder exists:', folderInfo.metadata.name);

### Example 1: Auto-Process New Invoices} catch (error) {

  // Create folder if it doesn't exist

```  await client.createfolder({ path: '/uploads' });

[pCloud Trigger] → [pCloud Download] → [PDF Extract] → [Google Sheets]}

// Now use n8n node for the actual upload in your workflow

Example 2: Monitor File Changes// n8n node parameters:

// - folderPath: "/uploads"


[pCloud Trigger] → [Send Email Notification]```

Batch File Operations



## 🐛 Troubleshooting// Using SDK for batch operations alongside n8n

import { createClient } from 'pcloud-sdk-js';

### Issue: "Two-factor authentication required" Error

const client = createClient('your-access-token');

**Solution**: Generate and use an access token instead (see authentication setup above).

// Get multiple file stats

### Issue: Trigger Not Firingconst filePaths = ['/docs/file1.pdf', '/docs/file2.docx', '/docs/file3.xlsx'];

const fileStats = await Promise.all(

**Check:**  filePaths.map(path => client.stat({ path }))

- Credentials are valid);

- Folder path exists

- Poll interval is set correctly// Process results in n8n workflow

// n8n can then use this metadata for conditional logic

---```



## 📄 License### OAuth Flow Integration



MIT License - see [LICENSE](LICENSE) file for details```javascript

// SDK OAuth flow that works with n8n credentials

---import { createClient } from 'pcloud-sdk-js';



## 📊 Version History// Use the same access token from n8n credentials

const client = createClient(process.env.PCLOUD_ACCESS_TOKEN);

### v1.0.4 (Latest)

- ✨ Added pCloud Trigger node// The SDK client can be used for operations not covered by n8n nodes

- ✨ Added access token generator for 2FAconst userInfo = await client.userinfo();

- 🐛 Fixed 2FA authentication issuesconsole.log('Authenticated user:', userInfo.email);

- 📝 Updated documentation

// Use n8n nodes for standard operations, SDK for advanced features

---```



**Made with ❤️ for the n8n community**### Error Handling with SDK


```javascript
// Robust error handling combining SDK and n8n patterns
import { createClient } from 'pcloud-sdk-js';

const client = createClient('your-access-token');

async function safeUpload(filePath, folderPath) {
  try {
    // Check quota first using SDK
    const userInfo = await client.userinfo();
    const usedBytes = userInfo.usedquota;
    const totalBytes = userInfo.quota;
    const freeBytes = totalBytes - usedBytes;

    if (freeBytes < 1024 * 1024) { // Less than 1MB free
      throw new Error('Insufficient storage space');
    }

    // Proceed with n8n upload node
    // n8n handles the actual upload with retry logic
    return { success: true, message: 'Upload ready' };

  } catch (error) {
    console.error('Upload preparation failed:', error.message);
    return { success: false, error: error.message };
  }
}

Advanced File Management

// Complex file management using SDK features
import { createClient } from 'pcloud-sdk-js';

const client = createClient('your-access-token');

async function organizeFiles() {
  // List all files in root
  const rootContents = await client.listfolder({ path: '/' });

  // Group files by type
  const filesByType = {};
  for (const item of rootContents.metadata.contents) {
    if (!item.isfolder) {
      const ext = item.name.split('.').pop().toLowerCase();
      if (!filesByType[ext]) filesByType[ext] = [];
      filesByType[ext].push(item);
    }
  }

  // Create organized folders and move files
  for (const [ext, files] of Object.entries(filesByType)) {
    const folderPath = `/${ext.toUpperCase()}`;

    // Create folder if needed
    try {
      await client.createfolder({ path: folderPath });
    } catch (error) {
      // Folder might already exist
    }

    // Move files (use n8n nodes for this in production workflows)
    for (const file of files) {
      await client.renamefile({
        path: `/${file.name}`,
        topath: `${folderPath}/${file.name}`
      });
    }
  }
}

Development

Prerequisites

  • Node.js 18 or higher
  • npm or yarn
  • Git

Setup

  1. Clone the repository:

    git clone https://github.com/n8n-io/n8n-nodes-pcloud.git
    cd n8n-nodes-pcloud
  2. Install dependencies:

    npm install
  3. Build the project:

    npm run build
  4. Run tests:

    npm test

Project Structure

├── src/
│   ├── credentials/          # Credential definitions
│   ├── nodes/               # Node implementations
│   │   └── PCloud/         # pCloud node
│   └── utils/              # Utility functions
│       ├── PCloudApi.ts    # API client
│       ├── OAuthHelper.ts  # OAuth utilities
│       ├── Validators.ts   # Input validation
│       └── ErrorHandler.ts # Error handling
├── tests/                  # Test files
│   ├── unit/              # Unit tests
│   └── integration/       # Integration tests
├── docs/                  # Documentation
├── examples/              # Example workflows
└── scripts/               # Build and utility scripts

Scripts

  • npm run build - Build the project
  • npm run dev - Start development mode with watch
  • npm run test - Run tests
  • npm run test:watch - Run tests in watch mode
  • npm run test:coverage - Run tests with coverage
  • npm run lint - Run linting
  • npm run lintfix - Fix linting issues
  • npm run format - Format code with Prettier

Testing

The project includes comprehensive unit and integration tests:

# Run all tests
npm test

# Run tests with coverage
npm run test:coverage

# Run tests in watch mode
npm run test:watch

Contributing

Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.

Development Workflow

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass: npm test
  6. Commit your changes: git commit -m 'Add amazing feature'
  7. Push to the branch: git push origin feature/amazing-feature
  8. Open a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Related Links


Made with ❤️ by the n8n community