{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "D1432AB0-661C-4AF0-A8E9-D2A4C71DAA59",
    "name": "traceroot: evaluation runs logged and compared"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -64.12440838404328,
        "y": 2.136578769438813,
        "zoom": 0.95
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When a traceroot evaluation run finishes, logs its result counts, pass rate and score means to a Google Sheet, compares it with the previous finished run of the same evaluation, and posts both runs side by side to Microsoft Teams when the pass rate went down.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When a traceroot evaluation run finishes, logs its result counts, pass rate and score means to a Google Sheet, compares it with the previous finished run of the same evaluation, and posts both runs side by side to Microsoft Teams when the pass rate went down.",
    "elements": [
      {
        "clientMetadata": {
          "notes": "Fires once for each evaluation run that leaves the running status: completed, completed with errors, failed, incomplete or canceled. Watches the 200 newest runs.",
          "elementId": "EXTENSION:::SHARED:::default:::traceroot:::onEvaluationRunFinished",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::traceroot:::onEvaluationRunFinished",
          "newElementId": "EXTENSION:::SHARED:::default:::traceroot:::onEvaluationRunFinished",
          "legacyElementId": null,
          "methodName": "onEvaluationRunFinished",
          "position": {
            "x": 138,
            "y": 40
          }
        },
        "flowElementId": "3CBFCDC0-3227-44DA-81AA-0D5C36C5D50B",
        "groupId": null,
        "id": "45C094AF-1569-43AB-BB6A-91B3AF1036F0",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "connectionId": null,
          "dynamicData": [],
          "eventName": "onEvaluationRunFinished",
          "frequency": {
            "repeat": {
              "every": 900
            },
            "schedule": "custom"
          },
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Finished run",
          "serviceId": "traceroot",
          "slaConditions": [],
          "staticData": {},
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "Evaluation run finished",
        "nextElementIds": [
          "C76FF049-1971-4A0D-8365-0169A005CE1F"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Gets an evaluation run's summary: status, result counts, and the mean of each score and metric. Boolean scores read as pass rates.",
          "elementId": "EXTENSION:::SHARED:::default:::traceroot:::getEvaluationRun",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the previous run's results Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::traceroot:::getEvaluationRun",
          "legacyElementId": null,
          "methodName": "getEvaluationRun",
          "position": {
            "x": 110,
            "y": 210
          }
        },
        "flowElementId": "75F2C58A-D647-403D-95FB-5797B73BB8E3",
        "groupId": null,
        "id": "97478BDC-EFFC-4FDA-A3E1-74965D5E9E8A",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "runId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Previous",
                    "subPathSegments": [
                      {
                        "key": "previousId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2AF14D61-201B-4963-9C6F-772257768062"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getEvaluationRun",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Previous run",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "traceroot",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the previous run's results",
        "nextElementIds": [
          "7007D449-0ACA-4EB2-8AA8-2C4A73B061CB"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Pick the previous run Result"
          },
          "position": {
            "x": 895,
            "y": 219
          }
        },
        "flowElementId": "9D6C94B8-154A-49B2-B879-1781ADC03B13",
        "groupId": null,
        "id": "2AF14D61-201B-4963-9C6F-772257768062",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "run",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Run",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "C76FF049-1971-4A0D-8365-0169A005CE1F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "runs",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Runs",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "C33E1DC6-112C-4B42-A9C7-B04C06CC0D48"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const scored = ['completed', 'completed_with_errors'];\nconst list = Array.isArray(runs.runs) ? runs.runs : [];\nlet previousId = '';\nif (scored.includes(run.status)) {\n  const earlier = list\n    .filter(r => r.evaluation_run_id !== run.evaluation_run_id && scored.includes(r.status) && Number(r.run_number) < Number(run.run_number))\n    .sort((a, b) => Number(b.run_number) - Number(a.run_number));\n  previousId = earlier.length ? earlier[0].evaluation_run_id : '';\n}\nreturn { previousId };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Previous",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Pick the previous run",
        "nextElementIds": [
          "9012C103-00A3-4D4D-BC96-ABF97E7798F5"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Posts an Adaptive Card to a team channel as the signed-in user, with optional text above it and an optional subject line. Use it for actionable notices such as an invoice exception card with Approve and Dispute buttons. Buttons must be Action.OpenUrl: Microsoft Graph supports only that action on a card a user posts, and other actions need a bot. Uses the same ChannelMessage.Send permission as Send Channel Message.",
          "elementId": "EXTENSION:::SHARED:::default:::microsoft-teams:::sendAdaptiveCardToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Post both runs to the team in Teams Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::microsoft-teams:::sendAdaptiveCardToChannel",
          "legacyElementId": "JS###v1###MicrosoftTeamsService###sendAdaptiveCardToChannel",
          "methodName": "sendAdaptiveCardToChannel",
          "position": {
            "x": 844,
            "y": 380
          }
        },
        "flowElementId": "3F09DC13-6C0C-4C56-86A2-A67CD612D126",
        "groupId": null,
        "id": "ED7947B5-463C-4D67-8D62-C1102EC149F4",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "teamId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "card",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Comparison",
                    "subPathSegments": [
                      {
                        "key": "card",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7007D449-0ACA-4EB2-8AA8-2C4A73B061CB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "text",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Comparison",
                    "subPathSegments": [
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7007D449-0ACA-4EB2-8AA8-2C4A73B061CB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Post both runs to the team in Teams', Error: Team is required",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendAdaptiveCardToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Teams card",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "microsoft-teams",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Post both runs to the team in Teams",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 482,
            "y": 389
          }
        },
        "flowElementId": "5454E8BC-DCA3-49D4-9DC9-096B60E312D4",
        "groupId": null,
        "id": "3CBCF138-B4B6-4F49-87FE-C5954379E9EA",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "141b6685-362e-40f6-a732-dbfd4c78167b",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Comparison",
                      "subPathSegments": [
                        {
                          "key": "dropped",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "7007D449-0ACA-4EB2-8AA8-2C4A73B061CB"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "yes"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "141b6685-362e-40f6-a732-dbfd4c78167b"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Dropped",
          "storeResult": false,
          "thenComponent": {
            "componentId": "ED7947B5-463C-4D67-8D62-C1102EC149F4",
            "componentType": "ELEMENT"
          }
        },
        "name": "Pass rate lower than last run?",
        "nextElementIds": [
          "ED7947B5-463C-4D67-8D62-C1102EC149F4"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the log row Result"
          },
          "position": {
            "x": 898,
            "y": 49
          }
        },
        "flowElementId": "6FC0505F-C807-4C9F-B8A4-C414046D41B0",
        "groupId": null,
        "id": "4D1461C3-984B-4FDF-AD8E-043CCD6CE38E",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "run",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Run",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "C76FF049-1971-4A0D-8365-0169A005CE1F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const total = Number(run.result_count) || 0;\nconst passed = Number(run.passed_count) || 0;\nconst passRate = total ? Math.round((passed / total) * 1000) / 10 : null;\nconst scores = [...(run.scores || []), ...(run.metrics || [])]\n  .map(s => `${s.name} ${s.value_type === 'boolean' ? Math.round(s.value * 1000) / 10 + '%' : s.value}${s.unit ? ' ' + s.unit : ''}`)\n  .join('; ');\nreturn {\n  passRate,\n  scores,\n  row: {\n    'Finished': run.completed_at || '',\n    'Evaluation': run.evaluation_name || run.evaluation_key || '',\n    'Run': run.run_number,\n    'Candidate version': run.candidate_version || '',\n    'Status': run.status || '',\n    'Cases': total,\n    'Passed': passed,\n    'Failed': Number(run.failed_count) || 0,\n    'Errored': Number(run.errored_count) || 0,\n    'Pass rate': passRate === null ? '' : passRate + '%',\n    'Scores': scores,\n    'Run link': run.run_url || '',\n  },\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Log row",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the log row",
        "nextElementIds": [
          "988DC4D6-1568-4316-AA49-480BC1EFE59F"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Compare the two runs Result"
          },
          "position": {
            "x": 140,
            "y": 389
          }
        },
        "flowElementId": "552A8E7B-8FD4-483D-8D4A-9753210410C7",
        "groupId": null,
        "id": "7007D449-0ACA-4EB2-8AA8-2C4A73B061CB",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "run",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Run",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "C76FF049-1971-4A0D-8365-0169A005CE1F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "prev",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Previous run",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "97478BDC-EFFC-4FDA-A3E1-74965D5E9E8A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const rate = r => { const t = Number(r.result_count) || 0; return t ? Math.round(((Number(r.passed_count) || 0) / t) * 1000) / 10 : null; };\nconst now = rate(run);\nconst before = rate(prev);\nconst dropped = now !== null && before !== null && now < before;\nconst fmt = r => [...(r.scores || []), ...(r.metrics || [])].map(s => `${s.name}: ${s.value_type === 'boolean' ? Math.round(s.value * 1000) / 10 + '%' : s.value}${s.unit ? ' ' + s.unit : ''}`).join(', ');\nconst col = (r, label, pr) => ({\n  type: 'Column', width: 'stretch', items: [\n    { type: 'TextBlock', text: `${label}: run #${r.run_number}`, weight: 'Bolder' },\n    { type: 'FactSet', facts: [\n      { title: 'Version', value: String(r.candidate_version || '') },\n      { title: 'Status', value: String(r.status || '') },\n      { title: 'Pass rate', value: pr === null ? 'n/a' : pr + '%' },\n      { title: 'Passed', value: `${r.passed_count || 0} of ${r.result_count || 0}` },\n      { title: 'Failed', value: String(r.failed_count || 0) },\n      { title: 'Errored', value: String(r.errored_count || 0) },\n    ] },\n    { type: 'TextBlock', text: fmt(r) || 'No scores', wrap: true, isSubtle: true },\n  ],\n});\nconst card = {\n  type: 'AdaptiveCard', version: '1.4',\n  body: [\n    { type: 'TextBlock', text: `Pass rate went down: ${run.evaluation_name || run.evaluation_key}`, weight: 'Bolder', size: 'Medium', wrap: true },\n    { type: 'TextBlock', text: `Run #${run.run_number} passed ${now}% of its cases. Run #${prev.run_number} passed ${before}%.`, wrap: true },\n    { type: 'ColumnSet', columns: [col(run, 'This run', now), col(prev, 'Previous', before)] },\n  ],\n  actions: [\n    { type: 'Action.OpenUrl', title: `Open run #${run.run_number} in traceroot`, url: run.run_url },\n    { type: 'Action.OpenUrl', title: `Open run #${prev.run_number}`, url: prev.run_url },\n  ],\n};\nreturn { dropped: dropped ? 'yes' : 'no', now, before, card, subject: `${run.evaluation_name || 'Evaluation'}: pass rate down from ${before}% to ${now}%` };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Comparison",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Compare the two runs",
        "nextElementIds": [
          "3CBCF138-B4B6-4F49-87FE-C5954379E9EA"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Adds new data rows to Google Sheets for AI agents to store processed results, log user interactions, or collect data from automated workflows. Perfect for building databases, tracking metrics, saving form submissions, or creating data collection pipelines.",
          "elementId": "EXTENSION:::SHARED:::default:::google-sheets:::addRow",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Log the run in Google Sheets Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-sheets:::addRow",
          "legacyElementId": "JS###v1###GoogleSheets###addRow",
          "methodName": "addRow",
          "position": {
            "x": 1251,
            "y": 40
          }
        },
        "flowElementId": "DAA14C2A-6085-4B18-B7EC-2C7601B25CD3",
        "groupId": null,
        "id": "988DC4D6-1568-4316-AA49-480BC1EFE59F",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Evaluation log spreadsheet",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Evaluation log spreadsheet"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sheetId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 0
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "row",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Log row",
                    "subPathSegments": [
                      {
                        "key": "row",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4D1461C3-984B-4FDF-AD8E-043CCD6CE38E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "addRow",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Logged row",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-sheets",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Log the run in Google Sheets",
        "nextElementIds": [
          "C33E1DC6-112C-4B42-A9C7-B04C06CC0D48"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 503,
            "y": 219
          }
        },
        "flowElementId": "7882E0B6-2BF0-4649-BA9B-530643813637",
        "groupId": null,
        "id": "9012C103-00A3-4D4D-BC96-ABF97E7798F5",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "656e442c-ed7f-4f7f-8a7c-8e08cbb884c8",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Previous",
                      "subPathSegments": [
                        {
                          "key": "previousId",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "2AF14D61-201B-4963-9C6F-772257768062"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "656e442c-ed7f-4f7f-8a7c-8e08cbb884c8"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Has previous",
          "storeResult": false,
          "thenComponent": {
            "componentId": "97478BDC-EFFC-4FDA-A3E1-74965D5E9E8A",
            "componentType": "ELEMENT"
          }
        },
        "name": "Earlier run to compare?",
        "nextElementIds": [
          "97478BDC-EFFC-4FDA-A3E1-74965D5E9E8A"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Gets an evaluation run's summary: status, result counts, and the mean of each score and metric. Boolean scores read as pass rates.",
          "elementId": "EXTENSION:::SHARED:::default:::traceroot:::getEvaluationRun",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the run's results Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::traceroot:::getEvaluationRun",
          "legacyElementId": null,
          "methodName": "getEvaluationRun",
          "position": {
            "x": 508,
            "y": 40
          }
        },
        "flowElementId": "73213527-B4E4-43F0-BCB1-A77AE1129B0A",
        "groupId": null,
        "id": "C76FF049-1971-4A0D-8365-0169A005CE1F",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "runId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Finished run",
                    "subPathSegments": [
                      {
                        "key": "evaluation_run_id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "45C094AF-1569-43AB-BB6A-91B3AF1036F0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getEvaluationRun",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Run",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "traceroot",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the run's results",
        "nextElementIds": [
          "4D1461C3-984B-4FDF-AD8E-043CCD6CE38E"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Lists evaluation runs, newest first: identity and status only. Get Evaluation Run returns a run's counts and scores. Pass next_cursor back as Cursor for the next page.",
          "elementId": "EXTENSION:::SHARED:::default:::traceroot:::listEvaluationRuns",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "List the evaluation's runs Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::traceroot:::listEvaluationRuns",
          "legacyElementId": null,
          "methodName": "listEvaluationRuns",
          "position": {
            "x": 1264,
            "y": 210
          }
        },
        "flowElementId": "528B1549-CE0D-46BF-AA3D-A88A6574D673",
        "groupId": null,
        "id": "C33E1DC6-112C-4B42-A9C7-B04C06CC0D48",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "limit",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 50
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "cursor",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "evaluationId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Finished run",
                    "subPathSegments": [
                      {
                        "key": "evaluation_id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "45C094AF-1569-43AB-BB6A-91B3AF1036F0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "listEvaluationRuns",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Runs",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "traceroot",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "List the evaluation's runs",
        "nextElementIds": [
          "2AF14D61-201B-4963-9C6F-772257768062"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "45C094AF-1569-43AB-BB6A-91B3AF1036F0",
    "groups": [],
    "id": "40340A41-8160-4C7E-8299-672B8B67579C",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": "Please fix problems before start. Blocks with issues have red badge in the top-right corner of a block, hover it to see what needs to be done.",
        "valid": false
      },
      "errorMessage": "Please fix problems before start. Blocks with issues have red badge in the top-right corner of a block, hover it to see what needs to be done.",
      "executionStaticData": [
        {
          "description": "The URL of the Google Sheet that logs every run. Its first sheet needs the column headers Finished, Evaluation, Run, Candidate version, Status, Cases, Passed, Failed, Errored, Pass rate, Scores, Run link.",
          "error": null,
          "name": "Evaluation log spreadsheet",
          "type": "STRING",
          "value": ""
        }
      ],
      "initialData": null,
      "initialDataDefaultValues": {},
      "ownerFlowVersionId": null,
      "schedule": null,
      "sharedMemory": {
        "anchor": {
          "missingAnchorPolicy": null,
          "path": null,
          "type": "FLOW_MEMORY"
        },
        "expirationInSec": null
      },
      "wasLive": false
    }
  },
  "slaCalendars": [],
  "slaGoals": [],
  "subFlows": [],
  "exportDate": "2026-12-02T01:43:40.750Z"
}
