{
  "elementsLearnedData": [],
  "elementsTestData": [
    {
      "data": [
        {
          "Key": "2026-10-06|-850.00|BNK-1004",
          "Date": "2026-10-06",
          "Description": "TRF SUBEMPREITADA",
          "Amount": "-850",
          "Bank Ref": "BNK-1004",
          "File": "Extrato_2026-10_v3.xlsx",
          "Reason": "2 possible matches (amount and date)",
          "Candidates": "M004 (2026-10-02, -850.00, FC CL-0412); M005 (2026-10-03, -850.00, FC PN-0077)",
          "Added At": "2026-10-16T16:55:08.866Z"
        },
        {
          "Key": "2026-10-09|-12.50|BNK-1006",
          "Date": "2026-10-09",
          "Description": "COMISSAO MANUTENCAO CONTA",
          "Amount": "-12.5",
          "Bank Ref": "BNK-1006",
          "File": "Extrato_2026-10_v3.xlsx",
          "Reason": "No match",
          "Candidates": "",
          "Added At": "2026-10-16T16:55:08.866Z"
        },
        {
          "Key": "2026-10-10|1000.00|BNK-1007",
          "Date": "2026-10-10",
          "Description": "TRF RECEBIDA FERREIRA FT 2026/103",
          "Amount": "1000",
          "Bank Ref": "BNK-1007",
          "File": "Extrato_2026-10_v3.xlsx",
          "Reason": "Invoice number matches but amount differs (partial or incorrect payment?)",
          "Candidates": "M008 (2026-10-06, 1800.00, FT 2026/103)",
          "Added At": "2026-10-16T16:55:08.866Z"
        }
      ],
      "elementId": "4237EC7C-84A9-46AE-9635-99D8D0FA2204"
    },
    {
      "data": {
        "count": 3,
        "html": "<p>3 bank transactions are waiting for review.</p><table border=\"1\" cellpadding=\"6\" cellspacing=\"0\" style=\"border-collapse:collapse;font-family:sans-serif;font-size:13px\"><tr style=\"background:#f2f2f2\"><th>Date</th><th>Description</th><th>Amount</th><th>Bank ref</th><th>Reason</th><th>Candidates</th></tr><tr><td>2026-10-06</td><td>TRF SUBEMPREITADA</td><td style=\"text-align:right\">-850</td><td>BNK-1004</td><td>2 possible matches (amount and date)</td><td>M004 (2026-10-02, -850.00, FC CL-0412); M005 (2026-10-03, -850.00, FC PN-0077)</td></tr><tr><td>2026-10-09</td><td>COMISSAO MANUTENCAO CONTA</td><td style=\"text-align:right\">-12.5</td><td>BNK-1006</td><td>No match</td><td>-</td></tr><tr><td>2026-10-10</td><td>TRF RECEBIDA FERREIRA FT 2026/103</td><td style=\"text-align:right\">1000</td><td>BNK-1007</td><td>Invoice number matches but amount differs (partial or incorrect payment?)</td><td>M008 (2026-10-06, 1800.00, FT 2026/103)</td></tr></table><p><a href=\"https://docs.google.com/spreadsheets/d/YOUR_SPREADSHEET_ID/edit#gid=1996125149\">Open the To review tab</a>. Put any value in the Resolved column once a row is handled and it will drop off this email.</p>",
        "subject": "3 bank transactions waiting for review"
      },
      "elementId": "FB5A9E07-C1E2-4DEA-BA6F-946BE5F6F861"
    }
  ],
  "flow": {
    "id": "20DEDFAD-4DB4-4464-BD7C-66161E6734A0",
    "name": "Bank Reconciliation Daily Review Email"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -309,
        "y": 313,
        "zoom": 1
      },
      "autoSave": true,
      "descriptions": {
        "flow": "",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 580,
            "y": 0
          }
        },
        "flowElementId": "C6421587-D4B5-492A-BAE6-CB4CE37CF066",
        "groupId": null,
        "id": "24B2AE6A-BFA1-40A7-BB1A-C233249657E3",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "7d09fc4b-613e-4176-b00f-bb19ade8fac0",
                "nestedOperation": null,
                "operation": ">",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "digest",
                      "subPathSegments": [
                        {
                          "key": "count",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "FB5A9E07-C1E2-4DEA-BA6F-946BE5F6F861"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "INT",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "NUMBER",
                        "label": null,
                        "type": "INPUT",
                        "value": 0
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "7d09fc4b-613e-4176-b00f-bb19ade8fac0"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "anyOpen",
          "storeResult": false,
          "thenComponent": {
            "componentId": "4F83D55B-FDF7-4587-B294-CA2A06C61EF9",
            "componentType": "ELEMENT"
          }
        },
        "name": "Anything Waiting?",
        "nextElementIds": [
          "4F83D55B-FDF7-4587-B294-CA2A06C61EF9"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Build Summary Result"
          },
          "position": {
            "x": 290,
            "y": 0
          }
        },
        "flowElementId": "60EF628D-7B5C-438C-BD55-EC9E25BE480B",
        "groupId": null,
        "id": "FB5A9E07-C1E2-4DEA-BA6F-946BE5F6F861",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "rows",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "reviewRows",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "4237EC7C-84A9-46AE-9635-99D8D0FA2204"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const esc = s => String(s == null ? '' : s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n// Spreadsheet serial day numbers (days since 1899-12-30) become YYYY-MM-DD; any other value is left as it is\nconst serialToISO = n => new Date(Date.UTC(1899, 11, 30) + Math.floor(n) * 86400000).toISOString().slice(0, 10);\nconst isSerial = s => /^\\d{5}(\\.\\d+)?$/.test(s) && Number(s) >= 20000 && Number(s) <= 80000;\nconst fmtDate = v => { const s = String(v == null ? '' : v).trim(); return isSerial(s) ? serialToISO(Number(s)) : v; };\nconst fmtCandidates = v => String(v || '').replace(/\\((\\d{5}(?:\\.\\d+)?),/g, (m, d) => isSerial(d) ? `(${serialToISO(Number(d))},` : m);\nconst open = (rows || []).filter(r => !String(r['Resolved'] || '').trim());\nconst link = 'https://docs.google.com/spreadsheets/d/YOUR_SPREADSHEET_ID/edit#gid=1996125149';\nconst tr = open.map(r => `<tr><td>${esc(fmtDate(r['Date']))}</td><td>${esc(r['Description'])}</td><td style=\"text-align:right\">${esc(r['Amount'])}</td><td>${esc(r['Bank Ref'])}</td><td>${esc(r['Reason'])}</td><td>${esc(fmtCandidates(r['Candidates']) || '-')}</td></tr>`).join('');\nconst html = `<p>${open.length} bank transaction${open.length === 1 ? ' is' : 's are'} waiting for review.</p>` +\n  `<table border=\"1\" cellpadding=\"6\" cellspacing=\"0\" style=\"border-collapse:collapse;font-family:sans-serif;font-size:13px\">` +\n  `<tr style=\"background:#f2f2f2\"><th>Date</th><th>Description</th><th>Amount</th><th>Bank ref</th><th>Reason</th><th>Candidates</th></tr>${tr}</table>` +\n  `<p><a href=\"${link}\">Open the To review tab</a>. Put any value in the Resolved column once a row is handled and it will drop off this email.</p>`;\nreturn { count: open.length, html, subject: `${open.length} bank transaction${open.length === 1 ? '' : 's'} waiting for review` };\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "digest",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Build Summary",
        "nextElementIds": [
          "24B2AE6A-BFA1-40A7-BB1A-C233249657E3"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends emails through Gmail for AI agents to automate customer communication.",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Email Review Summary Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "legacyElementId": "JS###v1###GmailService###sendMessage",
          "methodName": "sendMessage",
          "position": {
            "x": 870,
            "y": 0
          }
        },
        "flowElementId": "89ED4C58-0842-4B0B-B872-F9DF535EF0F9",
        "groupId": null,
        "id": "4F83D55B-FDF7-4587-B294-CA2A06C61EF9",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "to",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "digest",
                    "subPathSegments": [
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "FB5A9E07-C1E2-4DEA-BA6F-946BE5F6F861"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "html"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyContent",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "digest",
                    "subPathSegments": [
                      {
                        "key": "html",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "FB5A9E07-C1E2-4DEA-BA6F-946BE5F6F861"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "from",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "STRING"
              }
            },
            {
              "name": "cc",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "ARRAY"
              }
            },
            {
              "name": "bcc",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "ARRAY"
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "STRING"
              }
            },
            {
              "name": "attachments",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "STRING"
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessage",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "sendDigest",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Email Review Summary",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves data from Google Sheets for AI agents to analyze spreadsheet content, process existing data, or extract information for automated workflows. Perfect for reading user submissions, analyzing data trends, or importing data for further processing.",
          "elementId": "EXTENSION:::SHARED:::default:::google-sheets:::getRows",
          "isFirstElement": true,
          "dynamicOptionLabels": {},
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Get To Review Rows Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-sheets:::getRows",
          "legacyElementId": "JS###v1###GoogleSheets###getRows",
          "methodName": "getRows",
          "position": {
            "x": 0,
            "y": 0
          }
        },
        "flowElementId": "D964ADCA-1DEF-4BB8-A249-4EA1A5952F5D",
        "groupId": null,
        "id": "4237EC7C-84A9-46AE-9635-99D8D0FA2204",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": null
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sheetId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 1996125149
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "offset",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "INT"
              }
            },
            {
              "name": "limit",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "INT"
              }
            },
            {
              "name": "withRowNumbers",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": "BOOLEAN"
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getRows",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "reviewRows",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-sheets",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Get To Review Rows",
        "nextElementIds": [
          "FB5A9E07-C1E2-4DEA-BA6F-946BE5F6F861"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "4237EC7C-84A9-46AE-9635-99D8D0FA2204",
    "groups": [],
    "id": "16DEDB33-3917-4CF3-BE6B-75304080D0CB",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": null,
        "valid": true
      },
      "errorMessage": null,
      "executionStaticData": [],
      "initialData": null,
      "initialDataDefaultValues": {},
      "ownerFlowVersionId": null,
      "schedule": {
        "allowApiInitiationsWhenScheduleExpired": false,
        "enabled": true,
        "endDate": null,
        "frequency": {
          "repeat": {
            "every": 1
          },
          "schedule": "daily"
        },
        "onlyScheduledInitiations": false,
        "startDate": 1792249200000
      },
      "sharedMemory": {
        "anchor": {
          "missingAnchorPolicy": null,
          "path": null,
          "type": "FLOW_MEMORY"
        },
        "expirationInSec": null
      },
      "wasLive": true
    }
  },
  "slaCalendars": [],
  "slaGoals": [],
  "subFlows": [],
  "exportDate": "2026-10-17T00:35:37.292Z"
}