bulk.nu
13 exported commands
0 internal commandssf bulk insert
Insert records into Salesforce using the Bulk API 2.0.
Accepts a table of records from the pipeline or a CSV file path. Returns a summary with the job ID and record counts.
Usage
sf bulk insert <object> --file <path> --poll-interval <duration> --timeout <duration>
Parameters
object <string>- SObject type (e.g. Account, Lead)
Flags
--file <path>- Path to a CSV file to upload
--poll-interval <duration>- Time between status checks (default: 500000000ns)
--timeout <duration>- Max wait time (default: 86400000000000ns)
Input/output types
| input | output |
|---|---|
| any | any |
Examples
insert accounts from a table
[{Name: "Acme" Industry: "Tech"} {Name: "Globex" Industry: "Manufacturing"}] | sf bulk insert Account
╭───────────────────┬────────────────────╮
│ job_id │ 750Ox00000kmvJFIAY │
│ state │ JobComplete │
│ operation │ insert │
│ object │ Account │
│ records_processed │ 2 │
│ records_failed │ 0 │
╰───────────────────┴────────────────────╯
insert from a CSV file
sf bulk insert Account --file accounts.csv
╭───────────────────┬────────────────────╮
│ job_id │ 750Ox00000kmvJFIAY │
│ state │ JobComplete │
│ operation │ insert │
│ object │ Account │
│ records_processed │ 2923 │
│ records_failed │ 0 │
╰───────────────────┴────────────────────╯
sf bulk update
Update existing records in Salesforce using the Bulk API 2.0.
The input data must include the Id field for each record.
Usage
sf bulk update <object> --file <path> --poll-interval <duration> --timeout <duration>
Parameters
object <string>- SObject type (e.g. Account, Lead)
Flags
--file <path>- Path to a CSV file to upload
--poll-interval <duration>- (default: 500000000ns)
--timeout <duration>- (default: 86400000000000ns)
Input/output types
| input | output |
|---|---|
| any | any |
Examples
update accounts from a table
[{Id: "001XX0000003DHP" Name: "Updated Corp"}] | sf bulk update Accountupdate from a CSV file
sf bulk update Account --file updates.csvsf bulk upsert
Upsert records in Salesforce using the Bulk API 2.0.
If a record with the given external ID exists, it is updated; otherwise a new record is created.
Usage
sf bulk upsert <object> --external-id-field <string> --file <path> --poll-interval <duration> --timeout <duration>
Parameters
object <string>- SObject type (e.g. Account, Lead)
Flags
--external-id-field <string>- The external ID field name (default: 'Id')
--file <path>- Path to a CSV file to upload
--poll-interval <duration>- (default: 500000000ns)
--timeout <duration>- (default: 86400000000000ns)
Input/output types
| input | output |
|---|---|
| any | any |
Examples
upsert accounts by external ID
[{My_External_Id__c: "EXT-001" Name: "Acme"}] | sf bulk upsert Account --external-id-field My_External_Id__c
╭───────────────────┬────────────────────╮
│ job_id │ 750Ox00000kmvJJECN │
│ state │ JobComplete │
│ operation │ upsert │
│ object │ Account │
│ records_processed │ 1 │
│ records_failed │ 0 │
╰───────────────────┴────────────────────╯
sf bulk delete
Delete records from Salesforce using the Bulk API 2.0.
The input data must contain only the Id field.
Usage
sf bulk delete <object> --file <path> --poll-interval <duration> --timeout <duration>
Parameters
object <string>- SObject type (e.g. Account, Lead)
Flags
--file <path>- Path to a CSV file (must contain only Id column)
--poll-interval <duration>- (default: 500000000ns)
--timeout <duration>- (default: 86400000000000ns)
Input/output types
| input | output |
|---|---|
| any | any |
Examples
delete accounts by ID
[{Id: "001XX0000003DHP"} {Id: "001XX0000003DHQ"}] | sf bulk delete Account
╭───────────────────┬────────────────────╮
│ job_id │ 830Ox00000ckvKCJEK │
│ state │ JobComplete │
│ operation │ delete │
│ object │ Account │
│ records_processed │ 2 │
│ records_failed │ 0 │
╰───────────────────┴────────────────────╯
delete from a CSV file
sf bulk delete Account --file deletes.csv
╭───────────────────┬────────────────────╮
│ job_id │ 2938x00000cdvCJDKC │
│ state │ JobComplete │
│ operation │ delete │
│ object │ Account │
│ records_processed │ 2923 │
│ records_failed │ 0 │
╰───────────────────┴────────────────────╯
sf bulk hard-delete
Hard-delete records from Salesforce using the Bulk API 2.0.
Unlike soft-delete, hard-deleted records are not recoverable from the Salesforce recycle bin. The input data must contain only the Id field.
Usage
sf bulk hard-delete <object> --file <path> --poll-interval <duration> --timeout <duration>
Parameters
object <string>- SObject type (e.g. Account, Lead)
Flags
--file <path>- Path to a CSV file (must contain only Id column)
--poll-interval <duration>- (default: 500000000ns)
--timeout <duration>- (default: 86400000000000ns)
Input/output types
| input | output |
|---|---|
| any | any |
Examples
hard-delete accounts by ID
[{Id: "001XX0000003DHP"}] | sf bulk hard-delete Accountsf bulk query
Run a bulk SOQL query using the Bulk API 2.0.
Creates a query job, waits for completion, and returns all results as a Nu table. Automatically paginates through large result sets.
Usage
sf bulk query <soql> --poll-interval <duration> --timeout <duration> --max-records <int> [--include-deleted]
Parameters
soql <string>- The SOQL query string
Flags
--poll-interval <duration>- (default: 500000000ns)
--timeout <duration>- (default: 86400000000000ns)
--max-records <int>- Max records per result page (default: 50000)
--include-deleted- Include deleted/archived records (queryAll)
Input/output types
| input | output |
|---|---|
| any | any |
Examples
bulk query all accounts
sf bulk query "SELECT Id, Name FROM Account"bulk query with deleted records
sf bulk query "SELECT Id, Name FROM Account" --include-deletedsf bulk status
Get the status of a Bulk API 2.0 job.
Returns a record with job state, record counts, and other metadata.
Usage
sf bulk status <job_id> [--query]
Parameters
job_id <string>- The job ID to check
Flags
--query- Whether this is a query job (default: ingest job)
Input/output types
| input | output |
|---|---|
| any | any |
Examples
check the status of an ingest job
sf bulk status 7501T00000Abc123check the status of a query job
sf bulk status 7501T00000Abc123 --querysf bulk results
Get the successful results from a completed Bulk API 2.0 ingest job.
Returns a table with sf__Id, sf__Created, and the original data fields.
Usage
sf bulk results <job_id>
Parameters
job_id <string>- The job ID
Input/output types
| input | output |
|---|---|
| any | any |
Examples
get successful records from an ingest job
let result = sf bulk insert Account --file accounts.csv
let created_accounts = sf bulk results $result.job_idsf bulk failures
Get the failed results from a completed Bulk API 2.0 ingest job.
Returns a table with sf__Id, sf__Error, and the original data fields.
Usage
sf bulk failures <job_id>
Parameters
job_id <string>- The job ID
Input/output types
| input | output |
|---|---|
| any | any |
Examples
get failed records from an ingest job
let result = sf bulk insert Account --file accounts.csv
let failed_accounts = sf bulk failures $result.job_idsf bulk unprocessed
Get the unprocessed records from a Bulk API 2.0 ingest job.
Returns a table of records that were not processed (e.g. due to job abort).
Usage
sf bulk unprocessed <job_id>
Parameters
job_id <string>- The job ID
Input/output types
| input | output |
|---|---|
| any | any |
Examples
get unprocessed records from an ingest job
sf bulk unprocessed 7501T00000Abc123sf bulk abort
Abort a running Bulk API 2.0 job.
Usage
sf bulk abort <job_id> [--query]
Parameters
job_id <string>- The job ID to abort
Flags
--query- Whether this is a query job
Input/output types
| input | output |
|---|---|
| any | any |
Examples
abort an ingest job
sf bulk abort 7501T00000Abc123abort a query job
sf bulk abort 7501T00000Abc123 --querysf bulk delete-job
Delete a Bulk API 2.0 job.
Removes the job and its associated data from Salesforce. The job must be in a terminal state (JobComplete, Aborted, or Failed).
Usage
sf bulk delete-job <job_id> [--query]
Parameters
job_id <string>- The job ID to delete
Flags
--query- Whether this is a query job
Input/output types
| input | output |
|---|---|
| any | any |
Examples
delete an ingest job
sf bulk delete-job 7501T00000Abc123delete a query job
sf bulk delete-job 7501T00000Abc123 --querysf bulk list-jobs
List all Bulk API 2.0 ingest jobs.
Usage
sf bulk list-jobs [--query]
Flags
--query- List query jobs instead of ingest jobs
Input/output types
| input | output |
|---|---|
| any | any |
Examples
list all ingest jobs
sf bulk list-jobs