{
  "definition": {
    "nodes": [
      {
        "id": "lab",
        "type": "input",
        "label": "Lab result",
        "position": {
          "x": 0,
          "y": 150
        },
        "config": {
          "required_fields": [
            "patient_id",
            "test",
            "value"
          ],
          "defaults": {
            "patient_id": "test-patient-a",
            "test": "potassium",
            "value": 4.2
          }
        }
      },
      {
        "id": "value",
        "type": "jsonpath",
        "label": "Pick the value",
        "position": {
          "x": 290,
          "y": 0
        },
        "config": {
          "path": "value"
        }
      },
      {
        "id": "decision",
        "type": "condition",
        "label": "Value above 5.5?",
        "position": {
          "x": 590,
          "y": 150
        },
        "config": {
          "field": "value",
          "condition_type": "greater_than",
          "compare_value": 5.5,
          "pass_through": {
            "record": "context"
          }
        }
      },
      {
        "id": "high",
        "type": "transform",
        "label": "High-value record",
        "position": {
          "x": 900,
          "y": 0
        },
        "config": {
          "transformation_type": "map",
          "mappings": {
            "patient": "input.record.patient_id",
            "test": "input.record.test",
            "value": "input.record.value"
          }
        }
      },
      {
        "id": "routine",
        "type": "transform",
        "label": "Routine record",
        "position": {
          "x": 900,
          "y": 320
        },
        "config": {
          "transformation_type": "map",
          "mappings": {
            "patient": "input.record.patient_id",
            "test": "input.record.test",
            "value": "input.record.value"
          }
        }
      },
      {
        "id": "result",
        "type": "output",
        "label": "Result",
        "position": {
          "x": 1210,
          "y": 150
        },
        "config": {
          "output_format": "json"
        }
      }
    ],
    "connections": [
      {
        "id": "edge-0",
        "source_node": "lab",
        "source_port": "output",
        "target_node": "value",
        "target_port": "data"
      },
      {
        "id": "edge-1",
        "source_node": "value",
        "source_port": "value",
        "target_node": "decision",
        "target_port": "field"
      },
      {
        "id": "edge-2",
        "source_node": "lab",
        "source_port": "output",
        "target_node": "decision",
        "target_port": "context"
      },
      {
        "id": "edge-3",
        "source_node": "decision",
        "source_port": "true",
        "target_node": "high",
        "target_port": "input"
      },
      {
        "id": "edge-4",
        "source_node": "decision",
        "source_port": "false",
        "target_node": "routine",
        "target_port": "input"
      },
      {
        "id": "edge-5",
        "source_node": "high",
        "source_port": "result",
        "target_node": "result",
        "target_port": "input"
      },
      {
        "id": "edge-6",
        "source_node": "routine",
        "source_port": "result",
        "target_node": "result",
        "target_port": "input"
      }
    ]
  }
}