Sf b2c jobs

From OrcaQubits/agentic-commerce-skills-plugins · View interactive version

Sf b2c jobs is an AI agent skill from the GitHub repository OrcaQubits/agentic-commerce-skills-plugins. Build and manage B2C Commerce jobs — job framework, job steps (script modules, pipelines, custom), scheduling with cron expressions, job context and parameters, import/export jobs, reindex jobs, and Business Manager monitoring. Use when implementing background processing in B2C Commerce.

How to use this skill

Skill file

Salesforce B2C Commerce Jobs

Before Writing Code

ALWAYS fetch live documentation BEFORE writing any job code:

  1. Web-search: "Salesforce B2C Commerce job framework documentation 2026"
  2. Web-search: "SFCC custom job step implementation guide 2026"
  3. WebFetch official Salesforce docs for:

Why: Job APIs, execution contexts, and best practices evolve with each B2C Commerce release. Always verify current patterns.

Conceptual Architecture

Job Framework Overview

The job framework provides scheduled background processing in B2C Commerce:

Job Types

| 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 Types

| 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 |

Cron Expression Examples

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

Status Return Concept

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

Chunk Processing Lifecycle

For large datasets, chunk-oriented processing follows this lifecycle:

  1. Read: Iterator provides next item (or batch of items)
  2. Process: Transform/validate each item
  3. Write: Persist results (wrapped in transaction)
  4. Commit: Framework commits at configured intervals

The framework manages batching, transaction boundaries, and error recovery. Fetch live docs for the exact chunk step interface (read, process, write, afterStep methods).

Job Context and Parameters

Job step parameters are configured in Business Manager per job and accessed at runtime:

System Jobs

| 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 |

Monitoring

Best Practices

Design Principles

Error Handling

Transaction Management

Scheduling and Monitoring

Fetch 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.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.