The DOCUMENT_CLASSIFICATION action uses Amazon Comprehend to categorize documents based on a custom document classification model.
Use this action to automatically classify documents, emails, forms, contracts, correspondence, and other unstructured content into predefined business categories. Classification results can be used to route documents, trigger workflows, apply retention policies, or support automated decision-making processes.
Document classification uses a custom Amazon Comprehend classifier trained on your organization's data. The action submits the content for analysis and returns the classification results, including the predicted document class and associated confidence scores. A custom classifier ARN must be supplied either through connector configuration or through the action input parameters.
The connector submits the content to Amazon Comprehend using a custom classification model. The content is uploaded to Amazon S3, an asynchronous classification job is started where the connector monitors the job until processing completes or a timeout occurs. Next, the classification results are retrieved and the temporary files are removed after processing completes.
The action returns classification information that may include the predicted document category, classification confidence scores, and thr Amazon Comprehend processing results. The returned data can be mapped to process variables and used by gateways, forms, connectors, and other process elements.
The input parameters of the action are:
| Parameter | Type | Required | Description |
|---|---|---|---|
| confidenceLevel | String | Optional | The minimum confidence score required for an extracted entity to be included in the results. Specify a value between 0 and 1. Example: 0.95. |
| customClassificationArn | String | Optional |
The Amazon Resource Name (ARN) of the custom Amazon Comprehend document classification model used to classify the content. If this parameter is not provided, the connector uses the value configured in the AWS_COMPREHEND_CUSTOM_CLASSIFICATION_ARN setting. Because Amazon Comprehend does not provide a default document classifier, either this parameter or AWS_COMPREHEND_CUSTOM_CLASSIFICATION_ARN must be configured for document classification to succeed. |
| file | Array<content>, Content | Optional | The document to analyze. If multiple content objects are provided, only the first file is processed. File variables are typically populated by content actions or content-based trigger events. |
| maxEntities | Integer | Optional | The maximum number of entities to return in the analysis results. Example: 5. |
| mediaType | String | Optional | The media type of the content provided through the file parameter. Example: application/pdf or application/octet-stream. |
| text | String | Optional | The raw text content to analyze. |
| timeout | Integer | Optional | The maximum time, in milliseconds, that the connector waits for the analysis operation to complete. Example: 910000. |
The output parameters of the action are:
| Parameter | Type | Required | Description |
|---|---|---|---|
| awsResponse | JSON | Optional | The complete response returned by Amazon Comprehend. The contents depend on the type of analysis performed and may include entities, confidence scores, classification information, and other analysis metadata. |
| documentClassificationClasses | Array<string> | Optional | A list of the document classes identified during analysis. The returned values represent the classification categories predicted by the Amazon Comprehend custom document classifier for the analyzed content. |