Ellipse Gradient for Header

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.

Integration pointSupported by Amazon Comprehend?Common use casesHow Martini supports it
HTTPS APIs using AWS JSON protocolLimitedAmazon Comprehend exposes regional HTTPS operations such as DetectSentiment, DetectEntities, DetectKeyPhrases, DetectDominantLanguage, DetectSyntax, DetectPiiEntities, and ContainsPiiEntities. It is HTTP-based but not a conventional resource-oriented REST API.Martini can orchestrate HTTPS API calls and transformations. AWS Signature Version 4 signing must be implemented or delegated to an AWS SDK-based intermediary.
Synchronous analysis APIsYesAnalyze individual text inputs for sentiment, entities, key phrases, language, syntax, or PII when an immediate result is needed.Martini can validate input, invoke the selected operation, apply business rules, and return or persist the mapped response.
Bulk, asynchronous, and batch jobsYesProcess larger document collections and custom analysis scenarios through jobs that read from Amazon S3 and write results to Amazon S3.Martini can start jobs, store job identifiers, poll Describe...Job operations, process completion notifications where applicable, and retrieve output files.
Amazon S3 file processingYesAmazon S3 provides input documents and output locations for asynchronous entities, key phrase, sentiment, syntax, topic, and custom analysis workflows.Martini can coordinate S3-oriented workflows, parse generated JSON files, associate outputs with source objects, and load results into target systems.
SNS job notificationsLimitedSelected asynchronous jobs can publish completion notifications through Amazon SNS. This is not a general webhook for every Comprehend operation.Martini can receive a supported notification through an appropriate AWS-facing event or HTTP pattern, then retrieve authoritative job status and output.
Authentication with AWS SigV4 and IAMYesRequests use AWS Signature Version 4 with IAM users, roles, or temporary security credentials. S3-based jobs also require appropriate data-access permissions.Martini can externalize credentials in environment configuration or secrets and use signed requests or an intermediary that performs AWS SDK authentication.
SDKs and command-line toolsYesAWS SDKs and CLI tools can invoke Comprehend operations and may simplify AWS-specific signing or custom model workflows.Martini can integrate with an intermediary SDK-based service or use custom JVM-compatible logic when direct request signing is required.

How Amazon Comprehend exposes data and business events

Amazon Comprehend HTTPS APIs

Amazon Comprehend provides regional HTTPS endpoints using the AWS JSON protocol. Synchronous operations accept text or supported document bytes and return analysis results for sentiment, entities, key phrases, language, syntax, or PII use cases.

Martini implementation pattern

Martini implementation pattern: a workflow validates the incoming document, creates an AWS SigV4-compatible request or invokes a signing intermediary, calls the selected operation, and maps the response into the consuming application or API response.

Implementation sequence

Receive the text-analysis request
Validate document content and regional configuration
Create or delegate the AWS SigV4-signed request
Invoke the selected Comprehend operation
Map analysis results and confidence values
Return or persist the transformed result

Amazon Comprehend asynchronous jobs

Asynchronous operations process larger document collections through Amazon S3 input and output locations. Jobs expose identifiers and statuses such as submitted, in progress, completed, failed, or stopped.

Martini implementation pattern

Martini implementation pattern: a workflow identifies source objects, starts the correct job with S3 and IAM configuration, records the job identifier, and polls status or reacts to a supported completion notification before parsing output files.

Implementation sequence

Identify and validate source S3 objects
Start the appropriate Comprehend analysis job
Store the job identifier and source metadata
Poll the relevant Describe...Job operation or receive a supported notification
Confirm the job has completed successfully
Read and parse the generated S3 JSON output

Amazon SNS job notifications

Amazon Comprehend supports SNS completion notifications for applicable asynchronous jobs. Notification coverage is selected-job functionality rather than a general webhook model.

Martini implementation pattern

Martini implementation pattern: Martini receives the supported notification through an AWS-facing event or HTTP integration pattern, treats it as a trigger, retrieves authoritative job status, and processes the S3 output only after validation.

Implementation sequence

Receive the SNS-delivered job notification
Extract the referenced job identifier
Retrieve the authoritative job status
Handle failed or stopped jobs
Read the associated S3 output
Map results to the target workflow

Amazon S3 document processing

Amazon S3 is central to batch analysis: it supplies input documents, stores asynchronous output, and works with IAM roles specified for Comprehend access.

Martini implementation pattern

Martini implementation pattern: scheduled or event-driven workflows identify new S3 objects, coordinate Comprehend jobs, parse output files, and record source versions or content hashes for idempotent processing.

