
Sf Data
Run Salesforce Bulk API 2.0 upserts and deletes with sf CLI and REST when syncing large Account or custom object datasets.
Overview
sf-data is an agent skill for the Build phase that guides Salesforce Bulk API 2.0 ingest jobs using CLI and REST for large-scale upserts and deletes.
Install
npx skills add https://github.com/clientell-ai/salesforce-skills --skill sf-dataWhat is this skill?
- Documents a 6-step Bulk API 2.0 lifecycle from job creation through failed-record retrieval
- Includes sf data bulk upsert and bulk delete CLI examples with wait flags
- Provides REST curl flows for create job, upload CSV, close job, poll status, and fetch results
- Covers upsert with externalIdFieldName and CSV lineEnding settings
- Oriented to v60.0 REST ingest jobs and org-authenticated Bearer tokens
- 6-step Bulk API 2.0 job lifecycle: Create Job → Upload CSV → Close Job → Poll Status → Get Results → Get Failed Records
Adoption & trust: 1 installs on skills.sh; 7 GitHub stars; 3/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
What problem does it solve?
You need to load or remove large Salesforce datasets but only know piecemeal CLI flags or fragile one-off curl calls.
Who is it for?
Indie developers integrating a product with Salesforce who already have an org, external IDs, and CSV exports ready.
Skip if: Builders who only need SOQL queries, single-record CRUD, or Salesforce setup without bulk data movement.
When should I use this skill?
When implementing or debugging Salesforce Bulk API 2.0 upsert, delete, or CSV ingest jobs via sf CLI or REST.
What do I get? / Deliverables
You complete a full bulk ingest or delete job with polling and failed-record recovery using documented sf and REST steps.
- Completed bulk ingest or delete job
- Job status polling results and failed-record export for remediation
Recommended Skills
Journey fit
sf-data is shelved under Build because bulk ingest and upsert jobs are implemented while wiring CRM backends and data pipelines, not during initial idea research. Integrations is the right subphase for Salesforce org connectivity, external IDs, and job-based CSV loads rather than generic frontend or PM work.
How it compares
Use for Bulk API 2.0 batch jobs, not as a substitute for Salesforce metadata deployment or interactive admin wizards.
Common Questions / FAQ
Who is sf-data for?
Solo builders and integrators automating Account or custom object loads and deletes in Salesforce orgs via bulk ingest.
When should I use sf-data?
During Build integrations while implementing migration scripts, nightly sync jobs, or agent workflows that upsert or delete CSV-backed Salesforce records at scale.
Is sf-data safe to install?
Bulk jobs can modify production data; review the Security Audits panel on this page, test in a sandbox, and scope API tokens before running delete or upsert in live orgs.
SKILL.md
READMESKILL.md - Sf Data
# Salesforce Data Operations Reference ## 1. Bulk API 2.0 Job Lifecycle ### Step-by-Step Lifecycle ``` Create Job → Upload CSV → Close Job → Poll Status → Get Results → Get Failed Records ``` ### CLI Commands ```bash # 1. Create a bulk upsert job sf data bulk upsert -o MyOrg -f data/accounts.csv -s Account -i External_Id__c -w 30 # 2. Create a bulk delete job sf data bulk delete -o MyOrg -f data/delete-ids.csv -s Account -w 30 # For large imports, use Bulk API via REST: ``` ### REST API Steps ```bash # 1. Create Job curl -X POST https://instance.salesforce.com/services/data/v60.0/jobs/ingest \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "object": "Account", "operation": "upsert", "externalIdFieldName": "External_Id__c", "contentType": "CSV", "lineEnding": "LF" }' # Returns: jobId # 2. Upload CSV Data curl -X PUT https://instance.salesforce.com/services/data/v60.0/jobs/ingest/$JOB_ID/batches \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: text/csv" \ --data-binary @data/accounts.csv # 3. Close Job (signals upload complete) curl -X PATCH https://instance.salesforce.com/services/data/v60.0/jobs/ingest/$JOB_ID \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{"state": "UploadComplete"}' # 4. Check Status curl https://instance.salesforce.com/services/data/v60.0/jobs/ingest/$JOB_ID \ -H "Authorization: Bearer $TOKEN" # Response includes: state, numberRecordsProcessed, numberRecordsFailed # 5. Get Successful Results curl https://instance.salesforce.com/services/data/v60.0/jobs/ingest/$JOB_ID/successfulResults \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: text/csv" # 6. Get Failed Records curl https://instance.salesforce.com/services/data/v60.0/jobs/ingest/$JOB_ID/failedResults \ -H "Authorization: Bearer $TOKEN" \ -H "Accept: text/csv" ``` ### Bulk API Limits - Max CSV file size per upload: 150 MB - Max record size: 10 MB - Max records per batch: 10,000 (Bulk API 1.0) / unlimited per upload (Bulk API 2.0) - Max concurrent jobs: 100 (Bulk API 2.0) - Polling interval recommendation: start at 10s, increase to 30s --- ## 2. Composite API ### Composite Request Pattern ```json POST /services/data/v60.0/composite { "allOrNone": true, "compositeRequest": [ { "method": "POST", "url": "/services/data/v60.0/sobjects/Account", "referenceId": "newAccount", "body": { "Name": "Acme Corp", "Industry": "Technology" } }, { "method": "POST", "url": "/services/data/v60.0/sobjects/Contact", "referenceId": "newContact", "body": { "FirstName": "John", "LastName": "Doe", "AccountId": "@{newAccount.id}" } }, { "method": "POST", "url": "/services/data/v60.0/sobjects/Opportunity", "referenceId": "newOpp", "body": { "Name": "Acme Deal", "StageName": "Prospecting", "CloseDate": "2026-12-31", "AccountId": "@{newAccount.id}" } }, { "method": "GET", "url": "/services/data/v60.0/sobjects/Account/@{newAccount.id}?fields=Name,Id", "referenceId": "getAccount" } ] } ``` ### Key Features - Up to 25 subrequests per composite call - Reference IDs allow cross-referencing between subrequests: `@{referenceId.fieldName}` - `allOrNone: true` rolls back all changes if any subrequest fails - Subrequests execute sequentially in order - Supports GET, POST, PATCH, DELETE methods ### Composite Graph API ```json POST /services/data/v60.0/composite/graph { "graphs": [ { "graphId": "graph1", "compositeRequest": [ { "method": "POST", "url": "/services/data/v60.0/sobjects/Account", "referenceId": "acct", "body": { "Name": "Graph Account" } }, { "method": "POST", "url": "/services/data/v60.0/sobjects/Contact", "reference