webiny-cms-bulk-actions
하는 일
이 스킬은 Webiny CMS 콘텐츠 목록에 대량 작업을 추가할 때 AI를 안내합니다. 예를 들어 많은 항목에 할인을 적용하는 것처럼 한꺼번에 많은 항목을 바꿔야 하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓CMS 항목 목록에 많은 항목을 한 번에 바꾸는 버튼을 두고 싶을 때.
- ✓대량 변경을 큰 항목 집합에 걸쳐 백그라운드 작업으로 실행해야 할 때.
- ✓대량 작업이 사용자 지정 필드로 항목을 걸러야 하는 경우.
스킬 링크
https://github.com/webiny/webiny-js/blob/next/skills/user-skills/api/cms-bulk-actions/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제품 목록에 선택한 모든 항목에 할인을 적용하는 대량 작업을 추가해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
이 스킬은 두 단계로 된 대량 작업 클래스를 설명합니다. 한 단계는 불러올 항목을 고르고, 다른 단계는 각 항목을 바꿉니다. 그러면 Webiny가 백그라운드 작업과 뮤테이션을 자동으로 만들고, 관리자 버튼이 이를 실행합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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") {
자주 묻는 질문
어떤 Webiny 버전이 필요한가요?
대량 작업은 Webiny 6.5.0부터 사용할 수 있다고 스킬이 밝힙니다.
어떤 항목을 바꿀지는 누가 정하나요?
loadData 단계가 항목을 고르고, processData 단계가 각 항목을 바꿉니다.
관리자 버튼도 다루나요?
네. 대량 작업을 호출하는 관리자 버튼도 설명합니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 8.1k
- 순위
- #12584
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
prd-to-plan
8.1k에이전트가 제품 요구사항 문서를 작고 끝까지 이어지는 조각들로 된 단계별 계획으로 바꿔 Markdown 파일로 저장하도록 돕습니다.
webiny-admin-architect
8.1k에이전트에게 Webiny 플랫폼의 관리자 화면을 비즈니스 로직 계층과 프레젠터 패턴으로 만드는 방법을 가르칩니다.
webiny-admin-permissions
8.1k에이전트에게 Webiny 관리자 화면에 권한 제어를 추가하는 법을 가르칩니다. 스키마에서 권한 양식을 자동 생성하고 표시 여부를 확인합니다.
webiny-form-model
8.1k에이전트에게 선언형 필드 빌더, 레이아웃, 검증, 조건부 규칙으로 Webiny 양식을 만드는 법을 가르칩니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.