{
  "artifactVersion": "loop.plan.artifact/v1",
  "compilerVersion": "loop.plan.compiler/v1",
  "apiVersion": "loop.plan/v1",
  "digest": "sha256:c6d87321ca80fae87cd922b7e5d1d94aa9606a6117709fe810ff9f31cb28a230",
  "contracts": {
    "input": [
      {
        "name": "value",
        "schema": {
          "type": "string",
          "required": true,
          "default": null,
          "values": [],
          "items": null
        }
      }
    ],
    "output": [
      {
        "name": "value",
        "schema": {
          "type": "string",
          "required": true,
          "default": null,
          "values": [],
          "items": null
        }
      }
    ],
    "state": []
  },
  "entry": {
    "nodeId": "outer",
    "port": "in",
    "bindings": [
      {
        "target": "value",
        "value": {
          "op": "load",
          "resultType": "string",
          "load": {
            "space": "plan_input",
            "path": [
              "value"
            ]
          }
        }
      }
    ]
  },
  "nodes": [
    {
      "id": "failure",
      "opcode": "end.failed",
      "inputPorts": [
        {
          "name": "in",
          "contract": []
        }
      ],
      "outputPorts": [],
      "stateEffects": {
        "reads": [],
        "writes": []
      },
      "scopePath": [
        {
          "kind": "parallel",
          "ownerId": "outer",
          "branch": "left"
        }
      ],
      "config": {
        "end": {
          "code": "parallel_failed"
        }
      }
    },
    {
      "id": "inner",
      "opcode": "fork",
      "inputPorts": [
        {
          "name": "in",
          "contract": [
            {
              "name": "value",
              "schema": {
                "type": "string",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ]
        }
      ],
      "outputPorts": [
        {
          "name": "a",
          "contract": [
            {
              "name": "value",
              "schema": {
                "type": "string",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ]
        },
        {
          "name": "b",
          "contract": [
            {
              "name": "value",
              "schema": {
                "type": "string",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ]
        }
      ],
      "stateEffects": {
        "reads": [],
        "writes": []
      },
      "scopePath": [
        {
          "kind": "parallel",
          "ownerId": "outer",
          "branch": "left"
        }
      ],
      "config": {
        "fork": {
          "branches": [
            "a",
            "b"
          ]
        }
      }
    },
    {
      "id": "inner_join",
      "opcode": "join.all",
      "inputPorts": [
        {
          "name": "a",
          "contract": [
            {
              "name": "value",
              "schema": {
                "type": "string",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ]
        },
        {
          "name": "b",
          "contract": [
            {
              "name": "value",
              "schema": {
                "type": "string",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ]
        }
      ],
      "outputPorts": [
        {
          "name": "completed",
          "contract": [
            {
              "name": "value",
              "schema": {
                "type": "string",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ]
        },
        {
          "name": "failed",
          "contract": []
        }
      ],
      "stateEffects": {
        "reads": [],
        "writes": []
      },
      "scopePath": [
        {
          "kind": "parallel",
          "ownerId": "outer",
          "branch": "left"
        }
      ],
      "config": {
        "join": {
          "ownerId": "inner",
          "result": [
            {
              "name": "value",
              "schema": {
                "type": "string",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ],
          "merge": [
            {
              "target": "value",
              "value": {
                "op": "load",
                "resultType": "string",
                "load": {
                  "space": "join_branch",
                  "scopeOwnerId": "inner",
                  "branch": "a",
                  "path": [
                    "value"
                  ]
                }
              }
            }
          ]
        }
      }
    },
    {
      "id": "outer",
      "opcode": "fork",
      "inputPorts": [
        {
          "name": "in",
          "contract": [
            {
              "name": "value",
              "schema": {
                "type": "string",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ]
        }
      ],
      "outputPorts": [
        {
          "name": "left",
          "contract": [
            {
              "name": "value",
              "schema": {
                "type": "string",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ]
        },
        {
          "name": "right",
          "contract": [
            {
              "name": "value",
              "schema": {
                "type": "string",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ]
        }
      ],
      "stateEffects": {
        "reads": [],
        "writes": []
      },
      "scopePath": [],
      "config": {
        "fork": {
          "branches": [
            "left",
            "right"
          ]
        }
      }
    },
    {
      "id": "outer_join",
      "opcode": "join.all",
      "inputPorts": [
        {
          "name": "left",
          "contract": [
            {
              "name": "value",
              "schema": {
                "type": "string",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ]
        },
        {
          "name": "right",
          "contract": [
            {
              "name": "value",
              "schema": {
                "type": "string",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ]
        }
      ],
      "outputPorts": [
        {
          "name": "completed",
          "contract": [
            {
              "name": "value",
              "schema": {
                "type": "string",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ]
        },
        {
          "name": "failed",
          "contract": []
        }
      ],
      "stateEffects": {
        "reads": [],
        "writes": []
      },
      "scopePath": [],
      "config": {
        "join": {
          "ownerId": "outer",
          "result": [
            {
              "name": "value",
              "schema": {
                "type": "string",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ],
          "merge": [
            {
              "target": "value",
              "value": {
                "op": "load",
                "resultType": "string",
                "load": {
                  "space": "join_branch",
                  "scopeOwnerId": "outer",
                  "branch": "left",
                  "path": [
                    "value"
                  ]
                }
              }
            }
          ]
        }
      }
    },
    {
      "id": "success",
      "opcode": "end.succeeded",
      "inputPorts": [
        {
          "name": "in",
          "contract": [
            {
              "name": "value",
              "schema": {
                "type": "string",
                "required": true,
                "default": null,
                "values": [],
                "items": null
              }
            }
          ]
        }
      ],
      "outputPorts": [],
      "stateEffects": {
        "reads": [],
        "writes": []
      },
      "scopePath": [],
      "config": {
        "end": {
          "code": ""
        }
      }
    }
  ],
  "edges": [
    {
      "id": "inner_a",
      "source": {
        "nodeId": "inner",
        "port": "a"
      },
      "target": {
        "nodeId": "inner_join",
        "port": "a"
      },
      "bindings": [
        {
          "target": "value",
          "value": {
            "op": "load",
            "resultType": "string",
            "load": {
              "space": "activation_input",
              "path": [
                "value"
              ]
            }
          }
        }
      ],
      "scopeTransitions": [
        {
          "scopeKind": "parallel",
          "ownerId": "inner",
          "action": "arrive",
          "branch": "a"
        },
        {
          "scopeKind": "parallel",
          "ownerId": "inner",
          "action": "enter",
          "branch": "a"
        }
      ]
    },
    {
      "id": "inner_b",
      "source": {
        "nodeId": "inner",
        "port": "b"
      },
      "target": {
        "nodeId": "inner_join",
        "port": "b"
      },
      "bindings": [
        {
          "target": "value",
          "value": {
            "op": "load",
            "resultType": "string",
            "load": {
              "space": "activation_input",
              "path": [
                "value"
              ]
            }
          }
        }
      ],
      "scopeTransitions": [
        {
          "scopeKind": "parallel",
          "ownerId": "inner",
          "action": "arrive",
          "branch": "b"
        },
        {
          "scopeKind": "parallel",
          "ownerId": "inner",
          "action": "enter",
          "branch": "b"
        }
      ]
    },
    {
      "id": "inner_completed",
      "source": {
        "nodeId": "inner_join",
        "port": "completed"
      },
      "target": {
        "nodeId": "outer_join",
        "port": "left"
      },
      "bindings": [
        {
          "target": "value",
          "value": {
            "op": "load",
            "resultType": "string",
            "load": {
              "space": "activation_output",
              "path": [
                "value"
              ]
            }
          }
        }
      ],
      "scopeTransitions": [
        {
          "scopeKind": "parallel",
          "ownerId": "outer",
          "action": "arrive",
          "branch": "left"
        }
      ]
    },
    {
      "id": "inner_failed",
      "source": {
        "nodeId": "inner_join",
        "port": "failed"
      },
      "target": {
        "nodeId": "failure",
        "port": "in"
      },
      "bindings": [],
      "scopeTransitions": []
    },
    {
      "id": "outer_completed",
      "source": {
        "nodeId": "outer_join",
        "port": "completed"
      },
      "target": {
        "nodeId": "success",
        "port": "in"
      },
      "bindings": [
        {
          "target": "value",
          "value": {
            "op": "load",
            "resultType": "string",
            "load": {
              "space": "activation_output",
              "path": [
                "value"
              ]
            }
          }
        }
      ],
      "scopeTransitions": []
    },
    {
      "id": "outer_failed",
      "source": {
        "nodeId": "outer_join",
        "port": "failed"
      },
      "target": {
        "nodeId": "failure",
        "port": "in"
      },
      "bindings": [],
      "scopeTransitions": []
    },
    {
      "id": "outer_left",
      "source": {
        "nodeId": "outer",
        "port": "left"
      },
      "target": {
        "nodeId": "inner",
        "port": "in"
      },
      "bindings": [
        {
          "target": "value",
          "value": {
            "op": "load",
            "resultType": "string",
            "load": {
              "space": "activation_input",
              "path": [
                "value"
              ]
            }
          }
        }
      ],
      "scopeTransitions": [
        {
          "scopeKind": "parallel",
          "ownerId": "outer",
          "action": "enter",
          "branch": "left"
        }
      ]
    },
    {
      "id": "outer_right",
      "source": {
        "nodeId": "outer",
        "port": "right"
      },
      "target": {
        "nodeId": "outer_join",
        "port": "right"
      },
      "bindings": [
        {
          "target": "value",
          "value": {
            "op": "load",
            "resultType": "string",
            "load": {
              "space": "activation_input",
              "path": [
                "value"
              ]
            }
          }
        }
      ],
      "scopeTransitions": [
        {
          "scopeKind": "parallel",
          "ownerId": "outer",
          "action": "arrive",
          "branch": "right"
        },
        {
          "scopeKind": "parallel",
          "ownerId": "outer",
          "action": "enter",
          "branch": "right"
        }
      ]
    }
  ],
  "scopes": [
    {
      "kind": "parallel",
      "ownerId": "inner",
      "parentPath": [
        {
          "kind": "parallel",
          "ownerId": "outer",
          "branch": "left"
        }
      ],
      "parallel": {
        "activationSet": "all",
        "joinId": "inner_join",
        "mode": "all",
        "branches": [
          {
            "port": "a",
            "members": [],
            "entryEdges": [
              "inner_a"
            ],
            "successArrivals": [
              "inner_a"
            ],
            "failedTerminals": []
          },
          {
            "port": "b",
            "members": [],
            "entryEdges": [
              "inner_b"
            ],
            "successArrivals": [
              "inner_b"
            ],
            "failedTerminals": []
          }
        ]
      }
    },
    {
      "kind": "parallel",
      "ownerId": "outer",
      "parentPath": [],
      "parallel": {
        "activationSet": "all",
        "joinId": "outer_join",
        "mode": "all",
        "branches": [
          {
            "port": "left",
            "members": [
              "inner",
              "inner_join"
            ],
            "entryEdges": [
              "outer_left"
            ],
            "successArrivals": [
              "inner_completed"
            ],
            "failedTerminals": [
              "failure"
            ]
          },
          {
            "port": "right",
            "members": [],
            "entryEdges": [
              "outer_right"
            ],
            "successArrivals": [
              "outer_right"
            ],
            "failedTerminals": []
          }
        ]
      }
    }
  ]
}
