{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-chime/json-schema/amazon-chime-create-channel-flow-request-schema.json",
  "title": "CreateChannelFlowRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-chime-channel-flows-api-openapi.yml#/components/schemas/CreateChannelFlowRequest",
  "type": "object",
  "properties": {
    "AppInstanceArn": {
      "type": "string",
      "description": "The ARN of the channel flow request."
    },
    "Processors": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Processor"
      },
      "description": "Information about the processor Lambda functions."
    },
    "Name": {
      "type": "string",
      "description": "The name of the channel flow."
    },
    "Tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MessagingChimeTag"
      },
      "description": "The tags for the creation request."
    },
    "ClientRequestToken": {
      "type": "string",
      "description": "The client token for the request. An Idempotency token."
    }
  },
  "required": [
    "AppInstanceArn",
    "Processors",
    "Name",
    "ClientRequestToken"
  ],
  "$defs": {
    "LambdaConfiguration": {
      "type": "object",
      "properties": {
        "ResourceArn": {
          "type": "string",
          "description": "The ARN of the Lambda message processing function."
        },
        "InvocationType": {
          "type": "string",
          "enum": [
            "ASYNC"
          ],
          "description": "Controls how the Lambda function is invoked."
        }
      },
      "required": [
        "ResourceArn",
        "InvocationType"
      ]
    },
    "MessagingChimeTag": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "The key in a tag."
        },
        "Value": {
          "type": "string",
          "description": "The value in a tag."
        }
      },
      "required": [
        "Key",
        "Value"
      ]
    },
    "Processor": {
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "The name of the channel flow."
        },
        "Configuration": {
          "$ref": "#/$defs/ProcessorConfiguration"
        },
        "ExecutionOrder": {
          "type": "integer",
          "description": "The sequence in which processors run. If you have multiple processors in a channel flow, message processing goes through each processor in the sequence. The value determines the sequence. At this point, we support only 1 processor within a flow."
        },
        "FallbackAction": {
          "type": "string",
          "enum": [
            "CONTINUE",
            "ABORT"
          ],
          "description": "Determines whether to continue with message processing or stop it in cases where communication with a processor fails. If a processor has a fallback action of ABORT and communication with it fails, the processor sets the message status to FAILED and does not send the message to any recipients. Note that if the last processor in the channel flow sequence has a fallback action of CONTINUE and communication with the processor fails, then the message is considered processed and sent to recipients of the channel."
        }
      },
      "required": [
        "Name",
        "Configuration",
        "ExecutionOrder",
        "FallbackAction"
      ]
    },
    "ProcessorConfiguration": {
      "type": "object",
      "properties": {
        "Lambda": {
          "$ref": "#/$defs/LambdaConfiguration"
        }
      },
      "required": [
        "Lambda"
      ]
    }
  }
}