webiny-cms-bulk-actions

Implements custom Headless CMS bulk actions as background tasks with Admin UI trigger buttons.

8.0k|673|Updated Jan 9, 2018
One-click install
npx skills add https://github.com/webiny/webiny-js --skill webiny-cms-bulk-actions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: webiny-cms-bulk-actions
Source: https://github.com/webiny/webiny-js/tree/main/skills/user-skills/api/cms-bulk-actions
Command: npx skills add https://github.com/webiny/webiny-js --skill webiny-cms-bulk-actions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adding a custom bulk operation to Webiny's Headless CMS content-entry list normally requires writing background-task scheduling, batching, retry, and GraphQL wiring by hand. This Skill shows how to implement an EntriesBulkAction so Webiny auto-generates the list/process background tasks and the GraphQL mutation, plus the Admin-side button that triggers it.

Core Features & Use Cases

  • Backend bulk action authoring: Implement loadData (which entries) and processData (what to do per entry) and register via EntriesBulkAction.createImplementation with dependency injection.
  • Convergence and filtering guidance: Explains why loadData must exclude already-processed entries (state transitions, boolean flags, per-run tokens) and how to translate GraphQL where filters into flat dotted storage format for custom fields.
  • Admin UI integration: Add a ContentEntryListConfig.Browser.BulkAction button that calls BulkActionFeature's useCase.execute with model, action, where scope, and custom data.
  • Use Case: A developer wants an "Apply -10% discount" action on the product entry list. They create the backend action class, register it, and add a confirmation-dialog button in the Admin that fires the mutation; Webiny runs the updates as a background task.

Quick Start

Ask the AI to create a custom Webiny CMS bulk action that applies a discount to selected product entries, including the backend EntriesBulkAction class and the Admin bulk-action button.

Frequently Asked Questions about webiny-cms-bulk-actions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a custom bulk action in Webiny Headless CMS?

Create a class implementing EntriesBulkAction.Interface with loadData and processData methods, then register it via EntriesBulkAction.createImplementation with its dependencies. Webiny automatically generates the list and process background tasks plus the GraphQL mutation.

How do I add a bulk action button to the Webiny Admin entry list?

Add a ContentEntryListConfig Browser.BulkAction element with a name matching the backend action and optional modelIds. Inside the button component, call BulkActionFeature's useCase.execute with the model, PascalCased action name, where scope, and custom data.

Why does my Webiny bulk action task never finish?

The engine calls loadData repeatedly until it returns zero entries, so if it keeps returning the same entries the task never converges and fails at maxIterations. Exclude already-processed entries using a status transition, a boolean flag, or a per-run token stamped in processData.

How do I filter bulk action entries by custom fields in Webiny?

GraphQL where input nests custom fields under values, but the storage layer used by loadData expects flat dotted keys like values.onSale_not. Flatten the values object in loadData before passing it to the list use case, or add constant custom-field filters backend-side.

What Webiny version supports custom CMS bulk actions?

Custom bulk actions via EntriesBulkAction are available from Webiny 6.5.0 onward, exposed through the webiny/api/cms/entry module. Earlier versions do not include this abstraction.

How do I update an entry inside processData without validation errors?

Inject UpdateEntryUseCase and call execute with the model, entry id, and field values nested under values, passing skipValidation: true. This prevents unrelated required or invalid fields on the entry from failing the targeted update.