Implementation sequence

Detect or retrieve new S3 input objects
Record object version or content hash
Submit the corresponding Comprehend job
Wait for completion and output availability
Parse each generated result file
Persist processing status and downstream results

Common Amazon Comprehend integration patterns

Pattern 1: Analyze customer feedback in real time

When to use this pattern

Use this pattern when a portal, CRM, or support application needs an immediate sentiment, entity, key phrase, or language result for a customer message. The workflow can use confidence thresholds to decide whether to route, escalate, or simply store the analysis.

Integration direction
Customer application
Martini
Amazon Comprehend
Customer application
Example Mapping
Amazon Comprehend FieldCanonical FieldTarget Field
TextsourceTextCase.Description
SentimentsentimentLabelCase.Sentiment
SentimentScoresentimentConfidenceCase.SentimentConfidence
EntitiesdetectedEntitiesCase.ExtractedEntities
Martini implementation pattern

Martini receives and validates the message, invokes the appropriate synchronous Comprehend operations using signed AWS requests, applies confidence and escalation rules, and updates the source application or returns a standardized API response. Errors and throttling are routed through retry and operational handling.

Martini capabilities used
  • workflows
  • API consumption
  • data mapping
  • business rules
  • error handling

Pattern 2: Process documents through Amazon S3

When to use this pattern

Use this pattern for larger document collections that exceed practical synchronous processing requirements or need asynchronous classification, entity detection, sentiment, syntax, topic, or custom analysis.

Integration direction
Amazon S3
Martini
Amazon Comprehend
Amazon S3
Example Mapping
Amazon Comprehend FieldCanonical FieldTarget Field
S3 InputLocationsourceLocationComprehend.InputDataConfig
JobIdanalysisJobIdProcessing.JobId
JobStatusprocessingStatusProcessing.Status
S3 Output JSONanalysisResultsResults.OutputDocument
Martini implementation pattern

A scheduled Martini workflow identifies new S3 objects, submits the selected Comprehend job, stores the job identifier and source version, polls status or handles a supported notification, and parses output JSON after completion. Duplicate submissions are avoided with a content hash or stable source key.

Martini capabilities used
  • scheduled workflows
  • workflow orchestration
  • API consumption
  • JSON handling
  • data mapping
  • idempotency and error handling

Pattern 3: Route support tickets using language analysis

When to use this pattern

Use this pattern when support tickets need automated prioritization, assignment, tagging, or escalation based on sentiment, entities, key phrases, language, or custom classification results.

Integration direction
ServiceNow
Martini
Amazon Comprehend
ServiceNow
Example Mapping
Amazon Comprehend FieldCanonical FieldTarget Field
Short description and descriptionticketTextIncident.Description
SentimentsentimentLabelIncident.Priority
DominantLanguagelanguageCodeIncident.Language
KeyPhrasesroutingTermsIncident.Tags
Martini implementation pattern

Martini consumes new or changed ticket data, normalizes the text, invokes Comprehend, and applies explicit routing rules only when confidence thresholds are met. It updates the ticket through the destination API and records failed analyses for controlled retry without repeatedly changing assignments.

Martini capabilities used
  • event-driven workflows
  • API consumption
  • data transformation
  • business rules
  • retries
  • audit logging

Pattern 4: Detect PII before downstream transfer

When to use this pattern

Use this pattern when free-form text or documents must be screened before being sent to another application, analytics platform, or processing stage. The workflow can route sensitive content for approved handling or apply explicit masking logic.

Integration direction
Upstream application
Martini
Amazon Comprehend
Approved downstream system
Example Mapping
Amazon Comprehend FieldCanonical FieldTarget Field
TextcontentDownstream.Content
PIIEntitiespiiFindingsCompliance.Findings
BeginOffset and EndOffsetsensitiveTextRangesRedaction.Ranges
ContainsPiiEntitiescontainsPiiTransferDecision.Allow
Martini implementation pattern

Martini submits the content to PII detection, validates the returned findings, and applies configured routing or redaction rules before transfer. The workflow separates original and transformed payload handling, limits sensitive logging, and records the decision for audit purposes.

Martini capabilities used
  • workflows
  • API consumption
  • data mapping
  • validation
  • business rules
  • secure configuration

Applications commonly integrated with Amazon Comprehend

Amazon Comprehend can be combined with AWS services and enterprise applications when text analysis, classification, entity extraction, or privacy screening must become part of a broader business process. These integrations use the named system’s supported APIs or files together with Amazon Comprehend’s authenticated AWS APIs and S3 workflows.

