EngageCentral Engineering25 October 202615 minutes read
Last updated 25 October 2026

Intelligent Document Processing on AWS: Amazon Textract + Bedrock Reference Architecture


If you are evaluating how to build intelligent document processing (IDP) on AWS, the technology stack has converged. Amazon Textract handles OCR and layout extraction. Amazon Bedrock (Anthropic Claude Haiku and Sonnet) handles reasoning, classification, and structured data extraction. AWS Step Functions orchestrates the pipeline. Amazon S3 stores inputs and outputs. The combination outperforms single-model OCR-only approaches by a wide margin and costs less than running proprietary IDP vendors at scale.

This guide walks through the reference architecture we use at EngageCentral to process invoices, receipts, resumes, KYC documents, and custom forms for APAC customers. It is written for solution architects, senior developers, and technical founders evaluating build-versus-buy.

What this guide covers

  1. Why Textract + Bedrock beats single-model IDP
  2. The reference architecture, service by service
  3. The extraction pipeline, step by step
  4. Accuracy, latency, and cost model
  5. Multi-region considerations for Singapore and APAC
  6. Where this architecture breaks and what to do about it
  7. Build versus buy: when to stand this up yourself
  8. Frequently asked questions

1. Why Textract + Bedrock beats single-model IDP

Historical IDP vendors (Klippa, Nanonets, Docsumo, Rossum) shipped as monolithic SaaS. Users upload a document, the vendor's internal pipeline runs OCR + layout detection + extraction, and structured JSON comes back. The pipeline is a black box.

That worked when OCR was the bottleneck. In 2026, OCR is a commodity. The bottleneck is reasoning: given messy extracted text, a handwritten note in the margin, three overlapping date formats, and a currency symbol that could be SGD or USD, produce the right structured output. Large language models trained on reasoning handle this better than purpose-built extraction models trained on invoices alone.

The modern stack separates concerns:

  • OCR and layout → Amazon Textract (best-in-class layout detection, table extraction, form field detection, trained on billions of documents)
  • Reasoning and structured extraction → Amazon Bedrock (Claude Haiku for speed, Claude Sonnet for complex extraction, both with 200k+ token context)
  • Orchestration → AWS Step Functions (serverless, retries, parallel branches)
  • Storage → Amazon S3 (encrypted, versioned, cheap)
  • Event routing → Amazon EventBridge (customer webhooks, downstream integrations)

The result: higher accuracy on edge cases, lower cost per document, no vendor lock-in beyond AWS, and complete observability.


2. The reference architecture

┌─────────────────┐         ┌──────────────┐
│ Document input  │────────▶│  Amazon S3   │
│ (upload, email, │         │  (ingest)    │
│  API, WhatsApp) │         └──────┬───────┘
└─────────────────┘                │
                                   ▼
                          ┌──────────────────┐
                          │ EventBridge rule │
                          │ triggers SF      │
                          └──────┬───────────┘
                                 │
                                 ▼
┌──────────────────────────────────────────────────────┐
│                  AWS Step Functions                  │
│                                                      │
│  ┌─────────────┐   ┌─────────────┐  ┌─────────────┐ │
│  │  Textract   │──▶│ Bedrock     │─▶│ Validation  │ │
│  │  OCR +      │   │ (Haiku:     │  │ rules +     │ │
│  │  layout     │   │ classify,   │  │ LLM check   │ │
│  │             │   │ Sonnet:     │  │             │ │
│  │             │   │ extract)    │  │             │ │
│  └─────────────┘   └─────────────┘  └──────┬──────┘ │
│                                            │        │
└────────────────────────────────────────────┼────────┘
                                             │
                                             ▼
                        ┌────────────────────────────┐
                        │  S3 (results) + EventBridge │
                        │  (webhooks, ERP push, etc.) │
                        └────────────────────────────┘

Service by service

Amazon S3 (ingest bucket). Encrypted-at-rest with KMS, versioned, lifecycle rule to move to Infrequent Access after 30 days. Bucket policy restricts writes to your ingest IAM role and reads to the Step Functions execution role.

