{
  "artifactVersion": "loop.plan.artifact/v1",
  "compilerVersion": "loop.plan.compiler/v1",
  "apiVersion": "loop.plan/v1",
  "digest": "sha256:53ce95b83460fada046ecc978b4a56ba9a5d1e5225fc35378f098ff4942d3432",
  "contracts": {
    "input": [
      {
        "name": "channel",
        "schema": {
          "type": "channel",
          "required": true,
          "default": null,
          "values": [],
          "items": null
        }
      }
    ],
    "output": [
      {
        "name": "reply",
        "schema": {
          "type": "string",
          "required": true,
          "default": null,
          "values": [],
          "items": null
        }
      }
    ],
    "state": []
  },
  "entry": {
    "nodeId": "notify",
    "port": "in",
    "bindings": [
      {
        "target": "channel",
        "value": {
          "op": "load",
          "resultType": "channel",
          "load": {
            "space": "plan_input",
            "path": [
              "channel"
            ]
          }
        }
      }
    ]
  },
  "nodes": [
    {
      "id": "failure",
      "opcode": "end.failed",
      "inputPorts": [
        {
          "name": "in",
          "contract": []
        }
      ],
      "outputPorts": [],
      "stateEffects": {
        "reads": [],
        "writes": []
      },
      "scopePath": [],
      "config": {
        "end": {
          "code": "message_failed"
        }
      }
    },
    {
      "id": "notify",
      "opcode": "send_message.callback",
      "inputPorts": [
        {
          "name": "in",
          "contract": [
            {
              "name": "channel",
              "schema": {
                "type": "channel",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ]
        }
      ],
      "outputPorts": [
        {
          "name": "completed",
          "contract": [
            {
              "name": "reply",
              "schema": {
                "type": "string",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ]
        },
        {
          "name": "failed",
          "contract": []
        }
      ],
      "stateEffects": {
        "reads": [],
        "writes": []
      },
      "scopePath": [],
      "config": {
        "sendMessage": {
          "target": {
            "segments": [
              {
                "kind": "expr",
                "expression": {
                  "op": "load",
                  "resultType": "channel",
                  "load": {
                    "space": "activation_input",
                    "path": [
                      "channel"
                    ]
                  }
                }
              }
            ]
          },
          "text": {
            "segments": [
              {
                "kind": "text",
                "text": "@agent answer in "
              },
              {
                "kind": "expr",
                "expression": {
                  "op": "length",
                  "resultType": "number",
                  "args": [
                    {
                      "op": "load",
                      "resultType": "channel",
                      "load": {
                        "space": "activation_input",
                        "path": [
                          "channel"
                        ]
                      }
                    }
                  ]
                }
              },
              {
                "kind": "text",
                "text": " characters or more"
              }
            ]
          },
          "callbackOutput": [
            {
              "name": "reply",
              "schema": {
                "type": "string",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ],
          "retry": {
            "maxAttempts": 3,
            "backoffNanos": 1000000000
          }
        }
      }
    },
    {
      "id": "success",
      "opcode": "end.succeeded",
      "inputPorts": [
        {
          "name": "in",
          "contract": [
            {
              "name": "reply",
              "schema": {
                "type": "string",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ]
        }
      ],
      "outputPorts": [],
      "stateEffects": {
        "reads": [],
        "writes": []
      },
      "scopePath": [],
      "config": {
        "end": {
          "code": ""
        }
      }
    }
  ],
  "edges": [
    {
      "id": "delivered",
      "source": {
        "nodeId": "notify",
        "port": "completed"
      },
      "target": {
        "nodeId": "success",
        "port": "in"
      },
      "bindings": [
        {
          "target": "reply",
          "value": {
            "op": "load",
            "resultType": "string",
            "load": {
              "space": "activation_output",
              "path": [
                "reply"
              ]
            }
          }
        }
      ],
      "scopeTransitions": []
    },
    {
      "id": "delivery_failed",
      "source": {
        "nodeId": "notify",
        "port": "failed"
      },
      "target": {
        "nodeId": "failure",
        "port": "in"
      },
      "bindings": [],
      "scopeTransitions": []
    }
  ],
  "scopes": []
}
