.png)
Amazon Comprehend Integration Guide
Connect Amazon Comprehend’s AWS JSON APIs and S3-based asynchronous analysis with enterprise workflows, applications, and data platforms.
Amazon Comprehend integration options at a glance
Amazon Comprehend provides regional HTTPS endpoints using the AWS JSON protocol, with synchronous operations for text analysis and asynchronous jobs for larger document collections. Synchronous operations include sentiment, entity, key phrase, language, syntax, and PII analysis. Asynchronous workflows use Amazon S3 for input and output files, while selected jobs can publish completion notifications through Amazon SNS. Requests require AWS Signature Version 4 and IAM authorization. Martini can orchestrate signed API calls, S3-based processing, job polling or notification handling, response mapping, validation, retries, and persistence in downstream applications or databases.
Common Amazon Comprehend integration patterns
Common Amazon Comprehend data objects used in integrations
Authentication and security considerations
AWS Signature Version 4 and IAM
Amazon Comprehend requests require AWS Signature Version 4 and IAM authorization. Martini integrations should use least-privilege policies for the required Comprehend actions and avoid embedding long-lived credentials in workflow definitions.
Roles, temporary credentials, and S3 access
Workloads can use IAM roles or temporary security credentials. Asynchronous jobs require an appropriate data-access role for Amazon S3, and customer-managed KMS keys may require additional permissions.
Data protection
- Store credentials and configuration in secure Martini environment settings or secrets management.
- Restrict S3 buckets, object access, logging, and retention for text that may contain personal or confidential information.
- Confirm that the selected AWS region and cross-account policies meet organizational requirements.
Operational considerations for Amazon Comprehend integrations
Quotas and request size
Synchronous operations have document and request-size constraints. Amazon Comprehend also applies service quotas, concurrent-job limits, and endpoint capacity constraints, so Martini workflows should control concurrency and retry throttled requests with backoff.
Asynchronous lifecycle
Track submitted, in-progress, completed, failed, and stopped states. Store job identifiers and source metadata, account for delayed output availability, and distinguish retriable submission failures from terminal job failures.
Idempotency and pagination
Use stable business keys, S3 object versions, or content hashes to prevent duplicate submissions. Continue through NextToken values when listing jobs, endpoints, model versions, or other paginated resources.
Schema and result handling
Parse S3 JSON output and associate each result with its source document. Apply confidence thresholds for sentiment, entities, languages, classifications, and key phrases, and test mappings when AWS response structures or custom model versions change.
Why use Martini instead of scripts or point-to-point integrations?
Orchestration beyond a single API call
Scripts can invoke an operation, but enterprise workflows often need request validation, AWS signing, S3 coordination, job polling, notification handling, downstream updates, and operational recovery. Martini centralizes that orchestration in reusable workflows and APIs.
Controlled transformation
Martini maps Comprehend-specific structures such as entities, offsets, confidence scores, sentiments, and job output files into canonical and destination-specific models. Business rules can govern routing, escalation, PII handling, and low-confidence results.
Reliability and maintainability
- Separate synchronous and asynchronous processing paths while preserving common mapping and error-handling logic.
- Implement retries, idempotency, validation, and failure routing consistently.
- Expose a controlled API façade so consuming applications do not each need AWS SigV4 logic.
- Use centralized configuration, monitoring, and deployment practices instead of maintaining isolated point-to-point scripts.