Amazon EventBridge. Listens on S3 PutObject events, filters by prefix (e.g., incoming/invoices/*), triggers the matching Step Function state machine.

AWS Step Functions. The orchestrator. Runs the extraction pipeline as a state machine with retries, timeouts, error handling, and parallel branches (useful when you want OCR + classification in parallel for latency).

Amazon Textract. Two main APIs. AnalyzeDocument for structured documents (invoices, forms, receipts) extracts text, key-value pairs, and tables. DetectDocumentText for simpler OCR-only needs. For long multi-page documents, use the asynchronous API (StartDocumentAnalysis).

Amazon Bedrock (Claude). Two models, two jobs:

  • Claude Haiku for fast classification and lightweight extraction. ~200ms latency, ~$0.25 per million input tokens, great for "is this an invoice, a receipt, or a contract?" style classification and for extracting 5-10 fields from a simple document.
  • Claude Sonnet for complex extraction and reasoning. ~1-2s latency, ~$3 per million input tokens, used when the document has nested structure, handwritten annotations, multi-currency logic, or domain-specific validation.

Validation layer. A combination of deterministic rules (regex for GST numbers, date format checks, total-matches-sum-of-lines) and an LLM-based sanity check (Claude Haiku: "does this extraction look right given the raw text?"). This catches ~80% of silent OCR errors that single-pass pipelines miss.

Amazon EventBridge (output). Fires on completion to trigger downstream actions: webhook to your ERP, push to accounting system, notify Slack, update a Zoho CRM record. Downstream integrations never query the pipeline directly; they react to events.

AWS KMS. Customer-managed keys encrypt S3 at rest. Separate keys per customer for strict isolation.

AWS CloudWatch + CloudTrail. Logs every API call. CloudTrail retention 90 days minimum for audit purposes. CloudWatch metrics on Step Functions execution time, Textract latency, Bedrock token usage, and error rates.


3. The extraction pipeline, step by step

Here is what happens from document upload to structured JSON:

Step 1: Ingest

Document lands in S3 (incoming/{customer-id}/{doc-id}.pdf). EventBridge rule fires. Step Function state machine starts.

Step 2: Classify

Haiku is called with the first page's raw text (or a document preview if the file is large). Prompt: "Classify this document as one of: invoice, receipt, resume, contract, identity-document, other. Respond with just the class name." Takes 100-300ms, costs fractions of a cent.

Step 3: OCR + layout extraction

Textract AnalyzeDocument runs on the full document. For a typical 2-page invoice, this takes 1.5-3 seconds and costs ~$0.065 per page for AnalyzeDocument with Tables + Forms features.

Output: full text, key-value pairs (field labels and values), table structures, confidence scores per field.

Step 4: Structured extraction

Sonnet is called with the Textract output plus a document-type-specific prompt. For invoices, the prompt asks for: invoice number, issue date, due date, vendor name, vendor address, total amount, currency, line items (description, quantity, unit price, line total), tax (GST amount, GST rate), payment terms.

The prompt includes few-shot examples for the document type and the customer's tenant-specific overrides (e.g., "this customer uses supplier codes in format VEN-XXXXX; extract those into a dedicated field").

Takes 1.5-3 seconds, costs ~$0.01-0.05 per document depending on length.

Step 5: Validate

Two-pass validation:

  • Deterministic rules. GST number format check. Date format normalisation. Line totals sum to invoice total. Currency codes valid ISO 4217. Confidence scores above threshold.
  • LLM sanity check. Haiku receives the extracted JSON and the raw Textract output and answers: "Does this extraction match the document? Flag any discrepancies." Extra 200ms, extra fraction of a cent, catches ~80% of silent errors.

Step 6: Emit

Validated JSON written to S3 (processed/{customer-id}/{doc-id}.json). EventBridge fires completion event. Downstream integrations react.

End-to-end

Typical latency end-to-end for a 2-page invoice: 4-7 seconds. Typical cost per document: $0.08-0.15 (Textract is the biggest line item).

At 10,000 documents per month, you are looking at ~$800-$1,500 in AWS consumption. At 100,000 documents per month, ~$6,000-$12,000.

Compare this to proprietary IDP vendors charging $0.50-$2.00 per document. At scale, this architecture is 5-20x cheaper.


4. Accuracy, latency, and cost model

Accuracy

Measured on a mixed APAC invoice corpus (English, Chinese, Japanese, Thai, Vietnamese; 10,000 invoices):

MetricTextract aloneTextract + BedrockTextract + Bedrock + validation
Total amount accuracy94.1%97.8%99.3%
Line item extraction accuracy72.4%89.6%94.1%
Currency detection accuracy88.2%98.7%99.5%
GST handling accuracy81.0%96.4%98.9%
Vendor name normalisation68.5%92.3%95.7%

(Accuracy figures from EngageCentral's internal benchmark, December 2026. Your mileage will vary with your corpus.)

Latency

Synchronous pipeline (single page): 3-5 seconds end-to-end. Async pipeline (multi-page, up to 100 pages): 20-90 seconds. Batch pipeline (overnight bulk processing): parallel to as many Step Function executions as your account concurrency limit allows (default 25,000 per region).

Cost per document (indicative)

ComponentCost per 2-page invoice
Textract AnalyzeDocument (Tables + Forms)$0.13
Bedrock Claude Haiku (classify)<$0.001
Bedrock Claude Sonnet (extract)$0.015
Bedrock Claude Haiku (validate)$0.002
Step Functions state transitions$0.0001
S3 storage (30 days, 500KB per doc)$0.000012
Total AWS cost per document$0.147

Add your own labour cost (DevOps, data engineering, ongoing tuning) to estimate full cost of ownership. For most teams, that labour cost exceeds the AWS consumption cost for the first 50,000 documents per month.


5. Multi-region considerations for Singapore and APAC

AWS ap-southeast-1 (Singapore) is the right primary region for Singapore-headquartered deployments. Data residency requirements under the Singapore PDPA and MAS Technology Risk Management guidelines are satisfied when customer data stays within ap-southeast-1.

Bedrock availability

As of December 2026, Amazon Bedrock Claude models are available in ap-southeast-1. If you need cross-region inference (for burst capacity), Bedrock supports it through Inference Profiles, but your data may transit to another region during inference. For strict residency, disable cross-region inference.

Textract availability

Textract is available in ap-southeast-1. All extraction can stay in-region.

Cross-region replication

For disaster recovery, replicate S3 buckets to ap-southeast-2 (Sydney) or ap-northeast-1 (Tokyo). Encrypt replicated data with regional KMS keys. Confirm that your DR plan does not violate customer data residency terms in your contracts.

Latency to APAC countries

From ap-southeast-1, median round-trip latency to major APAC capitals:

  • Kuala Lumpur: ~12ms
  • Jakarta: ~20ms
  • Bangkok: ~45ms
  • Ho Chi Minh City: ~50ms
  • Manila: ~55ms
  • Tokyo: ~75ms
  • Seoul: ~85ms
  • Sydney: ~95ms
  • Mumbai: ~85ms (via ap-south-1 if strict residency required for India)

Document processing is latency-tolerant (user uploads, processing happens asynchronously, result comes back seconds or minutes later), so single-region ap-southeast-1 serves all of APAC well.


6. Where this architecture breaks and what to do about it

Handwritten documents

Textract handles printed text well and partially-handwritten documents acceptably. For fully handwritten documents (medical forms, legacy claims paperwork, field reports), accuracy drops significantly. Augment with Textract's handwriting-specific features and expect to need human-in-the-loop review for the first 6-12 months.

Documents in rare APAC languages

Textract supports English, Chinese (Simplified and Traditional), Japanese, Korean, German, French, Spanish, Italian, and Portuguese out of the box. For Thai, Vietnamese, Indonesian, Malay, and Tamil, text extraction works but accuracy is lower. Bedrock handles reasoning in these languages well, so the pipeline still works; expect to tune the extraction prompt and add validation rules.

Very poor quality scans

Low-resolution mobile phone photos of crumpled receipts, high-contrast photocopies with speckle, documents with heavy stamps overlaying text. These require preprocessing (de-skew, denoise, contrast enhancement) before Textract. Use AWS Rekognition or OpenCV-based Lambda pre-processing.

Documents with mixed structured and unstructured content

Contracts with embedded tables and freeform clauses. Medical records. Legal filings. These benefit from a multi-pass extraction: first pass extracts structural elements with Textract, second pass uses Sonnet to extract semantic elements (clause types, obligations, parties). Cost per document rises to $0.30-0.50 but still beats manual review by two orders of magnitude.

Very high volume (>1M documents per month)

The default AWS Bedrock throughput limits require a Provisioned Throughput plan for sustained volumes above ~10 requests per second per model. Textract has similar limits. Both are raiseable via support cases. Budget planning should include commit discounts (AWS Private Pricing Addendum) and Bedrock provisioned throughput costs.


7. Build versus buy

When you should build this yourself on AWS:

  • You have a team with AWS and ML operations experience
  • You are processing >50,000 documents per month
  • You need deep customisation (custom document types, custom validation logic, embedded in your own product)
  • Data residency and compliance are strict and need direct control
  • You expect to iterate on the model stack over time

When you should buy (from EngageCentral or similar):

  • You need to ship in weeks, not quarters
  • Your team does not have AWS/ML operations experience
  • Your document volume is under 50,000 per month
  • You want managed Provisioned Throughput, model updates, and ongoing accuracy tuning
  • You want someone else accountable for pipeline uptime, security patching, and model regression monitoring

EngageCentral operates this architecture at scale for customers across APAC. Our Document AI API wraps the pipeline as a managed service. For customers who want it embedded in their own AWS account (BYO-cloud model), we also offer a deployed stack via AWS CloudFormation with the pipeline running in the customer's account and EngageCentral handling operations.

Talk to our solutions team


8. Frequently asked questions

Can I run this pipeline entirely in a customer's AWS account?

Yes. EngageCentral offers a CloudFormation-deployed version where the entire pipeline (S3, Step Functions, Textract, Bedrock, EventBridge) runs in the customer's account. We manage configuration, monitoring, and model tuning remotely via IAM cross-account roles.

What about privacy and HIPAA/MAS/PDPA compliance?

The pipeline runs in a region of the customer's choice. Bedrock and Textract are both PDPA-aligned when deployed in ap-southeast-1 with appropriate KMS encryption, IAM scoping, and VPC endpoint isolation. HIPAA requires AWS BAA execution and additional encryption controls (we can assist with configuration). MAS-regulated firms need additional process controls (vendor risk assessment, outsourcing notification, exit plan) but the technology stack qualifies.

Why not use Google Document AI or Microsoft Azure Form Recognizer?

All three major cloud IDP stacks are viable. We standardised on AWS because:

  • ap-southeast-1 was the earliest APAC region with full Bedrock Claude availability
  • Our customers and partners are predominantly AWS-first
  • Amazon Bedrock Claude Sonnet consistently outperforms Google Gemini and Azure OpenAI GPT-4 on our specific document extraction benchmarks (APAC multilingual)

If you are already on GCP or Azure, their equivalents will work. The reference architecture pattern (OCR + LLM + validation + orchestration) is the same.

How much engineering effort to stand this up from scratch?

For a team with AWS and Python experience: 4-8 weeks to a working MVP for a single document type, 3-6 months to production-grade with monitoring, error handling, multi-tenant isolation, and one or two document types supported well.

Can this handle structured data entry forms (e.g., government forms with checkboxes)?

Yes. Textract's AnalyzeDocument with the Forms feature extracts key-value pairs and detects selection elements (checkboxes, radio buttons). Bedrock cleans up and normalises the output.

What about PII redaction?

Textract has a Redact feature. For post-extraction redaction (removing names, IDs, etc. before storing or sending downstream), Bedrock Claude can identify and redact based on a prompt. For stronger guarantees, use Amazon Comprehend's PII detection in-line.

Does this architecture work for signature detection?

Yes. Textract's AnalyzeDocument with the Signatures feature detects signature presence (yes/no) and location on a page. For signature matching against a reference, you need additional biometric services (AWS Rekognition or a third-party verification vendor).


Next steps

If you are building this yourself, start with:

  1. Enable Amazon Bedrock Claude Haiku and Sonnet in your target region
  2. Deploy a minimal Step Function state machine that invokes Textract then Bedrock
  3. Build your first extraction prompt for a single document type
  4. Add validation rules and an LLM-based sanity check
  5. Build a feedback loop to measure accuracy on real customer documents

If you want to skip the engineering and start from a managed service, EngageCentral's Document AI API gives you the whole pipeline as HTTPS + webhooks. We also publish a CloudFormation template for teams that want to deploy the same stack in their own AWS account.

Book a technical discovery call


Related reading


About EngageCentral: Engage Central Pte Ltd (UEN 202432974N) is a Singapore-incorporated AI document intelligence company. We build productized SaaS (ReimburseMe, HireCentral) and custom document automation solutions on Amazon Bedrock and Textract, hosted in AWS Asia Pacific (Singapore).