Application Scenario Direction Martini Pattern
Amazon S3 Amazon S3 supplies documents for asynchronous analysis and stores Amazon Comprehend output files. Amazon S3 → Amazon Comprehend Martini starts the relevant asynchronous job with S3 input and output locations, tracks the job, reads generated JSON files, and maps results to downstream models.
Amazon Transcribe Transcribed call or meeting text can be analyzed for sentiment, entities, key phrases, and language. Amazon Transcribe → Martini → Amazon Comprehend A Martini workflow receives or retrieves transcript text, validates it, invokes the appropriate Comprehend operation, and routes the analysis results to storage or an operational application.
Amazon Connect Contact-center interaction text can be analyzed to support sentiment, escalation, and agent-assistance processes. Amazon Connect → Martini → Amazon Comprehend Martini consumes an available transcript or interaction payload, submits supported text for analysis, applies confidence-based rules, and sends derived outcomes to the relevant workflow.
Amazon Textract Extracted text from scanned documents can be classified or enriched with entities and key phrases. Amazon Textract → Martini → Amazon Comprehend Martini receives Textract output, normalizes document text, invokes synchronous or asynchronous Comprehend analysis based on size, and persists the combined result.
Salesforce Cases, Leads, and other text-bearing objects can be enriched with sentiment, entities, or classification results. Salesforce → Martini → Amazon Comprehend → Salesforce Martini consumes Salesforce data through its supported API, submits selected text to Comprehend, maps confidence-aware results, and updates approved Salesforce fields or actions.
ServiceNow Incidents and requests can use sentiment, entities, or classification to support assignment, prioritization, and escalation. ServiceNow → Martini → Amazon Comprehend → ServiceNow A Martini workflow retrieves new or changed ServiceNow items, analyzes relevant text, applies routing rules, and writes priority, assignment, tags, or escalation updates through ServiceNow APIs.
Zendesk Ticket subjects and descriptions can be analyzed for sentiment, routing, escalation, and tagging. Zendesk → Martini → Amazon Comprehend → Zendesk Martini receives ticket events or scheduled changes, invokes Comprehend analysis, evaluates confidence thresholds, and updates Zendesk fields using its supported API.
Snowflake Comprehend outputs can be persisted for reporting, model evaluation, and trend analysis. Amazon Comprehend → Amazon S3 → Martini → Snowflake Martini parses Comprehend JSON output from S3, standardizes analysis dimensions and confidence values, and loads governed results into Snowflake through an approved data interface.

How to build a Amazon Comprehend integration in Martini

Objective

Configure the AWS region, Comprehend service settings, S3 locations, and IAM permissions required for the selected analysis flow.

Instructions in Martini

  • Store access keys, temporary credentials, role settings, and other secrets outside workflow definitions.
  • Configure AWS Signature Version 4 signing directly or use an approved AWS SDK-based intermediary.
  • Grant least-privilege Comprehend, S3, SNS, and KMS permissions where required.

Objective

Select a synchronous API, scheduled workflow, S3-driven process, or supported SNS notification based on document volume and response-time requirements.

Instructions in Martini

  • Use synchronous operations for short text requiring an immediate result.
  • Use scheduled or event-driven processing for S3-based asynchronous jobs.
  • Treat SNS notifications as selected job notifications rather than general Comprehend webhooks.

Objective

Receive text from an API or identify source documents and metadata in Amazon S3 before submitting analysis.

Instructions in Martini

  • Validate encoding, language, document size, and required source metadata.
  • Record an object version, stable business key, or content hash for idempotency.
  • Retrieve the current job or source state before processing repeated events.

Objective

Coordinate signed API requests, asynchronous job submission, status checks, notification handling, and output retrieval in a maintainable Martini workflow.

Instructions in Martini

  • Store Comprehend job identifiers and source references.
  • Poll Describe...Job operations with controlled intervals when notifications are not used.
  • Separate transient failures from failed or stopped analysis jobs.

Objective

Convert Comprehend responses and S3 JSON output into canonical fields and destination-specific structures.

Instructions in Martini

  • Map sentiment, entities, key phrases, languages, PII findings, labels, offsets, and confidence values.
  • Parse asynchronous output files and associate each result with its source document.
  • Apply explicit confidence thresholds rather than treating every finding as definitive.

Objective

Use analysis results to determine routing, escalation, redaction, classification, or persistence decisions.

