{
"Comment": "End-to-end AI content moderation pipeline covering content ingestion, multi-label classification, human review routing, moderation action enforcement, classifier feedback, and outcome notification.",
"StartAt": "IngestContent",
"States": {
"IngestContent": {
"Type": "Task",
"Resource": "${IngestContentFunctionArn}",
"Retry": [
{
"ErrorEquals": [
"States.ALL"
],
"IntervalSeconds": 2,
"MaxAttempts": 2,
"BackoffRate": 2
}
],
"Catch": [
{
"ErrorEquals": [
"States.ALL"
],
"Next": "ModerationFailed"
}
],
"Next": "ClassifyContent"
},
"ClassifyContent": {
"Type": "Task",
"Resource": "${ClassifyContentFunctionArn}",
"Retry": [
{
"ErrorEquals": [
"States.ALL"
],
"IntervalSeconds": 2,
"MaxAttempts": 2,
"BackoffRate": 2
}
],
"Catch": [
{
"ErrorEquals": [
"States.ALL"
],
"Next": "ModerationFailed"
}
],
"Next": "RouteForReview"
},
"RouteForReview": {
"Type": "Task",
"Resource": "${RouteForReviewFunctionArn}",
"Retry": [
{
"ErrorEquals": [
"States.ALL"
],
"IntervalSeconds": 2,
"MaxAttempts": 2,
"BackoffRate": 2
}
],
"Catch": [
{
"ErrorEquals": [
"States.ALL"
],
"Next": "ModerationFailed"
}
],
"Next": "RequiresHumanReview"
},
"RequiresHumanReview": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.reviewRouting.pendingHumanReview",
"BooleanEquals": true,
"Next": "HumanReviewQueue"
}
],
"Default": "ParallelActionAndFeedback"
},
"HumanReviewQueue": {
"Type": "Task",
"Resource": "${HumanReviewQueueFunctionArn}",
"Retry": [
{
"ErrorEquals": [
"States.ALL"
],
"IntervalSeconds": 2,
"MaxAttempts": 2,
"BackoffRate": 2
}
],
"Catch": [
{
"ErrorEquals": [
"States.ALL"
],
"Next": "ModerationFailed"
}
],
"Next": "ParallelActionAndFeedback"
},
"ParallelActionAndFeedback": {
"Type": "Parallel",
"Branches": [
{
"StartAt": "ApplyModerationAction",
"States": {
"ApplyModerationAction": {
"Type": "Task",
"Resource": "${ApplyModerationActionFunctionArn}",
"Retry": [
{
"ErrorEquals": [
"States.ALL"
],
"IntervalSeconds": 2,
"MaxAttempts": 2,
"BackoffRate": 2
}
],
"End": true
}
}
},
{
"StartAt": "UpdateClassifierFeedback",
"States": {
"UpdateClassifierFeedback": {
"Type": "Task",
"Resource": "${UpdateClassifierFeedbackFunctionArn}",
"Retry": [
{
"ErrorEquals": [
"States.ALL"
],
"IntervalSeconds": 2,
"MaxAttempts": 2,
"BackoffRate": 2
}
],
"End": true
}
}
}
],
"Catch": [
{
"ErrorEquals": [
"States.ALL"
],
"Next": "ModerationFailed"
}
],
"Next": "MergeActionAndFeedback"
},
"MergeActionAndFeedback": {
"Type": "Pass",
"Parameters": {
"contentId.$": "$[0].contentId",
"contentType.$": "$[0].contentType",
"platform.$": "$[0].platform",
"source.$": "$[0].source",
"submittedBy.$": "$[0].submittedBy",
"metadata.$": "$[0].metadata",
"rawContent.$": "$[0].rawContent",
"contentIngestion.$": "$[0].contentIngestion",
"classification.$": "$[0].classification",
"reviewRouting.$": "$[0].reviewRouting",
"humanReview.$": "$[0].humanReview",
"enforcement.$": "$[0].enforcement",
"moderationComplete.$": "$[0].moderationComplete",
"classifierFeedback.$": "$[1].classifierFeedback"
},
"Next": "NotifyModerationOutcome"
},
"NotifyModerationOutcome": {
"Type": "Task",
"Resource": "${NotifyModerationOutcomeFunctionArn}",
"Retry": [
{
"ErrorEquals": [
"States.ALL"
],
"IntervalSeconds": 2,
"MaxAttempts": 2,
"BackoffRate": 2
}
],
"Catch": [
{
"ErrorEquals": [
"States.ALL"
],
"Next": "ModerationFailed"
}
],
"Next": "ModerationComplete"
},
"ModerationComplete": {
"Type": "Succeed"
},
"ModerationFailed": {
"Type": "Fail",
"Error": "ModerationFailed",
"Cause": "Content moderation pipeline encountered an unrecoverable error. Content status is unknown and requires manual review."
}
}
}JSONExpand
100%
AI teams can use patterns like this to build reliable, compliant, and scalable automation for payment systems and can test and refine these flows locally with Thrubit to reduce cloud cost and speed up iteration.