Bulk Operations

Bulk methods allow you to create, update, or delete up to 100 records in a single request. Use them for imports, batch status updates, or any operation where looping individual calls would be slow or hit rate limits.

bulkCreateRecords(entityKey, records, signal?)

Creates up to 100 records in one request.

1const result = await sdk.bulkCreateRecords('tasks', [2  { title: 'Task A', status: 'open' },3  { title: 'Task B', status: 'open' },4]);56if (result.error) {7  // Partial failure — some records were created, some failed8  console.log('created:', result.data);            // RecordData[] of successes9  console.log('failed:', result.error.details);    // { "1": { title: ['Required'] } } or { "1": { _general: ['...'] } }10} else {11  console.log('all created:', result.data);        // RecordData[]12}

Partial failure behavior: If some records fail validation, the request returns HTTP 400. result.data contains the successfully created records; result.error.details contains per-index errors (keys are string indices: "0", "1", etc.).

Unlike single-record operations, partial bulk failures do not throw — always check result.error after every bulk call.

Whole-batch failures (entity not found, quota exceeded) throw WorkAppsSDKError before any records are written.

bulkUpdateRecords(entityKey, updates, signal?)

Updates up to 100 records in one request. Each item must include id and data. PATCH semantics — only submitted fields change; send null to clear a field.

1const result = await sdk.bulkUpdateRecords('tasks', [2  { id: '01JA...', data: { status: 'done' } },3  { id: '01JB...', data: { status: 'done' } },4]);56if (result.error) {7  console.log('updated:', result.data);8  // result.error.details: { "1": { _general: ['Record not found.'] } }9}

bulkDeleteRecords(entityKey, ids, signal?)

Deletes up to 100 records in one request.

1const result = await sdk.bulkDeleteRecords('tasks', ['01JA...', '01JB...']);23if (result.error) {4  console.log('deleted:', result.data.deleted);     // string[] of deleted IDs5  console.log('failed:', result.error.details);     // per-index errors6}

Limits

Operation Max per request
bulkCreateRecords 100 records
bulkUpdateRecords 100 records
bulkDeleteRecords 100 IDs

For datasets larger than 100, loop in batches:

1const batchSize = 100;2for (let i = 0; i < records.length; i += batchSize) {3  const batch = records.slice(i, i + batchSize);4  const result = await sdk.bulkCreateRecords('tasks', batch);5  if (result.error) {6    console.warn('Partial failure in batch', i / batchSize, result.error.details);7  }8}