{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aws-step-functions/json-schema/aws-step-functions-test-state-output-schema.json",
  "title": "TestStateOutput",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aws-step-functions-operations-api-openapi.yml#/components/schemas/TestStateOutput",
  "type": "object",
  "properties": {
    "output": {
      "type": "string",
      "description": "The JSON output data of the state. Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding."
    },
    "error": {
      "type": "string",
      "description": "The error returned when the execution of a state fails."
    },
    "cause": {
      "type": "string",
      "description": "A detailed explanation of the cause for the error when the execution of a state fails."
    },
    "inspectionData": {
      "$ref": "#/$defs/InspectionData"
    },
    "nextState": {
      "type": "string",
      "description": "The name of the next state to transition to. If you haven't defined a next state in your definition or if the execution of the state fails, this field doesn't contain a value."
    },
    "status": {
      "type": "string",
      "enum": [
        "SUCCEEDED",
        "FAILED",
        "RETRIABLE",
        "CAUGHT_ERROR"
      ],
      "description": "The execution status of the state."
    }
  },
  "$defs": {
    "InspectionData": {
      "type": "object",
      "properties": {
        "input": {
          "type": "string",
          "description": "The raw state input."
        },
        "afterArguments": {
          "type": "string",
          "description": "The input after Step Functions applies an Arguments filter. This event will only be present when QueryLanguage for the state machine or individual states is set to JSONata. For more info, see Transforming data with Step Functions."
        },
        "afterInputPath": {
          "type": "string",
          "description": "The input after Step Functions applies the InputPath filter. Not populated when QueryLanguage is JSONata."
        },
        "afterParameters": {
          "type": "string",
          "description": "The effective input after Step Functions applies the Parameters filter. Not populated when QueryLanguage is JSONata."
        },
        "result": {
          "type": "string",
          "description": "The state's raw result."
        },
        "afterResultSelector": {
          "type": "string",
          "description": "The effective result after Step Functions applies the ResultSelector filter. Not populated when QueryLanguage is JSONata."
        },
        "afterResultPath": {
          "type": "string",
          "description": "The effective result combined with the raw state input after Step Functions applies the ResultPath filter. Not populated when QueryLanguage is JSONata."
        },
        "request": {
          "$ref": "#/$defs/InspectionDataRequest"
        },
        "response": {
          "$ref": "#/$defs/InspectionDataResponse"
        },
        "variables": {
          "type": "string",
          "description": "JSON string that contains the set of workflow variables after execution of the state. The set will include variables assigned in the state and variables set up as test state input."
        },
        "errorDetails": {
          "$ref": "#/$defs/InspectionErrorDetails"
        },
        "afterItemsPath": {
          "type": "string",
          "description": "The effective input after the ItemsPath filter is applied. Not populated when the QueryLanguage is JSONata."
        },
        "afterItemSelector": {
          "type": "string",
          "description": "An array containing the inputs for each Map iteration, transformed by the ItemSelector specified in a Map state."
        },
        "afterItemBatcher": {
          "type": "string",
          "description": "The effective input after the ItemBatcher filter is applied in a Map state."
        },
        "afterItemsPointer": {
          "type": "string",
          "description": "The effective input after the ItemsPointer filter is applied in a Map state."
        },
        "toleratedFailureCount": {
          "type": "integer",
          "description": "The tolerated failure threshold for a Map state as defined in number of Map state iterations."
        },
        "toleratedFailurePercentage": {
          "type": "number",
          "description": "The tolerated failure threshold for a Map state as defined in percentage of Map state iterations."
        },
        "maxConcurrency": {
          "type": "integer",
          "description": "The max concurrency of the Map state."
        }
      }
    },
    "InspectionDataRequest": {
      "type": "object",
      "properties": {
        "protocol": {
          "type": "string",
          "description": "The protocol used to make the HTTP request."
        },
        "method": {
          "type": "string",
          "description": "The HTTP method used for the HTTP request."
        },
        "url": {
          "type": "string",
          "description": "The API endpoint used for the HTTP request."
        },
        "headers": {
          "type": "string",
          "description": "The request headers associated with the HTTP request."
        },
        "body": {
          "type": "string",
          "description": "The request body for the HTTP request."
        }
      }
    },
    "InspectionDataResponse": {
      "type": "object",
      "properties": {
        "protocol": {
          "type": "string",
          "description": "The protocol used to return the HTTP response."
        },
        "statusCode": {
          "type": "string",
          "description": "The HTTP response status code for the HTTP response."
        },
        "statusMessage": {
          "type": "string",
          "description": "The message associated with the HTTP status code."
        },
        "headers": {
          "type": "string",
          "description": "The response headers associated with the HTTP response."
        },
        "body": {
          "type": "string",
          "description": "The HTTP response returned."
        }
      }
    },
    "InspectionErrorDetails": {
      "type": "object",
      "properties": {
        "catchIndex": {
          "type": "integer",
          "description": "The array index of the Catch which handled the exception."
        },
        "retryIndex": {
          "type": "integer",
          "description": "The array index of the Retry which handled the exception."
        },
        "retryBackoffIntervalSeconds": {
          "type": "integer",
          "description": "The duration in seconds of the backoff for a retry on a failed state invocation."
        }
      }
    }
  }
}