# Automating the Klarna Card Ownership Fees System using AWS Step Functions

DevFeed: [Automating the Klarna Card Ownership Fees System using AWS Step Functions](<https://devfeed.tech/articles/automating-the-klarna-card-ownership-fees-system-using-aws-step-functions-35646.md>)

Original publisher: [Read original article](<https://engineering.klarna.com/automating-the-klarna-card-ownership-fees-system-using-aws-step-functions-346ce7094278?source=rss----86090d14ab52---4>)

Author: Michel Neumann

Published: 2024-05-02T07:42:27Z

Content type: article

Language: en

Sources: [Klarna Engineering](<https://devfeed.tech/sources/klarna-engineering.md>)

Topics: [AWS Step Functions](<https://devfeed.tech/topics/aws-step-functions.md>), [AWS CloudFormation](<https://devfeed.tech/topics/aws-cloudformation.md>), [Automation](<https://devfeed.tech/topics/automation.md>), [jira](<https://devfeed.tech/topics/jira.md>)

Tags: [athena](<https://devfeed.tech/tags/athena.md>), [automation](<https://devfeed.tech/tags/automation.md>), [aws](<https://devfeed.tech/tags/aws.md>), [aws-step-functions](<https://devfeed.tech/tags/aws-step-functions.md>), [cloudformation](<https://devfeed.tech/tags/cloudformation.md>), [databases](<https://devfeed.tech/tags/databases.md>), [jira](<https://devfeed.tech/tags/jira.md>), [klarna](<https://devfeed.tech/tags/klarna.md>), [maintenance](<https://devfeed.tech/tags/maintenance.md>), [pull-requests](<https://devfeed.tech/tags/pull-requests.md>), [run](<https://devfeed.tech/tags/run.md>), [serverless](<https://devfeed.tech/tags/serverless.md>), [step-functions](<https://devfeed.tech/tags/step-functions.md>), [workflow](<https://devfeed.tech/tags/workflow.md>)

## AI overview

The article explains how Klarna automated its Klarna Card monthly fee-collection process with AWS Step Functions and CloudFormation. The automation replaced a manual, multi-day batch workflow with a scheduled process and reduced maintenance effort.

## Source excerpt

This article outlines how my team and I applied automation using AWS Step Functions and CloudFormation on a system to charge the monthly fee for Klarna Cards, enabling us to transform a previously manual routine into a self-sufficient, scheduled workflow. The initiative significantly streamlined operations and reduced maintenance cost. Introduction In early 2023, Klarna introduced monthly fees for Klarna Cards in the US. In the Card & Banking domain, two teams, including myself as engineer, developed this system within a tight four-month deadline. Initially, the system required extensive manual operation, including a detailed checklist for engineers to follow to ensure successful executions. The teams launched, planning iterative improvements of that routine. Months passed by without any advancement in refining the operation process nor automating any part of it. To provide an overview of what needed to be done by the teams to run the batch jobs: Designating an engineer to lead the monthly process, coordinated using JIRA tickets Updating exemption lists and submitting pull requests to the code-base prior to initiating batch runs Ensuring data integrity by performing Athena queries across three different production databases within the AWS Console Manually initiating multiple batch jobs in a specified sequence with manual input of arguments in a live production setting Awaiting termination of the jobs and conducting a thorough review of the outcomes of the final batch jobs for each market Overall, this routine took around three business days per month and required two engineers to approve code changes and review the results of the batch runs. Considering new markets where fees may be rolled out towards, this workflow posed a significant challenge to maintaining high-quality standards and preventing potential incidents. Taking on The Challenge We recognized that continuing with our current process was unsustainable and bound to cause issues down the line. When the top