Practical patterns for NetSuite + Jitterbit integrations
After building a dozen NetSuite integrations via Jitterbit Harmony, certain patterns emerge — and certain antipatterns come back to bite you at 2 AM. Here's what I actually use in production.
Placeholder content. This article will be loaded from Drupal JSON:API based on the URL slug. The sections below represent the intended structure.
The problem with naive integrations
Most integration projects start the same way: someone draws boxes and arrows on a whiteboard, everything looks clean, and six months later you're debugging a race condition that only occurs when a sales rep creates an order at the same time finance is running a batch job. Placeholder — real content from Drupal.
The root cause is almost always the same: the integration was designed around the happy path. Error states, partial failures, and out-of-order events were treated as edge cases rather than first-class concerns.
Pattern 1: idempotent operations
Every record write in Jitterbit should be safe to run twice. That means upserts by external ID rather than inserts, and checking for existing records before creating new ones. Placeholder — real content from Drupal.
// SuiteScript: safe upsert by external ID
var rec = record.load({
type: record.Type.CUSTOMER,
id: search.lookupFields({ ... })
}) || record.create({ type: record.Type.CUSTOMER });
Pattern 2: structured error buckets
Failed records should land in a dedicated error table — not silently drop, not crash the whole batch. In Jitterbit this means a separate "failed records" operation that logs the payload, error message, timestamp, and a retry flag. Placeholder — real content from Drupal.
Pattern 3: observable by default
If a business user can't tell whether the integration ran, it may as well not have run. Every Jitterbit operation should write a status row: start time, end time, record count, and error count. A simple dashboard query on that table is worth more than any monitoring tool. Placeholder — real content from Drupal.
Design for the failure case first. The happy path will take care of itself.
What this looks like in practice
Combining these three patterns — idempotency, error buckets, and observability — means that when something goes wrong (and it will), you know about it before the business does, you know exactly which records failed, and re-running the integration won't create duplicates. Placeholder — real content from Drupal.