AWS Step Functions HTTP Task to TypeSafe Jev confidence gate

Amazon API Gateway REST API → AWS Step Functions Express workflow → Amazon SNS Security alerts → Amazon SQS Human-review queue

An AWS Step Functions Choice state acts on TypeSafe Jev answers only when Jev is confident; the rest, and any failed Jev call, go to an Amazon SQS review queue.

This pattern deploys an Amazon API Gateway REST API that starts an AWS Step Functions Express workflow synchronously. An HTTP Task in the workflow calls the TypeSafe Jev API through an Amazon EventBridge connection that holds the API key, so no AWS Lambda function sits in the request path. Jev answers three typed questions about a support ticket in one call: a choice for the owning department, a score for urgency, and a yes/no question about an active security incident.
A Choice state is the confidence gate. A ticket is auto-routed only when the department and urgency confidences clear their thresholds and a security incident is not suspected. A suspected security incident is published to an Amazon SNS topic and still goes to a person. Everything else, including any ticket for which the Jev call failed or returned something unusable, goes to an Amazon SQS human-review queue with a dead-letter queue behind it.
You need a TypeSafe account and API key, which is billed by TypeSafe separately from AWS.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/sfn-choice-jev/typescript/cdk

Deploy

git clone https://github.com/aws-samples/serverless-patternscd serverless-patterns/sfn-choice-jev/typescript/cdknpm installnpx cdk bootstrapread -rs JEV_API_KEYnpx cdk deploy --parameters JevApiKey="$JEV_API_KEY"


Testing

Send a clear ticket, an ambiguous ticket and a security ticket to the POST /tickets endpoint with curl, and read the Amazon SQS review queue.
See the GitHub repo for the commands and expected output.

Cleanup

Delete the stack: npx cdk destroy. This also deletes the review queues and any tickets still in them.

Created by:

Nithin Chandran R

Nithin Chandran R

Technical Account Manager at AWS