salesforce-load-scale
Implement Salesforce load testing, API limit capacity planning, and Bulk API scaling. Use when running performance tests against Salesforce, planning API consumption, or scaling high-volume Salesforce integrations. Trigger with phrases like "salesforce load test", "salesforce scale", "salesforce performance test", "salesforce capacity planning", "salesforce high volume".
Best use case
salesforce-load-scale is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Implement Salesforce load testing, API limit capacity planning, and Bulk API scaling. Use when running performance tests against Salesforce, planning API consumption, or scaling high-volume Salesforce integrations. Trigger with phrases like "salesforce load test", "salesforce scale", "salesforce performance test", "salesforce capacity planning", "salesforce high volume".
Teams using salesforce-load-scale should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/salesforce-load-scale/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How salesforce-load-scale Compares
| Feature / Agent | salesforce-load-scale | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Implement Salesforce load testing, API limit capacity planning, and Bulk API scaling. Use when running performance tests against Salesforce, planning API consumption, or scaling high-volume Salesforce integrations. Trigger with phrases like "salesforce load test", "salesforce scale", "salesforce performance test", "salesforce capacity planning", "salesforce high volume".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
Best AI Agents for Marketing
A curated list of the best AI agents and skills for marketing teams focused on SEO, content systems, outreach, and campaign execution.
SKILL.md Source
# Salesforce Load & Scale
## Overview
Load testing, scaling strategies, and capacity planning for Salesforce integrations. Focus on API limit budgeting, Bulk API throughput, and handling Salesforce's unique constraint: org-wide shared limits.
## Prerequisites
- k6 or Artillery load testing tool
- Sandbox or Developer org for testing (never load test production)
- Understanding of your org's API limit allocation
- Monitoring configured (see `salesforce-observability`)
## Instructions
### Step 1: Calculate API Limit Budget
```typescript
const conn = await getConnection();
const limits = await conn.request('/services/data/v59.0/limits/');
const budget = {
dailyMax: limits.DailyApiRequests.Max,
currentlyUsed: limits.DailyApiRequests.Max - limits.DailyApiRequests.Remaining,
remaining: limits.DailyApiRequests.Remaining,
// Budget allocation
integrationA: Math.floor(limits.DailyApiRequests.Max * 0.40), // 40% for primary sync
integrationB: Math.floor(limits.DailyApiRequests.Max * 0.20), // 20% for secondary
salesUsers: Math.floor(limits.DailyApiRequests.Max * 0.30), // 30% for Salesforce UI users
headroom: Math.floor(limits.DailyApiRequests.Max * 0.10), // 10% buffer
};
console.table(budget);
// Example (Enterprise, 50 users): 150,000 daily calls
// Integration A: 60,000 | Integration B: 30,000 | Users: 45,000 | Buffer: 15,000
```
### Step 2: Load Test with k6 (against Sandbox)
```javascript
// salesforce-load-test.js
import http from 'k6/http';
import { check, sleep } from 'k6';
const SF_TOKEN = __ENV.SF_ACCESS_TOKEN;
const SF_INSTANCE = __ENV.SF_INSTANCE_URL;
export const options = {
stages: [
{ duration: '1m', target: 5 }, // Ramp up
{ duration: '3m', target: 5 }, // Steady state
{ duration: '1m', target: 20 }, // Peak load
{ duration: '3m', target: 20 }, // Sustained peak
{ duration: '1m', target: 0 }, // Ramp down
],
thresholds: {
http_req_duration: ['p(95)<3000'], // SF API calls are slower than typical SaaS
http_req_failed: ['rate<0.01'],
},
};
export default function () {
// SOQL query
const queryRes = http.get(
`${SF_INSTANCE}/services/data/v59.0/query/?q=SELECT+Id,Name+FROM+Account+LIMIT+10`,
{ headers: { Authorization: `Bearer ${SF_TOKEN}` } }
);
check(queryRes, { 'query 200': (r) => r.status === 200 });
// sObject retrieve
const retrieveRes = http.get(
`${SF_INSTANCE}/services/data/v59.0/sobjects/Account/describe`,
{ headers: { Authorization: `Bearer ${SF_TOKEN}` } }
);
check(retrieveRes, { 'describe 200': (r) => r.status === 200 });
// Check rate limit headers
const limitInfo = queryRes.headers['Sforce-Limit-Info'];
if (limitInfo) {
const [used, max] = limitInfo.replace('api-usage=', '').split('/');
if (parseInt(used) / parseInt(max) > 0.8) {
console.warn(`API usage at ${used}/${max}`);
}
}
sleep(1); // Respect rate limits
}
```
```bash
# Get access token for load test
SF_ACCESS_TOKEN=$(sf org display --target-org my-sandbox --json | jq -r '.result.accessToken')
SF_INSTANCE_URL=$(sf org display --target-org my-sandbox --json | jq -r '.result.instanceUrl')
# Run load test (ONLY against sandbox)
k6 run \
--env SF_ACCESS_TOKEN=$SF_ACCESS_TOKEN \
--env SF_INSTANCE_URL=$SF_INSTANCE_URL \
salesforce-load-test.js
```
### Step 3: Bulk API Throughput Testing
```typescript
// Bulk API 2.0 can process millions of records per job
// Key limits:
// - 15,000 Bulk API jobs/day
// - 150,000,000 records per 24hr rolling period
// - 10 concurrent Bulk API jobs
// Generate test data
function generateTestCsv(count: number): string {
const lines = ['FirstName,LastName,Email,External_ID__c'];
for (let i = 0; i < count; i++) {
lines.push(`Test${i},User${i},test${i}@loadtest.example.com,LOAD-${i}`);
}
return lines.join('\n');
}
// Measure Bulk API throughput
const startTime = Date.now();
const results = await conn.bulk2.loadAndWaitForResults({
object: 'Contact',
operation: 'upsert',
externalIdFieldName: 'External_ID__c',
input: generateTestCsv(50000),
pollInterval: 5000,
});
const duration = (Date.now() - startTime) / 1000;
const throughput = results.successfulResults.length / duration;
console.log({
records: results.successfulResults.length,
failures: results.failedResults.length,
durationSeconds: duration.toFixed(1),
recordsPerSecond: throughput.toFixed(1),
});
// Typical: 1,000-5,000 records/second depending on triggers and validation rules
```
### Step 4: Scaling Strategies
```typescript
// Strategy 1: Use Bulk API for large datasets (separate limit pool)
// Regular API: shared daily limit
// Bulk API: 15,000 jobs/day, unlimited records per job
// Strategy 2: Batch with sObject Collections (200 records/call)
// 100,000 API calls * 200 records/call = 20M records/day via REST
// Strategy 3: Reduce describe/metadata calls (cache aggressively)
// A single describe call can return 500+ fields — cache for hours
// Strategy 4: Use Composite API (25 operations per call)
// Replaces 25 individual calls with 1
// Strategy 5: Off-peak scheduling
// Run bulk jobs during business hours when sales users are active
// This ensures API limit usage is spread across the day
```
### Step 5: Capacity Planning Table
| Operation | Records/Day | API Calls Required | Strategy |
|-----------|------------|-------------------|----------|
| Account sync | 10,000 | 50 (Collections) | sObject Collections, 200/call |
| Contact sync | 100,000 | 1 (Bulk job) | Bulk API 2.0 |
| Opportunity queries | 5,000 | 25 (SOQL) | Relationship queries, cache |
| Real-time updates | 500 | 500 | REST API, individual calls |
| Metadata/describe | Constant | 10 (cached) | Cache with 1-hour TTL |
| **Total** | **115,500** | **586** | **Well within limits** |
## Output
- API limit budget allocated across integrations
- Load test script targeting sandbox
- Bulk API throughput benchmarked
- Scaling strategies documented
- Capacity planning table for production
## Error Handling
| Issue | Cause | Solution |
|-------|-------|----------|
| `REQUEST_LIMIT_EXCEEDED` during test | Wrong org (testing production) | ONLY test against sandbox |
| Bulk job timeout | Too many triggers firing | Disable non-essential triggers in sandbox |
| Low throughput | Validation rules, workflows | Test with rules disabled, then enabled |
| Inconsistent results | Concurrent jobs contending | Run one test at a time |
## Resources
- [API Limits by Edition](https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_api.htm)
- [Bulk API 2.0 Limits](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/bulk_api_2_0.htm)
- [k6 Documentation](https://k6.io/docs/)
## Next Steps
For reliability patterns, see `salesforce-reliability-patterns`.Related Skills
testing-load-balancers
Validate load balancer behavior, failover, and traffic distribution. Use when performing specialized testing. Trigger with phrases like "test load balancer", "validate failover", or "check traffic distribution".
windsurf-load-scale
Scale Windsurf adoption across large organizations with workspace strategies and performance tuning. Use when rolling out Windsurf to 50+ developers, managing large monorepo workspaces, or planning enterprise-scale deployment. Trigger with phrases like "windsurf at scale", "windsurf large team", "windsurf monorepo", "windsurf organization", "windsurf 100 developers".
vercel-load-scale
Load test and scale Vercel deployments with concurrency tuning and capacity planning. Use when running performance tests, planning for traffic spikes, or optimizing serverless function scaling on Vercel. Trigger with phrases like "vercel load test", "vercel scale", "vercel performance test", "vercel capacity", "vercel benchmark".
supabase-load-scale
Scale Supabase projects for production load: read replicas, connection pooling tuning via Supavisor, compute size upgrades, CDN caching for Storage, Edge Function regional deployment, and database table partitioning. Use when preparing for traffic spikes, optimizing connection limits, setting up read replicas for analytics queries, or partitioning large tables. Trigger with phrases like "supabase scale", "supabase read replica", "supabase connection pooling", "supabase compute upgrade", "supabase CDN storage", "supabase edge function regions", "supabase partitioning", "supavisor", "supabase pool mode".
snowflake-load-scale
Implement Snowflake load testing, warehouse scaling, and capacity planning. Use when testing query performance at scale, configuring multi-cluster warehouses, or planning capacity for production Snowflake workloads. Trigger with phrases like "snowflake load test", "snowflake scale", "snowflake capacity", "snowflake benchmark", "snowflake multi-cluster".
shopify-load-scale
Load test Shopify integrations respecting API rate limits, plan capacity with k6, and scale for Shopify Plus burst events (flash sales, BFCM). Trigger with phrases like "shopify load test", "shopify scale", "shopify BFCM", "shopify flash sale", "shopify capacity", "shopify k6 test".
sentry-load-scale
Scale Sentry for high-traffic applications handling millions of events per day. Use when optimizing SDK performance at high volume, implementing adaptive sampling, managing quotas and costs at scale, or deploying Sentry across multi-region infrastructure. Trigger with phrases like "sentry high traffic", "scale sentry", "sentry millions events", "sentry high volume", "sentry quota management", "sentry load test".
salesforce-webhooks-events
Implement Salesforce Platform Events, Change Data Capture (CDC), and Outbound Messages. Use when building real-time integrations, listening for record changes, or implementing event-driven architecture with Salesforce. Trigger with phrases like "salesforce events", "salesforce CDC", "salesforce platform events", "salesforce streaming", "salesforce outbound message", "salesforce real-time".
salesforce-upgrade-migration
Analyze, plan, and execute Salesforce API version upgrades and jsforce major version migrations. Use when upgrading Salesforce API versions, migrating jsforce v1 to v3, or adapting to deprecated API changes. Trigger with phrases like "upgrade salesforce", "salesforce API version", "jsforce upgrade", "salesforce deprecation", "salesforce version migration".
salesforce-security-basics
Apply Salesforce security best practices for Connected Apps, OAuth, and field-level security. Use when securing API credentials, implementing least privilege access, or auditing Salesforce security configuration. Trigger with phrases like "salesforce security", "salesforce secrets", "secure salesforce", "salesforce connected app security", "salesforce FLS".
salesforce-sdk-patterns
Apply production-ready Salesforce jsforce patterns for TypeScript and Python. Use when implementing Salesforce integrations, refactoring SDK usage, or establishing team coding standards for Salesforce. Trigger with phrases like "salesforce SDK patterns", "jsforce best practices", "salesforce code patterns", "idiomatic salesforce", "salesforce typescript".
salesforce-reliability-patterns
Implement Salesforce reliability patterns including circuit breakers, idempotent upserts, and fallback caching. Use when building fault-tolerant Salesforce integrations, implementing retry strategies, or adding resilience to production Salesforce services. Trigger with phrases like "salesforce reliability", "salesforce circuit breaker", "salesforce idempotent", "salesforce resilience", "salesforce fallback", "salesforce retry".