{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-sagemaker/json-schema/amazon-sagemaker-create-flow-definition-request-schema.json",
  "title": "CreateFlowDefinitionRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-sagemaker-flow-definition-api-openapi.yml#/components/schemas/CreateFlowDefinitionRequest",
  "type": "object",
  "properties": {
    "FlowDefinitionName": {
      "type": "string",
      "description": "The name of your flow definition."
    },
    "HumanLoopRequestSource": {
      "$ref": "#/$defs/HumanLoopRequestSource"
    },
    "HumanLoopActivationConfig": {
      "$ref": "#/$defs/HumanLoopActivationConfig"
    },
    "HumanLoopConfig": {
      "$ref": "#/$defs/HumanLoopConfig"
    },
    "OutputConfig": {
      "$ref": "#/$defs/FlowDefinitionOutputConfig"
    },
    "RoleArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of the role needed to call other services on your behalf. For example, arn:aws:iam::1234567890:role/service-role/AmazonSageMaker-ExecutionRole-20180111T151298."
    },
    "Tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      },
      "description": "An array of key-value pairs that contain metadata to help you categorize and organize a flow definition. Each tag consists of a key and a value, both of which you define."
    }
  },
  "required": [
    "FlowDefinitionName",
    "OutputConfig",
    "RoleArn"
  ],
  "$defs": {
    "FlowDefinitionOutputConfig": {
      "type": "object",
      "properties": {
        "S3OutputPath": {
          "type": "string",
          "description": "The Amazon S3 path where the object containing human output will be made available. To learn more about the format of Amazon A2I output data, see Amazon A2I Output Data."
        },
        "KmsKeyId": {
          "type": "string",
          "description": "The Amazon Key Management Service (KMS) key ID for server-side encryption."
        }
      },
      "required": [
        "S3OutputPath"
      ]
    },
    "HumanLoopActivationConditionsConfig": {
      "type": "object",
      "properties": {
        "HumanLoopActivationConditions": {
          "type": "string",
          "description": "JSON expressing use-case specific conditions declaratively. If any condition is matched, atomic tasks are created against the configured work team. The set of conditions is different for Rekognition and Textract. For more information about how to structure the JSON, see JSON Schema for Human Loop Activation Conditions in Amazon Augmented AI in the Amazon SageMaker Developer Guide."
        }
      },
      "required": [
        "HumanLoopActivationConditions"
      ]
    },
    "HumanLoopActivationConfig": {
      "type": "object",
      "properties": {
        "HumanLoopActivationConditionsConfig": {
          "$ref": "#/$defs/HumanLoopActivationConditionsConfig"
        }
      },
      "required": [
        "HumanLoopActivationConditionsConfig"
      ]
    },
    "HumanLoopConfig": {
      "type": "object",
      "properties": {
        "WorkteamArn": {
          "type": "string",
          "description": "Amazon Resource Name (ARN) of a team of workers. To learn more about the types of workforces and work teams you can create and use with Amazon A2I, see Create and Manage Workforces."
        },
        "HumanTaskUiArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the human task user interface. You can use standard HTML and Crowd HTML Elements to create a custom worker task template. You use this template to create a human task UI. To learn how to create a custom HTML template, see Create Custom Worker Task Template. To learn how to create a human task UI, which is a worker task template that can be used in a flow definition, see Create and Delete a Worker Task Templates."
        },
        "TaskTitle": {
          "type": "string",
          "description": "A title for the human worker task."
        },
        "TaskDescription": {
          "type": "string",
          "description": "A description for the human worker task."
        },
        "TaskCount": {
          "type": "integer",
          "description": "The number of distinct workers who will perform the same task on each object. For example, if TaskCount is set to 3 for an image classification labeling job, three workers will classify each input image. Increasing TaskCount can improve label accuracy."
        },
        "TaskAvailabilityLifetimeInSeconds": {
          "type": "integer",
          "description": "The length of time that a task remains available for review by human workers."
        },
        "TaskTimeLimitInSeconds": {
          "type": "integer",
          "description": "The amount of time that a worker has to complete a task. The default value is 3,600 seconds (1 hour)."
        },
        "TaskKeywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Keywords used to describe the task so that workers can discover the task."
        },
        "PublicWorkforceTaskPrice": {
          "$ref": "#/$defs/PublicWorkforceTaskPrice"
        }
      },
      "required": [
        "WorkteamArn",
        "HumanTaskUiArn",
        "TaskTitle",
        "TaskDescription",
        "TaskCount"
      ]
    },
    "HumanLoopRequestSource": {
      "type": "object",
      "properties": {
        "AwsManagedHumanLoopRequestSource": {
          "type": "string",
          "enum": [
            "AWS/Rekognition/DetectModerationLabels/Image/V3",
            "AWS/Textract/AnalyzeDocument/Forms/V1"
          ],
          "description": "Specifies whether Amazon Rekognition or Amazon Textract are used as the integration source. The default field settings and JSON parsing rules are different based on the integration source. Valid values:"
        }
      },
      "required": [
        "AwsManagedHumanLoopRequestSource"
      ]
    },
    "PublicWorkforceTaskPrice": {
      "type": "object",
      "properties": {
        "AmountInUsd": {
          "$ref": "#/$defs/USD"
        }
      }
    },
    "Tag": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "The tag key. Tag keys must be unique per resource."
        },
        "Value": {
          "type": "string",
          "description": "The tag value."
        }
      },
      "required": [
        "Key",
        "Value"
      ]
    },
    "USD": {
      "type": "object",
      "properties": {
        "Dollars": {
          "type": "integer",
          "description": "The whole number of dollars in the amount."
        },
        "Cents": {
          "type": "integer",
          "description": "The fractional portion, in cents, of the amount."
        },
        "TenthFractionsOfACent": {
          "type": "integer",
          "description": "Fractions of a cent, in tenths."
        }
      }
    }
  }
}