<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/day-12-30-aws-system-design-patterns-ptks5yjnu" -->

---
title: Day 12/30 AWS System Design Patterns | daily.dev
description: A document processing pipeline using AWS Step Functions Standard workflows scaled from 80,000 to 2.2 million documents per month, causing the bill to jump from...
canonical: https://daily.dev/posts/day-12-30-aws-system-design-patterns-ptks5yjnu
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Day 12/30 AWS System Design Patterns | daily.dev
og:description: A document processing pipeline using AWS Step Functions Standard workflows scaled from 80,000 to 2.2 million documents per month, causing the bill to jump from...
og:url: https://daily.dev/posts/day-12-30-aws-system-design-patterns-ptks5yjnu
og:image: https://api.daily.dev/og/posts/PtkS5yjNu.png
og:image:alt: Day 12/30 AWS System Design Patterns
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Day 12/30 AWS System Design Patterns

**[Joud Awad](https://daily.dev/sources/iac4jsbu0lv8wbsc85fsh)** · [@joudawad](https://daily.dev/joudawad) · 2 min read · 46 upvotes · 9 comments

## Summary

A document processing pipeline using AWS Step Functions Standard workflows scaled from 80,000 to 2.2 million documents per month, causing the bill to jump from $140 to $3,850. The key insight is that Standard Workflows bill per state transition, not per execution or per second. With 7 top-level states plus a Map state fanning out over 9 pages each running 7 states, each document incurs roughly 70 transitions. At 2.2M documents that totals ~154M transitions, explaining the bill at $0.025 per 1,000 transitions. The post presents four multiple-choice explanations and asks readers to identify the correct one, covering common misconceptions about Step Functions pricing models.

## Content

A document processing pipeline runs as an AWS Step Functions Standard workflow _(serverless workflow orchestrator — Standard tier bills per state transition, not per execution or per second)_. Seven top-level states: receive document, validate format, extract text, run classification, store result, notify downstream, update audit log. The extract-text state is a Map state _(fans out over an array — each item runs its own sub-workflow, and every state inside every iteration is billed as a transition)_ that processes the document page by page. Documents average 9 pages, and each page runs a 7-state pipeline: render, OCR, confidence check, a retry choice, redaction, store page, emit metrics.

Average execution takes 4–6 seconds end to end.

When the pipeline processed 80,000 documents per month, the Step Functions bill was $140. The platform grew. Last month it processed 2.2 million documents. The bill was $3,850.

Nothing changed in the workflow. No new states were added. The team is deciding whether to optimize or migrate.

What is the correct explanation, and what is the right fix?

A) Step Functions Standard pricing is per execution at a flat rate — 2.2M executions scaled the cost linearly and only reducing volume can reduce it; but Standard Workflows are not priced per execution — the billable unit is the state transition, and a single execution can contain a few transitions or hundreds

B) Standard bills every state transition, and the Map state multiplies them — 7 top-level states plus 9 pages × 7 states per page is roughly 70 transitions per document; at 2.2M documents that is ~154M transitions, and at $0.025 per 1,000 transitions, $3,850; the bill scales with documents × pages, not documents

C) Step Functions Standard includes a per-second execution charge — longer executions at higher volume caused the spike; but duration billing is the Express Workflow model; a Standard execution that sits in a Wait state for 24 hours costs the same transitions as one finishing in 4 seconds

D) The increase is CloudWatch Logs _(AWS monitoring, charges per GB ingested)_ ingestion from execution history — a real cost at scale, but a 27× bill jump from $140 to $3,850 with unchanged logging configuration cannot come from log ingestion

Answer in the comments.

## Community discussion

Top comments from developers on daily.dev.

**@joudawad** · 4 upvotes

> The answer is B.
>
> Standard Workflows _(serverless workflow orchestrator — bills per state transition)_ charge $0.025 per 1,000 state transitions — $25 per million. The unit is not the execution. It is every hop the execution makes, and a Map state _(runs a sub-workflow per array item)_ turns one document into a multiplier.
>
> Run the math for one document: 7 top-level transitions, plus the Map fan-out — 9 pages × 7 states per page = 63 — roughly 70 transitions per document.
>
> - At 80,000 documents: 5.6M transitions × $25/M = **$140**. That was the old bill.
> - At 2.2M documents: 154M transitions...

**@joudawad** · 3 upvotes

