webiny-cms-bulk-actions
Fungsinya
Skill ini memandu AI Anda saat menambahkan aksi massal ke daftar konten CMS Webiny, misalnya memberi diskon pada banyak entri. Skill ini untuk pengembang yang perlu mengubah banyak entri sekaligus.
Kapan dipakai
- βSaat Anda ingin tombol di daftar entri CMS yang mengubah banyak entri sekaligus.
- βSaat perubahan massal harus berjalan sebagai tugas latar belakang di kumpulan entri yang besar.
- βSaat aksi massal perlu menyaring entri berdasarkan field khusus.
Link skill
https://github.com/webiny/webiny-js/blob/next/skills/user-skills/api/cms-bulk-actions/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βTambahkan aksi massal ke daftar produk yang menerapkan diskon ke semua entri yang dipilih.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill menjelaskan kelas aksi massal dengan dua langkah: satu memilih entri mana yang dimuat, dan yang lain mengubah setiap entri. Webiny kemudian membuat tugas latar belakang dan mutasi secara otomatis, dan tombol admin memicunya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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") {
Pertanyaan umum
Versi Webiny apa yang dibutuhkan?
Skill menyatakan bahwa aksi massal tersedia mulai dari Webiny 6.5.0.
Siapa yang memutuskan entri mana yang diubah?
Langkah loadData memilih entri, dan processData mengubah setiap entri.
Apakah ini juga mencakup tombol admin?
Ya. Skill menjelaskan tombol admin yang memanggil aksi massal.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 8.1k
- Peringkat
- #12584
- Lisensi
- β
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
prd-to-plan
8.1kMembantu agent Anda mengubah dokumen kebutuhan produk menjadi rencana bertahap yang terdiri dari irisan kecil dari ujung ke ujung, disimpan sebagai berkas Markdown.
webiny-admin-architect
8.1kMengajari agent Anda cara membangun layar admin untuk platform Webiny, dengan memakai lapisan logika bisnis dan pola presenter.
webiny-admin-permissions
8.1kMengajari agent Anda menambahkan kontrol izin ke layar admin Webiny, termasuk formulir izin yang dibuat otomatis dan pemeriksaan tampilkan atau sembunyikan.
webiny-form-model
8.1kMengajari agent Anda membangun formulir di Webiny dengan pembuat field deklaratif, tata letak, validasi, dan aturan bersyarat.
Skill serupa
api-connector-builder
280kMembuat agent Anda membangun koneksi API baru mengikuti pola yang sudah ada. Gunakan saat ingin menambah integrasi lagi tanpa membuat cara baru.
api-design
280kMembantu agent Anda merancang REST API sesuai praktik terbaik. Berguna untuk mengatur cara API berkomunikasi, menampilkan error, dan mengorganisasi data.
backend-patterns
280kMembantu agent Anda dengan pola arsitektur sisi server dan optimasi database. Berguna untuk membangun atau meninjau kode yang berjalan di server.