5 — Data pipeline & ingestion — end-to-end flow, event-driven triggers & document intelligence.
This section explains how application data flows into the Layerup AI Agent, how the agent processes that data, and how it surfaces structured intelligence back to your systems of record. The entire pipeline is event-driven, integrates with your existing cloud-native infrastructure, and at no point requires data to leave your network boundary.5.1 End-to-end data flow — the full lifecycle of a single case
The following describes the complete lifecycle of a single application case as it flows through the Layerup agent in an AWS environment. The Azure equivalent is structurally identical, with Azure service equivalents substituted at each stage.| stage | description |
|---|---|
| Step 1 — Intake | An application packet (PDFs, medical records, Rx history, APS documents, financial statements) arrives at your existing intake system. The packet is stored in the designated S3 input bucket and an intake metadata record is written to an SQS message. |
| Step 2 — Trigger | An EventBridge rule (or the SQS trigger directly) detects the new SQS message and triggers the Layerup agent container execution, passing the S3 object key(s) as parameters. |
| Step 3 — Document Retrieval | The agent’s container reads the application documents from S3 using its scoped IAM role. Documents never leave your S3 environment; the agent pulls them into its isolated execution memory. |
| Step 4 — Ingestion & Normalisation | The agent’s ingestion layer processes each document: PDFs are parsed (including scanned / OCR documents), data is extracted, normalised against the underwriting configuration schema, and structured for reasoning. |
| Step 5 — LLM Reasoning (via Bedrock) | The agent constructs prompts against its configured Agent Operating Procedure (AOP) and invokes the designated foundation model via Amazon Bedrock’s private VPC endpoint. Bedrock Guardrails are applied at this layer. |
| Step 6 — Structured Output Generation | The agent assembles its final structured output: the underwriting recommendation, confidence score, flagged inconsistencies, evidence citations, open questions, and requirement list. |
| Step 7 — Write-Back | The output JSON payload is written to your designated S3 output bucket. Simultaneously, a completion event is written to SQS / EventBridge, which your downstream system (policy admin, CRM) consumes to update the case status. |
| Step 8 — Audit Logging | All agent reasoning steps, tool invocations, source citations, and model responses are written to CloudWatch Logs in structured JSON format for audit and compliance review. |
5.2 Ingestion mechanisms — event-driven, no polling required
The Layerup agent is triggered by events within your existing event infrastructure. No polling mechanism is required. Supported trigger patterns include:5.2.1 Event-driven architecture
AWS SQS + S3 Event Notifications
When a new application packet is uploaded to the designated S3 input bucket, S3 publishes an event notification to an SQS queue. The agent’s ECS Service or AgentCore Runtime is configured with an SQS trigger that automatically starts a new agent task for each message. This is the recommended trigger pattern for most workloads.
AWS EventBridge
For more complex routing logic (e.g., routing different application types to different agent configurations or versions), EventBridge Rules filter S3 events by prefix, metadata tag, or application type, and route each to the appropriate agent version. Useful when multiple agent configurations handle distinct case types.
API Gateway (Synchronous)
If your existing workflow system requires synchronous invocation (i.e., it calls an endpoint and waits for a response), an API Gateway endpoint can be placed in front of the agent, with a Lambda function handling the async-to-sync bridge. Given typical processing times of 7–55 minutes, the asynchronous pattern with a callback webhook is generally preferred for production workloads.
Azure Service Bus + Blob Trigger
On Azure, Blob Storage triggers an Azure Service Bus message on new document upload. Azure Container Apps’ KEDA (Kubernetes Event-Driven Autoscaling) consumes the Service Bus queue and scales agent container instances accordingly. Structurally equivalent to the SQS + S3 Event Notifications pattern on AWS.

