# Circuit Breaker with AWS Step Functions

DevFeed: [Circuit Breaker with AWS Step Functions](<https://devfeed.tech/articles/circuit-breaker-with-aws-step-functions-27972.md>)

Original publisher: [Read original article](<https://tech.trivago.com/post/2019-04-09-circuitbreakerwithawsstepfunctions/>)

Author: Nikhil Kuriakose Follow

Published: 2019-04-09T00:00:00Z

Content type: article

Language: en

Sources: [Trivago](<https://devfeed.tech/sources/trivago.md>)

Topics: [AWS Step Functions](<https://devfeed.tech/topics/aws-step-functions.md>), [reliability-engineering](<https://devfeed.tech/topics/reliability-engineering.md>), [rate-limiting](<https://devfeed.tech/topics/rate-limiting.md>), [Amazon Web Services](<https://devfeed.tech/topics/aws.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [availability](<https://devfeed.tech/tags/availability.md>), [aws](<https://devfeed.tech/tags/aws.md>), [aws-step-functions](<https://devfeed.tech/tags/aws-step-functions.md>), [backend](<https://devfeed.tech/tags/backend.md>), [circuit](<https://devfeed.tech/tags/circuit.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [data-pipelines](<https://devfeed.tech/tags/data-pipelines.md>), [dead-letter-queue](<https://devfeed.tech/tags/dead-letter-queue.md>), [distributed-systems](<https://devfeed.tech/tags/distributed-systems.md>), [dynamodb](<https://devfeed.tech/tags/dynamodb.md>), [error](<https://devfeed.tech/tags/error.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [exceptions](<https://devfeed.tech/tags/exceptions.md>), [external](<https://devfeed.tech/tags/external.md>), [external-services](<https://devfeed.tech/tags/external-services.md>), [json](<https://devfeed.tech/tags/json.md>), [lambda](<https://devfeed.tech/tags/lambda.md>), [pipelines](<https://devfeed.tech/tags/pipelines.md>), [step-functions](<https://devfeed.tech/tags/step-functions.md>)

## AI overview

The excerpt describes using AWS Step Functions to keep external service failures from destabilizing data pipelines. It distinguishes unresponsiveness, throttling, and unexpected errors so each can follow a separate path: retry transient errors, wait and retry after a quota limit, or open a circuit to pause further calls when a service is unavailable. A state store (DynamoDB in the example) records whether the circuit is open; requests encountering an open circuit wait, and a successful retry clears the flag. The workflow also routes requests that still fail after retries to an SQS dead letter queue for inspection and possible later retry. Elasticache or external Redis are mentioned as alternatives for the state store.

## Source excerpt

Many of our data pipelines interact with external services. The availability of an external service can adversly affect the health our pipelines. This is how we handle it using AWS Step Functions