> Also, it would mean a lot to me if you could support my content and stay in touch 🙏
>
> - YouTube: [https://www.youtube.com/@system-design-lab](https://www.youtube.com/@system-design-lab)
> - LinkedIn: [https://www.linkedin.com/in/joud-awad/](https://www.linkedin.com/in/joud-awad/)
> - Medium Blog: [https://joudwawad.medium.com/](https://joudwawad.medium.com/)
> - Substack: [https://joudawad.substack.com/](https://joudawad.substack.com/)

**@irshadjan** · 1 upvotes

> Very informative and nice series. Keep it up @joudawad

**@pdfopsdev** · 1 upvotes

> this is the exact trap with Standard workflows, per-state billing means your Map fanout multiplies costs way faster than doc volume. switching the inner steps to Express and only using Standard for the outer orchestration usually kills most of that transition count without losing the audit trail.

**@joudawad** · 0 upvotes

> A — There is no flat per-execution rate on Standard. Two workflows with identical execution counts can differ 50× in cost purely on state count and Map fan-out — which also means cost is designable, not just a function of volume.

## Similar posts on daily.dev

- [The AWS FinOps Guide for Series A Startups: The 8 Cost Patterns That Appear After Product-Market Fit](https://daily.dev/posts/the-aws-finops-guide-for-series-a-startups-the-8-cost-patterns-that-appear-after-product-market-fit-vxn5ndkia) · freeCodeCamp · 2 upvotes · 0 comments
- [AWS Step Functions: How to Orchestrate Workflows Waiting for 3rd Parties](https://daily.dev/posts/aws-step-functions-how-to-orchestrate-workflows-waiting-for-3rd-parties-1bkeay5gk) · cloudonaut · 0 upvotes · 0 comments
- [Scaling a Financial Reconciliation Pipeline With Serverless](https://daily.dev/posts/scaling-a-financial-reconciliation-pipeline-with-serverless-gynvqfhrg) · Cloud Native Now · 0 upvotes · 0 comments

---

Tags: [#aws](https://daily.dev/tags/aws), [#career](https://daily.dev/tags/career), [#serverless](https://daily.dev/tags/serverless), [#finops](https://daily.dev/tags/finops)

[View this post on daily.dev](https://daily.dev/posts/day-12-30-aws-system-design-patterns-ptks5yjnu)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/day-12-30-aws-system-design-patterns-ptks5yjnu","headline":"Day 12/30 AWS System Design Patterns","text":"A document processing pipeline using AWS Step Functions Standard workflows scaled from 80,000 to 2.2 million documents per month, causing the bill to jump from $140 to $3,850. The key insight is that Standard Workflows bill per state transition, not per execution or per second. With 7 top-level states plus a Map state fanning out over 9 pages each running 7 states, each document incurs roughly 70 transitions. At 2.2M documents that totals ~154M transitions, explaining the bill at $0.025 per 1,000 transitions. The post presents four multiple-choice explanations and asks readers to identify the correct one, covering common misconceptions about Step Functions pricing models.","url":"https://daily.dev/posts/day-12-30-aws-system-design-patterns-ptks5yjnu","datePublished":"2026-08-01T16:44:14.786Z","dateModified":"2026-09-13T21:20:49.025Z","author":{"@type":"Person","name":"Joud Awad","url":"https://daily.dev/joudawad","image":"https://media.daily.dev/image/upload/s--dOB9RaXY--/f_auto/v1773320801/avatars/avatar_iaC4JsBU0lV8wBsc85fSh?_a=BAMAMiiu0","description":"Principal Solution Architecture ","worksFor":{"@type":"Organization","name":"Metalab","logo":"https://www.google.com/s2/favicons?domain=metalab.com&sz=128"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":84860}},"image":"https://media.daily.dev/image/upload/s--YOFDfko9--/f_auto/v1785602656/posts/PtkS5yjNu?_a=BAMAMicg0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":46},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":9}],"comment":[{"@type":"Comment","text":"The answer is B.\nStandard Workflows (serverless workflow orchestrator — bills per state transition) charge $0.025 per 1,000 state transitions — $25 per million. The unit is not the execution. It is every hop the execution makes, and a Map state (runs a sub-workflow per array item) turns one document into a multiplier.\nRun the math for one document: 7 top-level transitions, plus the Map fan-out — 9 pages × 7 states per page = 63 — roughly 70 transitions per document.\n\nAt 80,000 documents: 5.6M transitions × $25/M = $140. That was the old bill.\nAt 2.2M documents: 154M transitions × $25/M = $3,850. That is the new bill, to the dollar.\n\nNobody added a state; the workload’s pages grew with its documents. That is the trap: with Map states, your Step Functions bill scales with documents × pages, and the per-page pipeline that felt clean in the designer — a state per small operation — is a per-page tax at $25 per million hops.\nTwo fixes, and they compound:\nFix 1 — Migrate to Express Workflows (bills per request and per GB-second of duration, like Lambda — transitions are free). This workflow qualifies cleanly: it runs 4–6 seconds (Express caps at 5 minutes), and it uses no callbacks or wait-for-task-token patterns. At 2.2M short executions, Express typically lands over 90% cheaper than this Standard bill. Know what you trade: Express is at-least-once execution, where Standard is exactly-once — so the side effects (store, notify, audit) need idempotency keys. Regular readers will recognize the rule: at-least-once is the price of most things cheap and scalable, and idempotency is how you pay it once. Express also keeps history in CloudWatch Logs (AWS monitoring, charges per GB ingested) rather than a 90-day execution console — set log levels deliberately or Fix D’s cost becomes real.\nFix 2 — Coarsen the per-page pipeline. Seven orchestrated states per page means the orchestrator supervises render, OCR, confidence, redaction as separate hops. Collapse them into one Lambda task per page — or one per document — and orchestrate at the granularity of side effects and retry boundaries, not lines of code. A state transition is an orchestration cost; spend it where a failure needs independent retry or compensation, nowhere else. (Day 9’s durable-functions lesson was the same law wearing different clothes: checkpoint per side effect, not per thought.)","datePublished":"2026-08-01T16:44:42.702Z","url":"https://daily.dev/posts/PtkS5yjNu#c-93mXIN107","author":{"@type":"Person","name":"Joud Awad","url":"https://daily.dev/joudawad","image":"https://media.daily.dev/image/upload/s--dOB9RaXY--/f_auto/v1773320801/avatars/avatar_iaC4JsBU0lV8wBsc85fSh?_a=BAMAMiiu0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4}},{"@type":"Comment","text":"Also, it would mean a lot to me if you could support my content and stay in touch 🙏\n\nYouTube: https://www.youtube.com/@system-design-lab\nLinkedIn: https://www.linkedin.com/in/joud-awad/\nMedium Blog: https://joudwawad.medium.com/\nSubstack: https://joudawad.substack.com/","datePublished":"2026-08-01T16:45:08.257Z","url":"https://daily.dev/posts/PtkS5yjNu#c-Rh1XcRY2F","author":{"@type":"Person","name":"Joud Awad","url":"https://daily.dev/joudawad","image":"https://media.daily.dev/image/upload/s--dOB9RaXY--/f_auto/v1773320801/avatars/avatar_iaC4JsBU0lV8wBsc85fSh?_a=BAMAMiiu0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}},{"@type":"Comment","text":"Very informative and nice series. Keep it up @joudawad","datePublished":"2026-08-01T18:15:39.560Z","url":"https://daily.dev/posts/PtkS5yjNu#c-CuU6KQdaS","author":{"@type":"Person","name":"Irshad Jan","url":"https://daily.dev/irshadjan","image":"https://lh3.googleusercontent.com/a/ACg8ocIbPdAoUYjuyX21TqDR5ZJH-PquRiZrqMLMi8gmArMG24c4Tmw=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"this is the exact trap with Standard workflows, per-state billing means your Map fanout multiplies costs way faster than doc volume. switching the inner steps to Express and only using Standard for the outer orchestration usually kills most of that transition count without losing the audit trail.","datePublished":"2026-08-02T18:13:09.353Z","url":"https://daily.dev/posts/PtkS5yjNu#c-S66DDeKj3","author":{"@type":"Person","name":"PDFops","url":"https://daily.dev/pdfopsdev","image":"https://media.daily.dev/image/upload/s---8isRBKc--/f_auto/v1782922291/avatars/avatar_orjMeK8QKaaVZwGq7ScPz?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"A — There is no flat per-execution rate on Standard. Two workflows with identical execution counts can differ 50× in cost purely on state count and Map fan-out — which also means cost is designable, not just a function of volume.","datePublished":"2026-08-01T16:44:51.143Z","url":"https://daily.dev/posts/PtkS5yjNu#c-A4N58oPqU","author":{"@type":"Person","name":"Joud Awad","url":"https://daily.dev/joudawad","image":"https://media.daily.dev/image/upload/s--dOB9RaXY--/f_auto/v1773320801/avatars/avatar_iaC4JsBU0lV8wBsc85fSh?_a=BAMAMiiu0"}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/sources/iac4jsbu0lv8wbsc85fsh","name":"Joud Awad"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Joud Awad","item":"https://daily.dev/sources/iac4jsbu0lv8wbsc85fsh"},{"@type":"ListItem","position":3,"name":"Day 12/30 AWS System Design Patterns"}]}
```

