webiny-cms-bulk-actions
Qué hace
Esta habilidad guía a tu IA cuando añade una acción masiva a una lista de contenido del CMS de Webiny, como aplicar un descuento a muchas entradas. Es para desarrolladores que necesitan cambiar muchas entradas a la vez.
Cuándo usarla
- ✓Cuando quieres un botón en la lista de entradas del CMS que cambie muchas entradas a la vez.
- ✓Cuando un cambio masivo debe ejecutarse como tarea en segundo plano sobre grandes conjuntos de entradas.
- ✓Cuando las acciones masivas deben filtrar entradas por un campo personalizado.
Link de la skill
https://github.com/webiny/webiny-js/blob/next/skills/user-skills/api/cms-bulk-actions/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Añade una acción masiva a la lista de productos que aplique un descuento a todas las entradas seleccionadas.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
La habilidad explica una clase de acción masiva con dos pasos: uno selecciona qué entradas cargar y el otro cambia cada entrada. Después Webiny crea automáticamente las tareas en segundo plano y la mutación, y un botón del panel las activa.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Custom Headless CMS bulk actions
TL;DR
A bulk action is a class implementing EntriesBulkAction.Interface with two methods —
loadData (which entries) and processData (what to do to each). Register it with
export default EntriesBulkAction.createImplementation({...}) via <Api.Extension src>.
For every registered bulk action, Webiny automatically generates a list background
task, a process background task, and a GraphQL mutation. On the Admin side, add a
ContentEntryListConfig.Browser.BulkAction button that calls BulkActionFeature's
useCase.execute({ model, action, where, data }).
Available from Webiny 6.5.0 (webiny/api/cms/entry).
Backend — the bulk action
// extensions/myBulkAction/api/MyBulkAction.ts
import {
EntriesBulkAction,
ListLatestEntriesUseCase,
UpdateEntryUseCase
} from "webiny/api/cms/entry";
class MyBulkActionImpl implements EntriesBulkAction.Interface {
// PascalCased into the task ids + GraphQL enum value, so "applyDiscount" →
// tasks hcmsBulk(List|Process)ApplyDiscountEntries and frontend action "ApplyDiscount".
readonly name = "applyDiscount";
// Optional: restrict which models get the mutation/button.
readonly modelIds = ["product"];
// Optional: entries processed per batch (defaults to the configured batchSize).
// readonly batchSize = 50;
constructor(
private listEntries: ListLatestEntriesUseCase.Interface,
private updateEntry: UpdateEntryUseCase.Interface
) {}
// Runs in the "list" task, with pagination (params.where/search/after/limit).
async loadData(model, params) {
const result = await this.listEntries.execute(model, params);
return result.value; // { entries, meta }
}
// Runs in the "process" task, once per entry, in batches.
async processData(model, params) {
// params.id is a revision id ("<entryId>#0001"); params.data carries whatever the
// Admin action sent.
// ...update / transform the entry here...
}
}
export default EntriesBulkAction.createImplementation({
implementation: MyBulkActionImpl,
dependencies: [ListLatestEntriesUseCase, UpdateEntryUseCase]
});
loadData/processData are the background-task body. You never write scheduling,
batching, retry, or timeout-resume code — the tasks system provides all of it. Webiny
generates hcmsBulkList<Name>Entries, hcmsBulkProcess<Name>Entries, and the mutation
bulkAction<SingularApiName>(action: <Name>, ...).
Convergence — the #1 gotcha
The engine calls loadData repeatedly until it returns zero entries — after each
processing round it re-lists to check for more work. If loadData keeps returning the
same entries, the task never converges: it re-processes them until it hits maxIterations
and fails. So the filter MUST exclude already-processed entries.
- State-transition actions converge naturally: Publish filters
status_not: "published"andprocessDatapublishes; the next list is smaller. Built-in actions rely on this. - Actions with no natural "done" state need a marker:
- A boolean flag:
loadDataexcludesflag = true;processDatasets it. Simple, but blocks re-running until you reset the flag. - A per-run token (re-runnable): the Admin action generates a fresh
runIdper click and filters "not stamped with this run";processDatastamps the entry withrunId. The run converges once everything is stamped, but the next click uses a new token, so the same entries are eligible again — no manual reset.
- A boolean flag:
Where filters — two layers, two formats
The bulk-action list path talks to storage directly, bypassing the GraphQL where-transform. Mind the difference:
- GraphQL where (what the Admin action sends, typed as
<Model>ListWhereInput): system fields are top-level (id_in,status_not,savedOn_lt, …); custom fields are nested undervalues—where: { values: { onSale_not: true } }. A dotted key like"values.onSale_not"is rejected by the typed input. - Storage where (what
loadDatapasses to the list use case): custom fields are flat dotted —{ "values.onSale_not": true }; system fields stay top-level. A bareonSale_notthrowsThere is no field with the fieldId "onSale".
So if the Admin action sends a custom-field filter, flatten it in loadData:
async loadData(model, params) {
const where = { ...params.where };
if (where.values && typeof where.values === "object") {
Preguntas frecuentes
¿Qué versión de Webiny se necesita?
La habilidad indica que las acciones masivas están disponibles desde Webiny 6.5.0.
¿Quién decide qué entradas se cambian?
El paso loadData selecciona las entradas, y processData cambia cada una.
¿Cubre también el botón del panel?
Sí. La habilidad explica el botón del panel que llama a la acción masiva.
Detalles
Descripción original del autor
Authoring a custom Headless CMS bulk action (EntriesBulkAction) that Webiny runs as a background task, plus the Admin-side button that triggers it. Use this skill when the developer wants to add a bulk action to the content-entry list (e.g. apply a discount, generate content, bulk-transform entries), understand loadData/processData, make the task converge, filter by custom fields, or trigger the action from the Admin UI. Requires Webiny 6.5.0 or newer.
repo: webiny/webiny-js
Popularidad
- Estrellas en GitHub
- 8,1 mil
- Posición en el ranking
- #12584
- Licencia
- —
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
prd-to-plan
8,1 milAyuda a tu agente a convertir un documento de requisitos de producto en un plan por fases de pequeñas porciones de extremo a extremo, guardado como archivo Markdown.
webiny-admin-architect
8,1 milEnseña a tu agente a crear pantallas de administración para la plataforma Webiny, usando sus capas de lógica de negocio y el patrón presentador.
webiny-admin-permissions
8,1 milEnseña a tu agente a añadir controles de permisos a las pantallas de administración de Webiny, con formularios de permisos autogenerados y comprobaciones de mostrar u ocultar.
webiny-form-model
8,1 milEnseña a tu agente a construir formularios en Webiny con un constructor de campos declarativo, distribuciones, validación y reglas condicionales.
Skills parecidas
api-connector-builder
280 milHace que tu agente cree nuevas conexiones de API siguiendo el patrón existente. Úsalo para añadir una integración más sin inventar otra forma de hacer las cosas.
api-design
280 milAyuda a tu agente a diseñar APIs REST según las buenas prácticas. Es útil para definir cómo se comunican las APIs, cómo se muestran los errores y cómo organizar los datos.
backend-patterns
280 milAyuda a tu agente con patrones de arquitectura del lado del servidor y optimización de bases de datos. Es útil para crear o revisar código que se ejecuta en el servidor.