Instructions in Martini

  • Define business rules for low-confidence, unsupported-language, and PII cases.
  • Prevent repeated job submissions and duplicate downstream updates.
  • Keep privacy, retention, and regional processing requirements in the workflow design.

Common Amazon Comprehend data objects used in integrations

ObjectTypical UseCommon target systemsMartini handling
DocumentText submitted for synchronous analysis or stored in Amazon S3 for asynchronous processing.Amazon S3, Salesforce, ServiceNow, Zendesk, SnowflakeMartini validates size, language, encoding, and source metadata, then sends text directly or coordinates S3-based processing.
EntityRepresents a detected person, organization, location, date, quantity, commercial item, or custom entity type with confidence information.Salesforce, ServiceNow, Zendesk, SnowflakeMartini maps entity types, text spans, offsets, and confidence values into target fields or normalized child structures.
Key phraseCaptures an important concept identified in a document, including confidence and character offsets.Zendesk, Salesforce, Snowflake, data storesMartini converts key phrases into tags, searchable attributes, analytical rows, or routing inputs according to business rules.
SentimentClassifies text as POSITIVE, NEGATIVE, NEUTRAL, or MIXED with confidence scores.Salesforce, ServiceNow, Zendesk, SnowflakeMartini applies configurable thresholds and maps sentiment and confidence to priority, escalation, reporting, or notification actions.
Dominant languageIdentifies the language or languages detected in submitted text with confidence scores.Customer applications, support platforms, SnowflakeMartini uses language results for routing, validation, localization decisions, or downstream analytics.
Analysis jobTracks an asynchronous entities, key phrase, sentiment, syntax, topic, classification, or custom analysis operation.Amazon S3, operational databases, monitoring systemsMartini stores the job identifier and source metadata, polls status or handles selected notifications, and processes output only after completion.

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.

Frequently asked questions

How can Amazon Comprehend be integrated with enterprise systems?

Amazon Comprehend can be integrated through its regional HTTPS APIs using the AWS JSON protocol, synchronous text-analysis operations, and asynchronous jobs that use Amazon S3 for input and output. Selected asynchronous jobs can also publish completion notifications through Amazon SNS. Enterprise workflows must implement AWS Signature Version 4 and IAM authorization, then map results into applications, databases, or APIs.

Can Martini integrate with Amazon Comprehend?

Yes. Martini can integrate with Amazon Comprehend by consuming its authenticated HTTPS APIs, coordinating Amazon S3-based asynchronous jobs, polling job-status operations, handling selected SNS notifications, and mapping results into downstream systems. No dedicated native Martini Amazon Comprehend connector is documented in the supplied materials.

Do I need a connector to integrate Amazon Comprehend with Martini?

No. A dedicated Amazon Comprehend connector is not required. Martini can use Amazon Comprehend’s native HTTPS APIs, AWS Signature Version 4 and IAM authentication, Amazon S3 processing, and selected SNS job notifications, with signing implemented directly or delegated to an AWS SDK-based service.

Is there any extra Lonti cost to integrate Amazon Comprehend with Martini?

Lonti does not charge an additional per-connector or per-vendor fee to integrate Amazon Comprehend. The integration is subject to the provisioned capacity of the Martini environment. Separate costs may apply from AWS, including Amazon Comprehend, Amazon S3, SNS, KMS, infrastructure, or other third-party services, depending on usage and deployment model.

Which Amazon Comprehend integration methods should architects use?

Use synchronous HTTPS operations for short text and immediate decisions, and asynchronous Comprehend jobs with Amazon S3 for larger document collections or batch processing. AWS SigV4 and IAM are required. Selected job notifications through Amazon SNS can complement, but do not replace, status polling and authoritative job checks.

Does Amazon Comprehend provide webhooks or event notifications?

Amazon Comprehend supports completion notifications through Amazon SNS for applicable asynchronous jobs. This is limited notification coverage, not a general webhook for every API operation. Martini can process a supported notification or use a scheduled workflow to poll the relevant Describe...Job operation.

How are Amazon Comprehend synchronization and duplicate jobs handled?

Martini can use scheduled or event-driven workflows, store Comprehend job identifiers, and track source S3 object versions, stable business keys, or content hashes. These controls help distinguish new documents from repeated notifications and prevent duplicate job submissions or downstream updates.

Can Martini expose a standardized API for Amazon Comprehend analysis?

Yes. Martini can expose a REST API that accepts text or an analysis request, invokes the required signed Amazon Comprehend operation, applies validation and business rules, and returns a normalized response. This creates a controlled façade without requiring every consuming application to implement AWS request signing.