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

@vltech/nocobase-plugin-workflow-duplicate-record

v0.1.0

Published

A NocoBase workflow plugin that adds a **Duplicate Record** node to your workflow builder. This allows you to easily create copies of existing records with the ability to customize specific fields in the duplicated record.

Readme

@vltech/nocobase-plugin-workflow-duplicate-record

A NocoBase workflow plugin that adds a Duplicate Record node to your workflow builder. This allows you to easily create copies of existing records with the ability to customize specific fields in the duplicated record.

What Does This Plugin Do?

This plugin adds a new workflow node called "Duplicate Record" that you can use in your NocoBase workflows. When triggered, it will:

  1. Find an existing record in any collection
  2. Create a copy of that record with all its data
  3. Optionally customize specific fields in the new copy
  4. Return the newly created record for use in subsequent workflow steps

Perfect for scenarios like:

  • Creating template-based records (duplicate a template and customize it)
  • Copying orders, products, or documents with modified fields
  • Archiving records by creating duplicates with different status
  • Building approval workflows where you need modified copies

Installation

Step 1: Install the Plugin

Add the plugin to your NocoBase installation:

yarn add @vltech/nocobase-plugin-workflow-duplicate-record

Step 2: Enable the Plugin

  1. Log in to your NocoBase admin panel
  2. Go to SettingsPlugin Manager
  3. Find "Workflow: Duplicate Record" in the plugin list
  4. Click Enable to activate the plugin

Once enabled, the "Duplicate Record" node will be available in all your workflow builders.

How to Use in NocoBase UI

Adding the Duplicate Record Node to a Workflow

  1. Open or create a workflow in NocoBase (SettingsWorkflow)
  2. Click the + button to add a new node
  3. Select "Duplicate Record" from the instruction list
  4. Configure the node using the settings panel (see below)

Configuring the Node

The Duplicate Record node has the following configuration options:

1. Collection (Required)

Select the collection that contains the record you want to duplicate.

  • In the UI: Use the dropdown to select from your available collections
  • Example: Select "Products" to duplicate a product record

2. Source Record ID (Optional*)

Specify which record to duplicate.

  • Option A - Use a specific ID: Enter or select a record ID directly
  • Option B - Use workflow variable: Click the "x" button next to the field to use variables from previous workflow nodes
  • Option C - Use previous node result: Leave empty to automatically use the record from the previous workflow node

*If you leave this empty, the plugin will automatically use the id from the previous workflow node's result.

3. Field Overrides (Optional)

Customize specific fields in the duplicated record.

  • Click "Add field override" to add a new override
  • Field: Select which field you want to customize
  • Value: Enter the new value (can use workflow variables)

Common examples:

  • Change the "Status" field to "Draft"
  • Modify the "Name" field to add "Copy of..." prefix
  • Update date fields to current date
  • Change ownership or assignment fields

4. Continue on Failure (Optional)

Toggle this option to control what happens if duplication fails.

  • Off (default): Workflow stops if duplication fails
  • On: Workflow continues even if duplication fails (useful for non-critical duplications)

Example Use Cases

Example 1: Duplicate a Product as a Draft

Scenario: You want to duplicate an existing product but set its status to "Draft" for editing.

Configuration:

  1. Collection: Products
  2. Source Record ID: Use workflow variable or enter product ID
  3. Field Overrides:
    • Field: "status" → Value: "draft"
    • Field: "name" → Value: {{$context.name}} (Copy)

Example 2: Create Order Copy for Archive

Scenario: When an order is completed, create a copy for archival purposes.

Configuration:

  1. Collection: Orders
  2. Source Record ID: Leave empty (uses trigger record)
  3. Field Overrides:
    • Field: "status" → Value: "archived"
    • Field: "archivedDate" → Value: {{$system.now}}

Example 3: Template-Based Record Creation

Scenario: Use a template record to create new records with specific customizations.

Configuration:

  1. Collection: Projects
  2. Source Record ID: 123 (your template project ID)
  3. Field Overrides:
    • Field: "name" → Value: {{$context.clientName}} Project
    • Field: "startDate" → Value: {{$system.now}}
    • Field: "status" → Value: "planning"

How It Works

  1. Field Copying: The plugin copies all regular fields from the source record, excluding:

    • System fields: id, createdAt, updatedAt, createdById, updatedById, createdBy, updatedBy, __v, sort
    • Relation fields themselves (but their foreign keys are copied)
  2. Relation Handling:

    • BelongsTo relations: Foreign keys are automatically copied as regular fields
    • HasOne, HasMany, BelongsToMany: Not duplicated (only applicable to the original record)
  3. Field Overrides: Applied after copying, allowing you to customize specific fields in the new record

  4. Result: Returns the newly created record as JSON, which can be used in subsequent workflow nodes

Output

The instruction returns a job result with the following structure:

{
  status: 'resolved' | 'failed',
  result: {
    // The duplicated record data (if successful)
    id: number,
    // ... all other fields from the duplicated record

    // Or error information (if failed)
    error: string,
    stack: string
  }
}

Development

See the root README for development setup instructions.

License

See the root package.json for license information.