phatnt95/salesforce-apex-agent

apex-async-integration

Designs Salesforce Apex asynchronous processing and integrations using Queueable, Batchable, Schedulable, future methods, platform events, HTTP callouts, Named Credentials, retries, and failure handling.

查看源码

使用方法

  1. 复制安装命令,在自己的智能体环境安装前先检查源码包。
  2. 从原始文档核对所需工具、凭据和支持的宿主。
  3. 说明输入材料与期望交付物,并对照来源检查输出。
npx skills add https://github.com/phatnt95/salesforce-apex-agent --skill apex-async-integration

开始前需了解

  • 安装不包含模型订阅、API 额度或访问文件的权限。
  • 仓库星数和安装量反映活跃情况,不等于独立质量或安全测试。
仓库原始内容

按源仓库内容呈现,保留标题、案例、代码、表格、链接以及原文引用的演示图片。

Apex Async & Integration

Decision tree

  • Small deferred unit of work -> Queueable.
  • Very large data set -> Batch Apex or an external bulk-processing mechanism.
  • Time-based execution -> Schedulable, usually delegating to Queueable/Batch.
  • Legacy/simple async requirement -> @future only when its constraints fit; do not introduce it by default.
  • Event-driven decoupling -> Platform Events / Change Data Capture when appropriate.
  • External HTTP callout -> Named Credential / External Credential plus an async boundary if the invocation context cannot perform a callout.

Queueable

  • Pass only serializable, bounded state.
  • Avoid chaining indefinitely.
  • Design idempotency when retries or duplicate execution are possible.
  • Make failure handling observable.

Batch

  • Choose batch size deliberately based on query shape and per-record work.
  • Keep each execute scope independently safe.
  • Avoid stateful mode unless accumulated state is necessary.
  • Make finish behavior explicit.

Callouts

  • Use Named Credentials/External Credentials for authentication.
  • Set timeouts deliberately.
  • Validate response status and payload.
  • Avoid logging secrets or sensitive payloads.
  • Define retry policy only for transient failures; do not blindly retry permanent validation/authentication failures.
  • Design idempotency for operations that can be retried.

Failure model

Document:

  • transient vs permanent errors;
  • retry count/backoff;
  • dead-letter/manual recovery path;
  • transaction rollback behavior;
  • user-visible status;
  • monitoring/logging.

按任务相关推荐

来自同一仓库

更多 Skills

全部 Skills