21 June 2026 • 12 min read
From API Sprawl to Unified Orchestration: How LogiFlow Cut Integration Costs by 62%
LogiFlow, a mid-market logistics SaaS serving 1,400 freight carriers, was bleeding engineering hours on a tangled web of point-to-point APIs, bespoke webhooks, and brittle homegrown middleware. By early 2024, the company's integration layer had ballooned from three clean REST endpoints into 42 distinct connectors, each maintained by separate squads with custom retry logic, separate retry policies, and independent schema dialects. New carrier partnerships required six engineering weeks on average, support teams spent fifteen hours weekly reconstructing failed polling histories, and monthly AWS costs on integration infrastructure alone had climbed from $3,200 to $18,700. The engineering squad also suffered 140 percent turnover in eighteen months, with developers describing the middleware as the dumping ground for everything nobody else wanted to own. This case study traces how the team replaced that sprawling matrix with an orchestration-first platform built on FastAPI, Temporal, and AWS Step Functions, cutting infrastructure costs by 62%, shrinking carrier onboarding from six weeks to four days, and lifting customer NPS from 31 to 58 within eleven months.
By mid-2024, LogiFlow's engineering organization had hit a wall that plenty of fast-growing SaaS companies recognize too late: the integration layer had become the product. What started in 2021 as three clean REST APIs to major carriers had ballooned into 42 distinct connectors, each maintained by its own squad, each with custom retry logic, its own schema dialect, and a separate set of on-call pages. Every new carrier partnership required an average of six engineering weeks. Carrier-facing SLAs were being missed not because the core platform was unstable, but because the middleware translating between internal domain models and external carrier specifications was failing silently.
This case study documents the 11-month engagement in which we rebuilt LogiFlow's integration architecture from the ground up. We examine why the company chose an orchestration-first model over API gateways and ESBs, how we used Temporal to replace fragile cron-and-queue jobs, what it took to migrate 42 live connectors without disrupting carrier relationships, and which organizational changes proved essential to sustaining the improvement after the engagement ended.
Company and Product Overview
LogiFlow builds transportation-management software for mid-market freight carriers operating 20–500 trucks. Its flagship product combines load-matching, dispatch automation, ETA prediction, and carrier compliance into a single dashboard. The typical buyer is a VP of operations who wants visibility across drivers, loads, and shipper relationships without switching between five tools. By early 2024, LogiFlow employed 180 people, processed roughly 220,000 loads per month, and integrated with 42 external carrier networks, brokerage platforms, and telematics providers.
The integration layer was originally designed as an internal convenience: a handful of Python scripts invoked from Celery beat jobs, each targeting a specific carrier API. As partnerships multiplied, the scripts were copy-pasted, parameterized, and patched by different squads with different conventions. There was no canonical schema for a "load," no shared retry policy, and no way to answer the basic question "what is the status of shipment SH-40982 across all connected carriers?" without querying three different databases and reconciling timestamps manually.
The Challenge
The integration sprawl created problems across engineering, sales, and customer success:
1. Carrier onboarding latency. Adding a new carrier required 4–6 engineering weeks, including schema mapping, polling logic, webhook handling, and load testing against the carrier's sandbox. Sales lost deals because LogiFlow could not promise timely integration support.
2. Silent failures and SLA breaches. The Celery-based polling jobs lacked durable state tracking. If a job worker crashed mid-poll, the system had no record that the request had been made. Carriers complained of stale status updates, and LogiFlow's support team spent 15+ hours per week reconstructing failed polling histories by hand.
3. Infrastructure cost growth. Each integration maintained its own DynamoDB table, SQS queue, and Lambda function. Monthly AWS spend on integration infrastructure alone had grown from $3,200 in 2022 to $18,700 in early 2024, with most cost driven by idle compute and duplicate storage.
4. Inconsistent data quality. Carrier A returned status codes as integers (1 = dispatched, 2 = in transit); Carrier B used strings ("DC", "IT"); Carrier C returned ISO 8601 timestamps; Carrier D returned epoch milliseconds. Downstream dashboards normalized this with 47 separate if-else branches, and data quality regressions were common after carrier API version updates.
5. Engineering churn and morale. The integration squad had 140% turnover in 18 months. Engineers described the integration layer as "the dumping ground for everything nobody else wanted to own." The lack of reusable abstractions meant every new hire spent their first month reading tribal-knowledge markdown files before touching production code.
Goals and Success Criteria
The leadership team defined four measurable goals for the re-architecture initiative, aligned with a quarterly OKR cycle:
- New carrier onboarding ≤ 5 business days end-to-end, measured from signed partnership agreement to first load synced in production.
- Integration-related SLA breaches ≤ 1% of total tracked shipments, down from an estimated 4.2% in Q1 2024.
- Monthly integration infrastructure cost ≤ $7,000, representing the 62% reduction target.
- Improvement in integration squad eNPS ≥ 40 points, reflecting both tooling and process changes.
To prevent scope creep, the team also agreed on three non-goals: no carrier API redesign, no changes to the core dispatch UI, and no new carrier partnerships during the migration window. This discipline proved critical; without it, the project would almost certainly have expanded into an indefinite "while we are at it" exercise.
Approach: Orchestration-First Architecture
We evaluated three architectural patterns: a full API gateway with request transforms, an event-sourced integration bus, and an orchestration-first model built around durable workflows. The gateway approach was rejected because it addressed only the ingress problem; it would not solve retry durability, state reconciliation, or the lack of a canonical load schema. The event bus was appealing but would have required a 12–18 month data-model migration before any benefits materialized. The orchestration-first model promised the fastest path to measurable improvements while leaving room to evolve toward event sourcing over time.
Core Technology Decisions
We selected three primary technologies for the new integration layer:
FastAPI for the integration control plane. FastAPI provided automatic OpenAPI schema generation, async request handling, and tight Pydantic data validation. More importantly, its type-first model made it possible to define a canonical Load schema once and enforce it across all 42 connectors without runtime surprises.
Temporal for durable workflow orchestration. Temporal's execution model—reliable, stateful, long-running workflows with built-in retries, timeouts, and signal handling—replaced the Celery cron jobs that had been failing silently. Every carrier sync operation became a Temporal workflow with a deterministic event history. If a worker crashed, the workflow resumed from the last recorded step, not from a guess.
AWS Step Functions for cross-service coordination between the LogiFlow core and the integration plane. Step Functions provided a visual execution map for business stakeholders and a native integration with SQS, Lambda, and DynamoDB for lightweight fan-out tasks that did not require Temporal's complexity.
The resulting architecture separated concerns cleanly: FastAPI handled schema enforcement and external API negotiation, Temporal managed multi-step carrier sync workflows with guaranteed durability, and Step Functions coordinated higher-level business processes such as onboarding a new carrier or replaying a failed shipment's status history.
Implementation
Phase 1: Canonical Schema and Control Plane (Months 1–3)
Before writing a single connector migration, we defined a canonical Load schema. The schema was deliberately opinionated: it captured every field LogiFlow's internal systems needed, normalized timestamps to UTC ISO 8601, and used a constrained enum for status codes. For each existing carrier, we wrote a bidirectional mapping layer that translated between carrier-specific formats and the canonical schema. These mappers were implemented as pure functions with exhaustive unit tests, making them safe to refactor independently of the orchestration logic.
The FastAPI control plane exposed three endpoints: /sync/load/{loadId} to trigger a status refresh for a single shipment, /sync/batch for bulk re-syncs, and /health to report per-carrier connectivity metrics. Authentication used short-lived JWTs issued by the core platform, and all requests were logged to a dedicated CloudWatch log group with correlation IDs for end-to-end tracing.
Phase 2: Workflow Migration (Months 4–7)
Each existing Celery job was rewritten as a Temporal workflow. The migration followed a strict protocol:
- Run the new Temporal workflow in shadow mode alongside the legacy Celery job, comparing outputs without affecting production traffic.
- Gradually shift traffic to the Temporal workflow, starting with non-critical carriers and low-volume status checks.
- Keep the legacy job running but idle for one week as a hot-standby fallback.
- Decommission the legacy job after confirming zero discrepancies in logs.
Shadow mode was the most valuable safety mechanism. In two cases, the legacy job had been silently producing incorrect status translations for months because the carrier's documentation was out of date. Shadow comparison caught both bugs before they reached production traffic.
Phase 3: Onboarding Automation (Months 8–10)
With stable orchestration in place, we automated the carrier onboarding pipeline. Previously, onboarding required manual configuration in six different systems and a checklist spread across three markdown files. We built a single onboarding workflow in Step Functions that:
- Provisioned a new carrier namespace in the canonical schema registry.
- Generated a starter connector template with pre-filled mapper stubs.
- Created a sandbox test environment with recorded carrier API responses.
- Triggered a CI pipeline that ran integration tests against the sandbox before human review.
The result was a self-service onboarding experience: a partner engineer could configure a new carrier integration in four days instead of six weeks, with 80% of the mapping work executed by recorded sandbox replays rather than manual translation.
Phase 4: Observability and Cost Engineering (Months 11–12)
The final phase focused on operational excellence. We instrumented every Temporal workflow with custom metrics—workflow start rate, failure reason distribution, and end-to-end latency by carrier. A Datadog dashboard visualized per-carrier health in real time, and PagerDuty alerts fired only when a carrier exceeded a configurable error-threshold for five consecutive minutes, eliminating the alert fatigue caused by transient blips.
Cost engineering followed. Because all integrations now shared a single FastAPI service, we right-sized the Fargate task from 4 vCPU / 8 GB to 2 vCPU / 4 GB, reducing compute costs by 38%. Temporal's durable execution model eliminated the need for redundant SQS queues and DynamoDB tables per carrier, consolidating state into a single partitioned table. Lambda cold starts were reduced by introducing provisioned concurrency for the most latency-sensitive carrier workflows.
Results
The re-architecture delivered business outcomes that exceeded the original OKRs within the 11-month window:
- Carrier onboarding time: Reduced from an average of 5.8 weeks to 3.9 days—a 95% reduction. Sales closed three enterprise deals that had previously stalled on integration timelines.
- SLA breach rate: Dropped from an estimated 4.2% to 0.7%, driven primarily by Temporal's durable retry mechanism eliminating silent polling failures.
- Infrastructure spend: Integration-layer AWS costs fell from $18,700/month to $7,100/month—a 62% reduction that paid for the consulting engagement within five months.
- NPS improvement: Customer NPS rose from 31 to 58, with carriers specifically citing improved status accuracy and faster onboarding in open-ended survey responses.
Metrics
We tracked metrics at three levels: workflow performance, business impact, and team health.
Workflow Performance
| Metric | Before | After | Change |
|---|---|---|---|
| Avg. carrier sync latency | 4.2 min | 1.1 min | ↓74% |
| Silent failure rate | 2.8% | 0.02% | ↓99% |
| Workflow retry success rate | 61% | 98.4% | ↑37 pp |
| Onboarding manual steps | 47 | 6 | ↓87% |
Business Impact
| Metric | Before | After | Change |
|---|---|---|---|
| Carrier onboarding (calendar days) | 41 | 3.9 | ↓90% |
| Monthly integration AWS spend | $18,700 | $7,100 | ↓62% |
| Support hours/week on integration issues | 15+ | 3 | ↓80% |
| Integration squad eNPS | -12 | +35 | ↑47 pp |
Lessons Learned
The LogiFlow engagement surfaced lessons that were as much about organizational dynamics as about technology.
1. Schema First, Connectors Second
The weeks spent on the canonical Load schema were the highest-leverage investment in the entire project. Once the schema was stable, every subsequent mapping, test, and migration decision became mechanical. Skipping this step—or treating it as a side effect of connector work—would have produced a clean technical architecture sitting on top of the same semantic chaos we were trying to eliminate.
2. Durable State Defeats Clever Retry Logic
The team initially attempted to fix the Celery failures by adding more retry decorators and better logging. The fundamental problem was not that retries were configured incorrectly; it was that the process had no durable memory. When we switched to Temporal, the "fix" required no changes to business logic at all. The infrastructure simply remembered what had already been tried. This is a recurring pattern: many distributed-systems problems are solved not by writing smarter code, but by choosing a runtime that makes forgetting impossible.
3. Shadow Mode Is Non-Negotiable for High-Risk Migrations
Running the new workflow in parallel with the old one—without affecting production—gave the team psychological permission to move fast. Without shadow mode, every migration would have required a lengthy freeze-and-pray cutover. With it, we decommissioned 38 of 42 connectors within two weeks each, confident that the new system had already proven itself against live data.
4. Organizational Alignment Must Precede Technical Alignment
The integration squads had operated as independent fiefdoms for two years. Technical standardization alone would not have changed that. We introduced a weekly "Integration Guild" meeting where engineers from every squad reviewed pending schema changes and shared mapper patterns. The guild became the enforcement mechanism for the canonical schema and, more importantly, rebuilt the sense that the integration layer was a shared product rather than a portfolio of side projects.
5. Cost Engineering Works Best When It Is Proactive, Not Reactive
The 62% cost reduction was not the result of a crisis-driven cost-cutting sprint. It emerged from right-sizing resources after observability made waste visible. Once the team could see per-carrier compute cost in a dashboard, over-provisioning felt embarrassing rather than abstract. Future projects should instrument cost per business unit from day one, not as an afterthought.
Looking Forward
LogiFlow's leadership has committed to extending the orchestration-first model beyond carrier integrations. The next phase will apply the same Temporal-based workflow approach to internal dispatch automation, replacing a separate batch-processing pipeline that still relies on nightly cron jobs. The canonical Load schema is also being proposed as the foundation for a public-facing developer portal, allowing carrier partners to build directly on LogiFlow's integration primitives rather than waiting for internal engineering capacity.
Perhaps the most meaningful long-term change is cultural. The integration squad's eNPS improved from -12 to +35 during the project, and the guild model has been adopted by other teams. Engineers who previously felt stuck maintaining legacy connectors are now contributing to platform-wide improvements and hiring. The company did not just buy a new architecture; it built a new way of working.
Conclusion
LogiFlow's story is a reminder that integration architecture is not an afterthought—it is the connective tissue of any platform-dependent SaaS business. When that tissue becomes tangled, the symptoms appear everywhere: slow sales cycles, missed SLAs, rising cloud bills, and disengaged engineers. The 62% cost reduction and 95% onboarding acceleration were welcome outcomes, but the deeper win was turning the integration layer from a liability into a competitive advantage. Carriers now choose LogiFlow partly because onboarding is measurably faster, and prospects hear that message from references rather than from marketing slides.
For teams facing similar integration sprawl, the prescription is deceptively simple: define your canonical model first, make state durable by default, automate the boring parts, and align the team before you align the architecture. The technology choices—FastAPI, Temporal, Step Functions—were important, but they were secondary to the discipline of knowing what problem we were actually solving.
