{
  "version": 0,
  "requires": [
    {
      "id": "agent.provider",
      "structuredOutput": "json-schema"
    }
  ],
  "execution": {
    "transactionMode": "SAFE_AUTO_COMMIT"
  },
  "entry": "b1",
  "blocks": {
    "b1": {
      "type": "askAgent",
      "inputs": {
        "providerRequirement": "agent.provider",
        "task": "Extract a compact editorial review record from the input text. Return only JSON matching the requested schema.",
        "inputText": "My name is Alex and this is a first test. hello World!",
        "outputSchemaJson": "{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"needsEditing\":{\"type\":\"boolean\"},\"issues\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}},\"required\":[\"name\",\"needsEditing\",\"issues\"],\"additionalProperties\":false}",
        "repairAttempts": 2,
        "timeoutMs": 120000,
        "maxOutputChars": 2000,
        "onFailure": "SET_NOT_OK_AND_CONTINUE",
        "storeOkIn": "agentOk",
        "storeErrorIn": "agentError",
        "storeTextIn": "resultJson",
        "storeRawPathIn": "rawArtifactPath",
        "storeResultJsonPathIn": "validatedJsonArtifactPath",
        "storeFieldsIn": {
          "name": "personName",
          "needsEditing": "needsEditing",
          "issues": "issues"
        }
      },
      "next": "b2"
    },
    "b2": {
      "type": "esConsoleLog",
      "inputs": {
        "message": {
          "type": "textJoin",
          "inputs": {
            "items": [
              "STRUCTURED_ASK_AGENT|ok=",
              {
                "var": "agentOk"
              },
              "|name=",
              {
                "var": "personName"
              },
              "|needsEditing=",
              {
                "var": "needsEditing"
              },
              "|issues=",
              {
                "var": "issues"
              },
              "|error=",
              {
                "var": "agentError"
              },
              "|json=",
              {
                "var": "resultJson"
              },
              "|rawArtifact=",
              {
                "var": "rawArtifactPath"
              },
              "|validatedJsonArtifact=",
              {
                "var": "validatedJsonArtifactPath"
              }
            ]
          }
        }
      },
      "next": null
    }
  }
}
