Commit 42598d2
Klaviyo: configurable batch size (#3650)
* Make Klaviyo batch_size configurable in UI
- Set unsafe_hidden to false to make batch_size visible in UI
- Add minimum constraint of 100 to prevent too-small batches
- Add maximum constraint of 10,000 (Klaviyo API limit)
- Update description with recommendations for RETL sources (500-1000) and event streams (5000-10000)
This enables customers to adjust batch sizes for their specific use cases, particularly RETL sources that may need smaller batch sizes to avoid payload rejections.
* Add batch_bytes field to Klaviyo batching actions
- Add batch_bytes to properties.ts with 5MB max (Klaviyo API limit)
- Add batch_bytes to all actions using profile-bulk-import-jobs API:
- upsertProfile
- addProfileToList
- trackEvent
- removeProfile
- removeProfileFromList
- Default: 4MB to stay safely below 5MB limit
- Note known RETL limitations in field description
* Keep batch_bytes hidden (unsafe_hidden: true)
batch_bytes has known limitations with RETL and generally should not be exposed to customers per framework guidance. Only batch_size needs to be visible.
* Remove batch_bytes from actions not using profile-bulk-import-jobs API
batch_bytes with 5MB limit only applies to profile-bulk-import-jobs API.
Removed from:
- trackEvent (uses event-bulk-create-jobs API)
- removeProfile (uses DELETE operations)
- removeProfileFromList (uses DELETE operations)
batch_bytes remains only in:
- upsertProfile (uses profile-bulk-import-jobs)
- addProfileToList (uses profile-bulk-import-jobs)
* Fix: Remove batch_bytes from addProfileToList perform method
batch_bytes is only used by platform batching layer, not in single-event perform method
* Fix: Exclude batch_bytes from upsertProfile API payload
batch_bytes and batch_size are platform-level batching controls and should not be sent to Klaviyo API as profile attributes
* Remove min/max constraints from batch_size and batch_bytes
Test data generator doesn't respect min/max constraints, and no other destination uses them for batch fields. The field descriptions already document recommended values and Klaviyo's limits (10K profiles, 5MB payload).
* Update test data generator to respect min/max constraints
Modified test-data.ts to:
- Accept minimum/maximum parameters in setTestData function
- Use Chance.js min/max options when generating integer/number values
- Pass minimum/maximum from field definitions through all callers
Re-added min/max constraints to Klaviyo batch fields:
- batch_size: min 100, max 10000
- batch_bytes: min 100000, max 5000000
This ensures generated test data respects field validation constraints.
* Update generated types for Klaviyo batch field constraints
* Fix timezone-based test failures in snapshot tests
Apply deterministic UTC timestamp generation for date-time fields to avoid CI failures due to timezone differences between local and CI environments. This fixes Braze ecommerceSingleProduct snapshot test failures.
Credit: Adapted from commit 4664041 by Sayan Das
* Remove min/max from hidden batch_bytes field and simplify batch_size description
- Remove minimum/maximum constraints from batch_bytes (field is hidden, constraints not needed)
- Simplify batch_size description to match standard pattern
- Keep batch_size default at 10000 with min/max constraints (100-10000)
* update types
* Remove batch_bytes field - platform default of 4MB is sufficient
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Set minimum to 100 for all
* Fix test-data min/max handling and revert timezone workaround
- Use conditional spread in setTestData to avoid passing undefined min/max to chance
- Revert date-time generation back to chance.date().toISOString()
- Revert braze snapshot to original values
- Document TZ=UTC requirement in CLAUDE.md
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
* Show batch_size field only when enable_batching is true
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
* update batch size for subscribe and unsubscribe profile actions
---------
Co-authored-by: Claude Opus 4.6 <[email protected]>1 parent 83cfc2c commit 42598d2
12 files changed
Lines changed: 121 additions & 16 deletions
File tree
- packages/destination-actions/src
- destinations/klaviyo
- addProfileToList
- removeProfileFromList
- removeProfile
- subscribeProfile
- trackEvent
- unsubscribeProfile
- upsertProfile
- lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
179 | 181 | | |
180 | 182 | | |
181 | 183 | | |
| 184 | + | |
| 185 | + | |
182 | 186 | | |
183 | 187 | | |
184 | 188 | | |
185 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
186 | 240 | | |
187 | 241 | | |
188 | 242 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
51 | 59 | | |
52 | 60 | | |
53 | 61 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
85 | 91 | | |
86 | 92 | | |
87 | 93 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| |||
0 commit comments