From salesforce-commerce
Builds and manages Salesforce B2C Commerce jobs: framework, script/pipeline/chunk steps, cron scheduling, context/parameters, import/export/reindex, Business Manager monitoring. For background processing.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin salesforce-commerceThis skill is limited to using the following tools:
**ALWAYS fetch live documentation BEFORE writing any job code:**
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides MCP server integration in Claude Code plugins via .mcp.json or plugin.json configs for stdio, SSE, HTTP types, enabling external services as tools.
ALWAYS fetch live documentation BEFORE writing any job code:
Why: Job APIs, execution contexts, and best practices evolve with each B2C Commerce release. Always verify current patterns.
The job framework provides scheduled background processing in B2C Commerce:
| Type | Description | Approach |
|---|---|---|
| System jobs | Built-in import/export/reindex/cleanup | Configured in Business Manager |
| Script module steps | Custom JavaScript (modern approach) | exports.execute = function(jobStepExecution) {} |
| Pipeline steps | Legacy pipeline-based steps | Maintenance mode; avoid for new work |
| Chunk steps | Large dataset processing | Read-process-write pattern with commit intervals |
| Step Type | Use Case | Key Characteristic |
|---|---|---|
| Script | General custom logic | Single execute() entry point; return Status |
| Pipeline | Legacy flows | Deprecated for new development |
| Chunk | Large dataset processing | Framework manages read/process/write lifecycle with batching |
0 0 2 * * ? Every day at 2:00 AM
0 */15 * * * ? Every 15 minutes
0 0 0 1 * ? First day of month at midnight
0 0 18 ? * MON-FRI Weekdays at 6:00 PM
Format: seconds minutes hours day-of-month month day-of-week
Every job step must return a dw.system.Status object:
| Status | Constant | Meaning |
|---|---|---|
| Success | Status.OK | Step completed successfully |
| Error | Status.ERROR | Step failed; may halt job depending on configuration |
There is no Status.WARN. For partial success, return Status.OK with a descriptive message (e.g., 'PARTIAL' status code with error count in the message).
// Pattern: Status return
var Status = require('dw/system/Status');
return new Status(Status.OK, 'COMPLETED', 'message');
// Fetch live docs for Status constructor
For large datasets, chunk-oriented processing follows this lifecycle:
The framework manages batching, transaction boundaries, and error recovery. Fetch live docs for the exact chunk step interface (read, process, write, afterStep methods).
Job step parameters are configured in Business Manager per job and accessed at runtime:
jobStepExecution.getParameterValue('ParamName') -- retrieve config valuesjobStepExecution.isDisabled() -- check if step is disabled| Category | Examples |
|---|---|
| Import | Catalog, inventory, pricing, customer data (XML/CSV) |
| Export | Orders, products, customers |
| Reindex | Search index rebuild, product availability updates |
| Cleanup | Session cleanup, log rotation, temp file removal |
sfcc-ci job:run --job-id <id> and sfcc-ci job:status --job-execution-id <id>dw/system/Logger for structured logging within job stepsTransaction.wrap() per batch, not per itemStatus messages with item counts and error summariesStatus.ERROR on failureStatus.OK with descriptive messagedw/system/Logger including item identifiers for debuggingTransaction.wrap() (per batch, not per item)products.close()) in finally blocks to prevent resource leaksFetch the B2C Commerce job framework reference, cron syntax guide, and sfcc-ci documentation for exact step interfaces, parameter configuration, and chunk processing patterns before implementing.