AWS serverless pipeline to ingest Amazon APM work order emails via SES, parse with Claude AI, store in DynamoDB
Find a file
2026-05-08 14:23:36 -04:00
.github Update Dependabot: remove assignees, group minor/patch updates (#8) 2026-05-08 14:23:36 -04:00
cdk Fix stack naming to follow kebab-case convention 2026-04-28 14:43:49 -04:00
lambdas Add vendor reply Lambda for inbound email processing 2026-04-17 14:01:43 -04:00
shared Initial commit: work order email ingestion pipeline 2026-04-03 16:37:04 -04:00
.gitignore Initial commit: work order email ingestion pipeline 2026-04-03 16:37:04 -04:00
README.md Initial commit: work order email ingestion pipeline 2026-04-03 16:37:04 -04:00
requirements.txt Update aws-cdk-lib requirement from >=2.170.0 to >=2.252.0 (#3) 2026-05-06 18:44:57 -04:00
test_local.py Initial commit: work order email ingestion pipeline 2026-04-03 16:37:04 -04:00

Work Order Ingest

AWS serverless pipeline that ingests work order emails from Amazon's APM system (Hexagon EAM / HxGN SmartCloud), parses them with Claude AI, and stores structured data in DynamoDB.

Architecture

Email (amazon@seahavenind.com)
  → Gmail filter (from: noreply@hxgnsmartcloud.com)
    → Forwards to apm@int.seahaven.com (SES)
      → S3 bucket (raw email storage)
        → Lambda (email processor)
          → Claude Haiku (structured extraction)
            → DynamoDB (WorkOrders + WorkOrderComments)

Components

  • Email Processor Lambda (lambdas/email_processor/) - Parses raw emails, sends to Claude for structured extraction, writes to DynamoDB
  • Web UI Lambda (lambdas/web_ui/) - Server-rendered HTML dashboard for viewing work orders and event history
  • CDK Stack (cdk/) - Infrastructure as code for all AWS resources
  • Shared Models (shared/) - Data models for work orders, comments, and parsed emails

Extracted Fields

  • Work Order ID, Description, Status
  • Site Code, Building, Address
  • Severity, Priority
  • Due Date, Date Reported, Scheduled Start
  • Assigned To, Commenter, Comment Text
  • Record Type (new_work_order, update, comment, cancellation)

DynamoDB Tables

  • WorkOrders - Latest state of each work order (PK: work_order_id)
  • WorkOrderComments - Event history per work order (PK: work_order_id, SK: comment_id)

Local Testing

python3 -m venv .venv
source .venv/bin/activate
pip install anthropic boto3
export ANTHROPIC_API_KEY=sk-ant-...
python test_local.py

Deployment

cd cdk
pip install aws-cdk-lib constructs
npx cdk bootstrap   # first time only
npx cdk deploy

After deploying, store your Anthropic API key in Secrets Manager:

aws secretsmanager put-secret-value \
  --secret-id "workorder-ingest/anthropic-api-key" \
  --secret-string "sk-ant-..." \
  --region us-east-1

SES Configuration

  • Domain: int.seahaven.com (MX record pointing to inbound-smtp.us-east-1.amazonaws.com)
  • Receipt Rule Set: INBOUND_MAIL
  • Recipient: apm@int.seahaven.com