Answers you can trust, from Codeables
Every page on Codeables is structured and verified — built so people and the AI agents they rely on can trust it. Explore more from the source behind this answer.
Explore CodeablesWe keep missing SLAs because one downstream dependency is flaky—how do we design workflows with backoff, circuit breaking, and fallbacks?
Most teams don’t miss SLAs because everything is broken—they miss them because one or two flaky downstream dependencies take down otherwise healthy flows. The fix isn’t more retries; it’s treating that dependency as unreliable by default and designing explicit backoff, circuit breaking, and fallback behavior into your workflows.
Quick Answer: Use orchestrated workflows that wrap flaky dependencies with structured retries (with backoff and caps), circuit breakers (to fail fast when the dependency is unhealthy), and fallbacks (degraded but predictable behavior). In Orkes Conductor, you model this as tasks plus retry policies, decision branches, and compensation flows, so your SLA is governed by the workflow—not by the weakest service.
Note: I’ll use Orkes Conductor examples because that’s the platform I know best, but the patterns apply to any workflow/orchestration engine.
Frequently Asked Questions
How do I stop a single flaky dependency from causing SLA breaches?
Short Answer: Put the dependency behind orchestration: add bounded retries with backoff, apply a circuit breaker to fail fast under sustained errors, and define explicit fallbacks or degradations so the workflow can still complete within SLA.
Expanded Explanation:
If you call a downstream service directly from your app, its flakiness leaks into everything: timeouts stack, threads pile up, and by the time you detect the issue, you’ve already blown the SLA. The workflow needs to own the policy—retries, timeouts, max attempt windows, and what to do when the service is slow or down.
In Orkes Conductor, you model that dependency as a task (HTTP, gRPC, custom worker, LLM call, etc.) and attach retry policies (count, backoff, timeout). Then you add decision tasks and fallback paths: if a call times out more than N times or crosses a latency threshold, you flip a “degraded mode” flag, call an alternate provider, or short‑circuit to a cached/approximate answer. Because every execution is persisted and visualized, you can see exactly where time is being spent—and adjust before SLAs are at risk.
Key Takeaways:
- Treat flaky dependencies as untrusted by default; put them behind an orchestrator with clear policies.
- Design for bounded retries and controlled degradation rather than “retry forever and hope.”
How do I design backoff and retries in a workflow without making things worse?
Short Answer: Use capped retries with exponential (or incremental) backoff, per‑call timeouts, and an overall time budget per task so retries don’t outlive your SLA.
Expanded Explanation:
Unstructured retries are a classic “fix that breaks more.” If every caller retries aggressively, you create a retry storm that overloads the flaky service and your own threads. In a workflow engine, you centralize this: backoff and retry policies are part of the task definition, not scattered across multiple codebases.
In Orkes Conductor, each task can specify:
retryCount(max attempts)retryDelaySecondsand backoff strategy- Per‑attempt timeout
- Optional input‑based decisions (e.g., don’t retry on 4xx, do retry on 5xx/timeout)
You can also model an upper bound for how long the workflow is allowed to keep trying before it must move to a fallback path to respect the SLA. This keeps the system from “helpfully” retrying for 2 minutes when your SLO for that step is 300 ms.
Steps:
- Define per‑task retry policy: Set
retryCount, delay/backoff, and per‑attempt timeout based on the dependency’s typical latency and error modes. - Align retries to SLA: Ensure
(retryCount × (timeout + backoff))is less than the SLA budget for that step. - Branch on retry failure: Use a decision task so that when retries are exhausted, the workflow moves to a fallback or compensation path instead of hanging.
What’s the difference between backoff, circuit breaking, and fallbacks in workflows?
Short Answer: Backoff controls how you retry; circuit breaking decides whether you should even try; fallbacks define what to do instead when the dependency can’t be trusted.
Expanded Explanation:
These three patterns address different failure modes:
- Backoff/retries handle transient failures (brief spikes, network blips).
- Circuit breakers protect you when the dependency is consistently failing or slow; they fail fast instead of wasting time and capacity.
- Fallbacks give you a degraded but controlled outcome (cached result, alternate provider, queue for later, human review) so the workflow can still meet or at least manage its SLA.
In Orkes Conductor, you implement:
- Backoff via per‑task retry policies.
- Circuit breaking via workflow logic that reads metrics or flags (e.g., too many recent failures) and decides to skip the task.
- Fallbacks via decision tasks, switch tasks, and alternative branches.
Comparison Snapshot:
- Backoff: Tune retry timing to reduce pressure and give the service time to recover.
- Circuit breaker: Short‑circuit calls when the service is unhealthy to protect your SLA and resources.
- Fallbacks: Route to alternate behavior (cached data, other providers, human task) to complete the workflow predictably.
- Best for: Combining all three gives you resilient, SLA‑driven behavior under both transient and sustained failures.
How do I implement circuit breaking and fallbacks in Orkes Conductor?
Short Answer: Track dependency health (e.g., via metrics, flags, or a “health” task), then use decision tasks to either call the dependency, trip the circuit and skip it, or route to a fallback branch.
Expanded Explanation:
A circuit breaker in a workflow context is a decision layer in front of risky tasks. Instead of every client embedding its own breaker logic, the workflow evaluates “should we call this at all?” based on recent outcomes and SLAs.
With Orkes:
- You can track dependency health using external metrics (Prometheus/Grafana/Datadog) feeding into a small worker or via a state store the workflow reads.
- A decision task or switch task checks that health indicator before invoking the flaky dependency.
- If the “circuit” is open (too many failures, high latency, maintenance window), the workflow moves to a fallback path—alternate provider, cache, or human review—without incurring more timeouts.
Because executions are fully traced, you can see when the circuit was open, how often fallback was used, and correlate that with SLA performance.
What You Need:
- A workflow that models the dependency as a task plus a pre‑call decision step (your circuit breaker logic).
- At least one clearly defined fallback branch (alternate service, cached response, queue/human task) that is safe and fast enough to respect SLAs.
How does this strategy improve our SLA compliance and overall reliability?
Short Answer: It turns unpredictable dependency behavior into predictable workflow behavior: failures are anticipated, bounded, and handled consistently, which stabilizes SLAs and reduces on‑call noise.
Expanded Explanation:
Most SLA misses come from hidden variability: one service slows down, callers don’t adapt, retries pile up, and every small incident becomes a firefight. When orchestration owns the retry/backoff/fallback logic, you replace ad‑hoc scripts and scattered policies with a centralized, observable layer.
With Orkes Conductor as that layer:
- Each execution is traceable end‑to‑end: you see which task waited, retried, or fell back.
- Production controls—retries, timeouts, state persistence, and compensation—are defined in workflow JSON, edited in the UI, and versioned like code.
- You can correlate workflow SLAs with infrastructure metrics in your existing monitoring stack, so SREs have a single view of where time is being burned.
- If a strategy is too aggressive or too conservative, you roll out a new workflow version and roll back if needed.
Instead of “this service is flaky, so our entire flow is unstable,” you get “this service is flaky, so we’re in degraded mode with defined SLAs and clear audit trails.”
Why It Matters:
- SLA protection: You bound the impact of slow/down dependencies and keep core flows within agreed response times.
- Operational sanity: On‑call moves from guessing where timeouts occur to inspecting a single workflow trace and adjusting policies in one place.
Quick Recap
When a single flaky dependency keeps causing SLA misses, the fix is architectural, not just procedural. Wrap that dependency inside an orchestrated workflow that owns retries (with backoff and caps), implements circuit breaking to fail fast when the service is unhealthy, and defines explicit fallbacks or degraded paths. In Orkes Conductor, these become first‑class workflow constructs—tasks with retry policies, decision branches for circuit breaking, and alternate paths that still complete the flow—backed by metrics, RBAC, audit logs, and versioned changes.