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