Search⌘ K

Test Quality Control

Explore how to effectively deploy and test a quality control workflow using AWS Step Functions. Understand running state machines, monitoring execution via the AWS console, and handling common errors like insufficient ingredients with database checks. Gain hands-on experience to ensure your automated processes run smoothly and reliably.

Now, we can test our flow. The first step is to deploy the project. Click the “Run” button, and then use the sls deploy command.

import {
  APIGatewayProxyEvent,
  APIGatewayProxyHandler,
  APIGatewayProxyResult,
} from "aws-lambda";
import { validate as uuidValidate } from "uuid";

export const handler: APIGatewayProxyHandler = async (
  event: APIGatewayProxyEvent
): Promise<APIGatewayProxyResult> => {
  const batchId = event.body?.batchId;

  if (batchId && uuidValidate(batchId)) {
    return { validApiQualityCheck: true };
  } else {
    throw new Error("Quality check failed: invalid batch ID");
  }
};
Project

Testing quality control flow

After the deployment is ...