मुख्य सामग्री पर जाएँ
Skillpedia
API और सर्वर (backend)8.1k · #12584

webiny-cms-bulk-actions

यह क्या करती है

यह स्किल आपके AI को Webiny CMS कंटेंट सूची में bulk action जोड़ते समय मार्गदर्शन देती है, जैसे बहुत सारी एंट्री पर डिस्काउंट लागू करना। यह उन डेवलपर्स के लिए है जिन्हें एक साथ कई एंट्री बदलनी हैं।

कब इस्तेमाल करें

  • ✓जब आप CMS एंट्री सूची पर ऐसा बटन चाहें जो एक साथ कई एंट्री बदले।
  • ✓जब बड़े सेट की एंट्री पर बदलाव बैकग्राउंड टास्क के रूप में चलना चाहिए।
  • ✓जब bulk actions को किसी कस्टम फ़ील्ड से एंट्री छाँटनी हों।

Skill का लिंक

https://github.com/webiny/webiny-js/blob/next/skills/user-skills/api/cms-bulk-actions/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/webiny/webiny-js/blob/next/skills/user-skills/api/cms-bulk-actions/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“product सूची में एक bulk action जोड़िए, जो चुनी गई सभी एंट्री पर डिस्काउंट लागू करे।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

स्किल एक bulk action क्लास समझाती है जिसमें दो चरण होते हैं: एक चुनता है कि कौन सी एंट्री लोड हों, और दूसरा हर एंट्री बदलता है। फिर Webiny बैकग्राउंड टास्क और mutation अपने-आप बनाता है, और एक एडमिन बटन उन्हें चलाता है।

तकनीकी सामग्री (मूल 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" and processData publishes; the next list is smaller. Built-in actions rely on this.
  • Actions with no natural "done" state need a marker:
    • A boolean flag: loadData excludes flag = true; processData sets it. Simple, but blocks re-running until you reset the flag.
    • A per-run token (re-runnable): the Admin action generates a fresh runId per click and filters "not stamped with this run"; processData stamps the entry with runId. 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.

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 under values — where: { values: { onSale_not: true } }. A dotted key like "values.onSale_not" is rejected by the typed input.
  • Storage where (what loadData passes to the list use case): custom fields are flat dotted — { "values.onSale_not": true }; system fields stay top-level. A bare onSale_not throws There 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 संस्करण चाहिए?

स्किल बताती है कि bulk actions Webiny 6.5.0 से उपलब्ध हैं।

कौन सी एंट्री बदली जाएँगी, यह कौन तय करता है?

loadData चरण एंट्री चुनता है, और processData हर एक को बदलता है।

क्या एडमिन बटन भी कवर है?

हाँ। स्किल वह एडमिन बटन समझाती है जो bulk action को कॉल करता है।

जानकारी

लेखक का मूल विवरण

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
लाइसेंस
—
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

prd-to-plan

8.1k

यह आपके एजेंट को प्रोडक्ट आवश्यकताओं के दस्तावेज़ को छोटे, एंड-टू-एंड स्लाइस की चरणबद्ध योजना में बदलने में मदद करती है, जो Markdown फ़ाइल में सहेजी जाती है।

प्रोडक्टिविटीटास्क और प्रोजेक्ट

webiny-admin-architect

8.1k

यह आपके एजेंट को Webiny प्लेटफ़ॉर्म के लिए एडमिन स्क्रीन बनाना सिखाती है, उसकी बिज़नेस लॉजिक परतों और presenter पैटर्न का उपयोग करके।

कोडिंगवेबसाइट और UI (frontend)

webiny-admin-permissions

8.1k

यह आपके एजेंट को Webiny एडमिन स्क्रीन में अनुमति नियंत्रण जोड़ना सिखाती है, जिसमें अपने-आप बनने वाले अनुमति फ़ॉर्म और दिखाने-छिपाने की जाँच शामिल हैं।

कोडिंगवेबसाइट और UI (frontend)

webiny-form-model

8.1k

यह आपके एजेंट को Webiny में declarative field builder, layouts, validation और शर्त वाले नियमों से फ़ॉर्म बनाना सिखाती है।

कोडिंगवेबसाइट और UI (frontend)

मिलती-जुलती skills