Automating the Klarna Card Ownership Fees System using AWS Step Functions
Klarna replaced a manual, roughly three-business-day monthly routine for charging Klarna Card ownership fees with a scheduled AWS Step Functions workflow. The routine had two engineers running Athena checks, launching Glue jobs in sequence and reviewing the results. The existing pipeline (PySpark Glue jobs feeding SQS, a decision-tree Lambda, and DynamoDB) is now orchestrated by a CDK-defined state machine. The post shows code for LambdaInvoke and synchronous GlueStartJobRun tasks, JSONPath argument passing, least-privilege IAM roles and an EventBridge cron schedule. The automation cut team workload by 12.5% per month and reduced human-error risk, with Datadog/OpsGenie alerting on failures and a caveat that Glue jobs can't be invoked cross-region or cross-account.
Related posts
- How Zillow runs 100 million daily notifications on AWS Step Functions
AWS Architecture Blog mediumAdeptZillow replaced more than 10 per-campaign notification generator services with a configuration-driven Campaign Orchestrator that runs each of 100M+ daily email and push notifications as a short-lived AWS Step Functions Express Workflow, calling a shared library of stateless, schema-driven content modules (the Universal Content Generator) via HTTP Invoke. Step Functions beat Temporal, Flowable and an in-house engine at roughly a quarter of the build and maintenance effort. Express mode was chosen over Standard for its higher start quota and low latency, with at-least-once semantics handled by idempotent modules. Key techniques include an SQS-fed router for pausing, replay and throttling, EventBridge connections for API-key auth, component inheritance compiled into task states, a declarative config layer that AI tools can safely generate, and batching for throughput and cost.
- Modular regression testing framework built on AWS for large-scale systems
AWS Architecture Blog mediumAdeptA traffic-replay regression testing framework built on AWS captures production requests and responses, replays a sample against new code in pre-production, and gates deployments on a CloudWatch alarm over the fraction of matching outputs (typically 99.9%). Step Functions toggles a Lambda event source mapping on a DynamoDB stream, replayed requests carry simulation IDs so stateful services can skip side effects and seed randomness deterministically, and responses are reduced and normalized before comparison via CloudWatch Logs Insights. Over six months it caught five customer-impacting regressions with zero false positives, using about 5% traffic replay with 200-record batches and reserved concurrency to cap load.
- Building an Auto-Scaling Lambda based on Github's Workflow Job Queue
ClickHouse mediumAdept
ClickHouse replaced CloudWatch-alarm-based EC2 Auto Scaling for its self-hosted GitHub Actions runners with a Lambda that reads the workflow job queue, built from GitHub webhook events stored in ClickHouse, and sets desired capacity directly. The Lambda compares current runners against in-progress and queued jobs, then scales up by roughly deficit/5 and down by reserve/2. The old rule (add a runner after 5 minutes above 97% busy) took hours to warm up groups of 50+ runners. The new approach launches jobs faster, saves compute when load drops, and keeps busy and active runner counts much more closely aligned.
- How Country Road Group built a pattern-driven integration solution on AWS
AWS Architecture Blog mediumAdeptCountry Road Group replaced 21 BizTalk Server interfaces on VMware with a declarative, pattern-driven integration platform on AWS, where each interface is composed from standard enterprise integration patterns provisioned by pre-built Terraform modules. Traffic flows through four lanes (batch/SFTP, API, JDBC, event). Lambda handles short jobs, Apache Camel on ECS Fargate handles long-running or stateful flows, and EventBridge serves as the canonical bus. A shared Error Management System stores failure metadata in DynamoDB and payloads in S3, so L1 operators can resubmit failed transactions idempotently. Annual integration costs fell from about $300K to $60K, three middleware tools were consolidated into one, and an open-source CDK library of 29 integration-pattern constructs is released alongside AI agent skills for pattern selection.
- Workflows are coming to Supabase
Supabase mediumAdeptSupabase is building Workflows, an open source orchestration engine written in Elixir that uses the Amazon States Language to coordinate existing functions (AWS, GCP, Azure, OpenFaaS, Postgres) in response to database events or HTTP calls. Jobs, queues and logs are stored in Postgres via Oban. Workflows can be persistent, surviving restarts, or transient and in-memory. A worked example shows a state machine that maps over Realtime INSERT events on a users table, waits 86400 seconds, then sends a templated welcome email. The interpreter is already open sourced on Hex, with dashboard integration and a Zapier-like UI planned.