{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "083B3CF0-E629-4878-B5E4-62046D0F3A4D",
    "name": "Google Drive: carrier COI expiry check"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -70,
        "y": -300,
        "zoom": 1
      },
      "autoSave": false,
      "descriptions": {
        "flow": "On a daily schedule, goes through each carrier folder in Google Drive, reads the newest certificate of insurance, and flags any that is missing, expired or expiring within a set number of days: an email to the carrier and a Slack message to carrier setup. A Google Sheets log keeps each COI from being flagged twice.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "On a daily schedule, goes through each carrier folder in Google Drive, reads the newest certificate of insurance, and flags any that is missing, expired or expiring within a set number of days: an email to the carrier and a Slack message to carrier setup. A Google Sheets log keeps each COI from being flagged twice.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Check the expiry date Result"
          },
          "position": {
            "x": 1031,
            "y": 49
          }
        },
        "flowElementId": "CB26B115-D9F7-4C98-9AF3-817FE4A3B23F",
        "groupId": "CD45E614-7CD5-48AA-8BF3-D88EA00B8EB3",
        "id": "E349E970-6A9F-4C21-822A-8D8AE5318832",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'Check the expiry date', Error: The placeholder \"Company name\" has no value",
            "valid": false
          },
          "codeArguments": [
            {
              "name": "item",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": null,
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CD45E614-7CD5-48AA-8BF3-D88EA00B8EB3"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "reading",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "COI reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "BD0591DF-D5C4-419A-B954-446C150D689B"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "daysBefore",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Days before expiry",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Days before expiry"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "company",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Company name",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Company name"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const it = item || {};\nconst today = new Date().toISOString().slice(0, 10);\nconst r = reading && typeof reading === 'object' ? reading : {};\nconst isDate = s => /^\\d{4}-\\d{2}-\\d{2}$/.test(String(s || ''));\nlet expires = '';\nlet coverage = '';\nlet daysLeft = null;\nlet status;\nif (!it.fileId) {\n  status = 'missing';\n} else {\n  if (it.needsRead) {\n    if (r.isCoi !== false && isDate(r.earliestExpiry)) {\n      expires = r.earliestExpiry;\n      coverage = String(r.earliestCoverage || '');\n    }\n  } else if (isDate(it.cachedExpires)) {\n    expires = it.cachedExpires;\n    coverage = String(it.cachedCoverage || '');\n  }\n  if (!expires) {\n    status = 'unreadable';\n  } else {\n    daysLeft = Math.round((Date.parse(expires + 'T00:00:00Z') - Date.parse(today + 'T00:00:00Z')) / 86400000);\n    status = daysLeft < 0 ? 'expired' : daysLeft <= Number(daysBefore || 0) ? 'expiring' : 'ok';\n  }\n}\n// Log when the file is new or changed, or its status moved; flag each status once.\nconst changed = !!it.needsRead || status !== it.prevStatus;\nconst flag = status !== 'ok' && status !== it.prevStatus;\nconst emailCarrier = flag && status !== 'unreadable' && !!it.carrierEmail;\nconst nice = d => new Date(d + 'T00:00:00Z').toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric', timeZone: 'UTC' });\nconst cov = coverage ? ` (${coverage})` : '';\nconst headline = {\n  missing: 'no certificate of insurance on file',\n  unreadable: 'no expiry date could be read on the certificate of insurance',\n  expired: `certificate of insurance expired ${expires ? nice(expires) : ''}${cov}`,\n  expiring: `certificate of insurance expires ${expires ? nice(expires) : ''}${cov}`,\n  ok: 'certificate of insurance is current',\n}[status];\nconst opening = status === 'missing'\n  ? `We don't have a certificate of insurance on file for ${it.carrier}.`\n  : status === 'expired'\n    ? `The certificate of insurance we have on file for ${it.carrier} expired on ${nice(expires)}${cov}.`\n    : `The certificate of insurance we have on file for ${it.carrier} expires on ${expires ? nice(expires) : ''}${cov}.`;\nconst emailBody = [\n  'Hello,',\n  '',\n  opening,\n  '',\n  `Please ask your insurance agent to email us a current certificate that names ${company} as the certificate holder. If it is already on its way, reply to this email and let us know.`,\n  '',\n  'Thank you,',\n  `${company} carrier setup`,\n].join('\\n');\nconst left = status === 'expiring' ? (daysLeft === 0 ? 'Expires today.' : `${daysLeft} day${daysLeft === 1 ? '' : 's'} left.`) : null;\nconst slackLines = [\n  `*${it.carrier}: ${headline}*`,\n  left,\n  emailCarrier\n    ? `Emailed the carrier at ${it.carrierEmail}.`\n    : status === 'unreadable'\n      ? 'Please open the file and check it.'\n      : 'No email for this carrier in the contacts sheet, so the carrier was not emailed.',\n  it.link ? `<${it.link}|Open ${it.fileName}>` : null,\n].filter(Boolean);\nreturn {\n  status,\n  changed,\n  flag,\n  emailCarrier,\n  carrierEmail: it.carrierEmail || '',\n  emailSubject: `${it.carrier}: ${headline}`,\n  emailBody,\n  slackText: slackLines.join('\\n'),\n  // A leading apostrophe keeps Google Sheets from turning the timestamp and date into its own date format.\n  row: {\n    'File ID': it.key,\n    'Modified': it.modified ? `'${it.modified}` : '',\n    'Carrier': it.carrier,\n    'File': it.fileName || '',\n    'Coverage': coverage,\n    'Expires': expires ? `'${expires}` : '',\n    'Status': status,\n    'Checked on': today,\n  },\n};\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "COI check",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Check the expiry date",
        "nextElementIds": [
          "E79F6078-0C84-4815-812C-74A86274A46C"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 419,
            "y": 219
          }
        },
        "flowElementId": "4D429048-145D-4E60-B4F7-DC642426A1D3",
        "groupId": "CD45E614-7CD5-48AA-8BF3-D88EA00B8EB3",
        "id": "4A744CE5-8EF2-451C-B844-2DEB22F6631C",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "0fc3b969-67db-49f1-91e1-1e589340e0b5",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "COI check",
                      "subPathSegments": [
                        {
                          "key": "flag",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "E349E970-6A9F-4C21-822A-8D8AE5318832"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "0fc3b969-67db-49f1-91e1-1e589340e0b5"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "COI needs attention",
          "storeResult": false,
          "thenComponent": {
            "componentId": "FB2C0F1F-30FB-4551-AB96-725A26CF1A32",
            "componentType": "ELEMENT"
          }
        },
        "name": "COI needs attention?",
        "nextElementIds": [
          "FB2C0F1F-30FB-4551-AB96-725A26CF1A32"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "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": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the COI log Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-sheets:::getRows",
          "legacyElementId": "JS###v1###GoogleSheets###getRows",
          "methodName": "getRows",
          "position": {
            "x": 722,
            "y": 340
          }
        },
        "flowElementId": "C5799389-B8E1-437D-A0F5-0EF536981ADD",
        "groupId": null,
        "id": "E8A29A77-107A-45E7-A00D-B7C7A552A14D",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "COI log sheet",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "COI log sheet"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sheetId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 0
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "offset",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "limit",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "withRowNumbers",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Read the COI log', Error: The placeholder \"COI log sheet\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getRows",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "COI log",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-sheets",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the COI log",
        "nextElementIds": [
          "7ED4742E-7BBC-4B7E-95AE-195C6B9E0344"
        ],
        "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 the carrier Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "legacyElementId": "JS###v1###GmailService###sendMessage",
          "methodName": "sendMessage",
          "position": {
            "x": 115,
            "y": 380
          }
        },
        "flowElementId": "2E2DC96F-3438-4C9E-8E87-1627D8837B6C",
        "groupId": "CD45E614-7CD5-48AA-8BF3-D88EA00B8EB3",
        "id": "866D0EB5-89D2-4173-B16E-EFCC02A50D62",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "to",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "COI check",
                    "subPathSegments": [
                      {
                        "key": "carrierEmail",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E349E970-6A9F-4C21-822A-8D8AE5318832"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "COI check",
                    "subPathSegments": [
                      {
                        "key": "emailSubject",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E349E970-6A9F-4C21-822A-8D8AE5318832"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "plain"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyContent",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "COI check",
                    "subPathSegments": [
                      {
                        "key": "emailBody",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E349E970-6A9F-4C21-822A-8D8AE5318832"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "from",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "cc",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bcc",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachments",
              "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": "sendMessage",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Email to carrier",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Email the carrier",
        "nextElementIds": [
          "4F0937F0-B5CE-4D16-AA68-B8F214287531"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves a list of files from Google Drive based on the specified criteria.",
          "elementId": "EXTENSION:::SHARED:::default:::google-drive-api:::findMultipleFiles",
          "isFirstElement": true,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "List the carrier folders Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-drive-api:::findMultipleFiles",
          "legacyElementId": "JS###v1###GoogleDrive###findMultipleFiles",
          "methodName": "findMultipleFiles",
          "position": {
            "x": 110,
            "y": 340
          }
        },
        "flowElementId": "87E8C274-3A50-4102-94E9-1C72B11E5B1C",
        "groupId": null,
        "id": "EB089A1D-97CF-427A-B7EB-07E2240C0290",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "sharedDriveId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "search",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "folderId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Carriers folder",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Carriers folder"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileType",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'List the carrier folders', Error: The placeholder \"Carriers folder\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "findMultipleFiles",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Carrier folders",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-drive-api",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "List the carrier folders",
        "nextElementIds": [
          "43007606-933F-49D0-ABE8-36AD1582A978"
        ],
        "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 COI Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-sheets:::addRow",
          "legacyElementId": "JS###v1###GoogleSheets###addRow",
          "methodName": "addRow",
          "position": {
            "x": 724,
            "y": 210
          }
        },
        "flowElementId": "D0FB8FA0-FDF8-450E-BBAC-1EBE8302D883",
        "groupId": "CD45E614-7CD5-48AA-8BF3-D88EA00B8EB3",
        "id": "10767237-AE4C-46A5-B6E1-43FA1A367EDB",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "COI log sheet",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "COI log sheet"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sheetId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 0
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "row",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "COI check",
                    "subPathSegments": [
                      {
                        "key": "row",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E349E970-6A9F-4C21-822A-8D8AE5318832"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Log the COI', Error: The placeholder \"COI log sheet\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "addRow",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "COI log row",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-sheets",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Log the COI",
        "nextElementIds": [
          "4A744CE5-8EF2-451C-B844-2DEB22F6631C"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves a complete list of files from a Google Drive folder for AI agents to process directory contents, analyze file structures, or manage collections of documents. Perfect for automated workflows that need to iterate through files, generate reports on folder contents, or process multiple files in batch operations.",
          "elementId": "EXTENSION:::SHARED:::default:::google-drive-api:::getFolderListing",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "List the carrier COIs Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-drive-api:::getFolderListing",
          "legacyElementId": "JS###v1###GoogleDrive###getFolderListing",
          "methodName": "getFolderListing",
          "position": {
            "x": 422,
            "y": 340
          }
        },
        "flowElementId": "5CADD208-C64C-4DCE-AFCD-91834E714AFB",
        "groupId": null,
        "id": "43007606-933F-49D0-ABE8-36AD1582A978",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "sharedDriveId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "folderId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Carriers folder",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Carriers folder"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileFilter",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "COI file name",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "COI file name"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "recurringRetrieval",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_TRUE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": true
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "verboseResponse",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_TRUE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": true
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'List the carrier COIs', Error: The placeholder \"Carriers folder\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getFolderListing",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Carrier COIs",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-drive-api",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "List the carrier COIs",
        "nextElementIds": [
          "E8A29A77-107A-45E7-A00D-B7C7A552A14D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Pick each carrier's latest COI Result"
          },
          "position": {
            "x": 1022,
            "y": 519
          }
        },
        "flowElementId": "42F0E430-A1CD-4A3E-A223-56E5C6B3559F",
        "groupId": null,
        "id": "B4E25B7E-CC43-46F3-9E84-EC2A82091030",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "folders",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Carrier folders",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "EB089A1D-97CF-427A-B7EB-07E2240C0290"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "cois",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Carrier COIs",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "43007606-933F-49D0-ABE8-36AD1582A978"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "logRows",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "COI log",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "E8A29A77-107A-45E7-A00D-B7C7A552A14D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "contacts",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Carrier contacts",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "7ED4742E-7BBC-4B7E-95AE-195C6B9E0344"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const FOLDER = 'application/vnd.google-apps.folder';\nconst list = v => (Array.isArray(v) ? v : []);\nconst norm = s => String(s || '').trim().toLowerCase();\nconst carriers = list(folders).filter(f => f.mimeType === FOLDER);\nconst pdfs = list(cois).filter(f => f.mimeType === 'application/pdf');\n// Last log row per COI (rows are in the order they were added).\nconst lastLog = {};\nfor (const row of list(logRows)) if (row['File ID']) lastLog[row['File ID']] = row;\nconst emails = {};\nfor (const row of list(contacts)) if (row['Carrier']) emails[norm(row['Carrier'])] = String(row['Email'] || '').trim();\nconst items = carriers.map(folder => {\n  const prefix = String(folder.filePath || '') + '/';\n  const latest = pdfs\n    .filter(f => String(f.fullPath || '').startsWith(prefix))\n    .sort((a, b) => String(b.createdTime || '').localeCompare(String(a.createdTime || '')))[0];\n  const key = latest ? latest.id : `none:${folder.id}`;\n  const log = lastLog[key];\n  const modified = latest ? String(latest.modifiedTime || '') : '';\n  const known = !!log && String(log['Modified'] || '') === modified;\n  return {\n    key,\n    carrier: folder.name,\n    carrierEmail: emails[norm(folder.name)] || '',\n    fileId: latest ? latest.id : '',\n    fileName: latest ? latest.name : '',\n    link: latest ? latest.webViewLink || '' : '',\n    modified,\n    needsRead: !!latest && !known,\n    cachedExpires: known ? String(log['Expires'] || '') : '',\n    cachedCoverage: known ? String(log['Coverage'] || '') : '',\n    prevStatus: log ? String(log['Status'] || '') : '',\n  };\n});\nreturn { items };\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Latest COIs",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Pick each carrier's latest COI",
        "nextElementIds": [],
        "nextGroupIds": [
          "CD45E614-7CD5-48AA-8BF3-D88EA00B8EB3"
        ],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the COI Result"
          },
          "tools": {},
          "position": {
            "x": 724,
            "y": 49
          }
        },
        "flowElementId": "38ACB3B1-1BB5-4B61-9B5D-78740DB74883",
        "groupId": "CD45E614-7CD5-48AA-8BF3-D88EA00B8EB3",
        "id": "BD0591DF-D5C4-419A-B954-446C150D689B",
        "metaInfo": {
          "aiApiKey": null,
          "aiModel": "claude-sonnet-5",
          "aiProvider": "ANTHROPIC",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "dynamicAiApiKey": {
            "expression": [
              {
                "id": "PLACEHOLDER_DATA",
                "label": "Anthropic key",
                "subPathSegments": null,
                "type": "EXECUTION_CONTEXT_STATIC_DATA",
                "value": "Anthropic key"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "files": [
            {
              "mimeType": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "application/pdf"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "STRING"
              },
              "url": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "COI file",
                    "subPathSegments": [
                      {
                        "key": "url",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "187DFBC2-F874-4981-8099-2DEE5932E244"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "STRING"
              }
            }
          ],
          "forceParsedOutput": true,
          "langSmithSettings": {
            "enabled": false,
            "apiKey": null,
            "projectName": null,
            "label": "FlowRunner AI-Agent",
            "accountCluster": "US"
          },
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "messagesHistoryEnabled": false,
          "messagesHistoryLimit": 15,
          "onFailElemId": null,
          "resultAlias": "COI reading",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You read certificates of insurance (COIs, usually an ACORD 25 form) that motor carriers give a freight broker. Reply with JSON only, with these fields:\nisCoi: true if the file is a certificate of insurance, false if it is anything else\ninsured: the insured carrier's name, or empty text\npolicies: a list with one entry per policy on the certificate, each with coverage (a short name such as Auto liability, Motor truck cargo, General liability or Workers compensation), policyNumber, and expires (the policy expiration date as YYYY-MM-DD)\nearliestExpiry: the earliest policy expiration date on the certificate as YYYY-MM-DD, or empty text if no expiration date can be read\nearliestCoverage: the coverage that earliest date belongs to, or empty text"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Carrier folder: "
              },
              {
                "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                "label": null,
                "subPathSegments": [
                  {
                    "key": "carrier",
                    "optional": false
                  }
                ],
                "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                "value": "CD45E614-7CD5-48AA-8BF3-D88EA00B8EB3"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nFile: "
              },
              {
                "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                "label": null,
                "subPathSegments": [
                  {
                    "key": "fileName",
                    "optional": false
                  }
                ],
                "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                "value": "CD45E614-7CD5-48AA-8BF3-D88EA00B8EB3"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Read the COI",
        "nextElementIds": [
          "E349E970-6A9F-4C21-822A-8D8AE5318832"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": true,
          "blockDefinitionId": "condition",
          "position": {
            "x": 110,
            "y": 49
          }
        },
        "flowElementId": "EA442971-B901-4368-A88B-EBE1C5E65314",
        "groupId": "CD45E614-7CD5-48AA-8BF3-D88EA00B8EB3",
        "id": "81546808-541D-4276-BA1E-146F7D3805C2",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "9e563183-0b4b-412e-a44a-a64534681b72",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                      "label": null,
                      "subPathSegments": [
                        {
                          "key": "needsRead",
                          "optional": false
                        }
                      ],
                      "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                      "value": "CD45E614-7CD5-48AA-8BF3-D88EA00B8EB3"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "9e563183-0b4b-412e-a44a-a64534681b72"
            ]
          },
          "elseComponent": {
            "componentId": "E349E970-6A9F-4C21-822A-8D8AE5318832",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "New or changed COI",
          "storeResult": false,
          "thenComponent": {
            "componentId": "187DFBC2-F874-4981-8099-2DEE5932E244",
            "componentType": "ELEMENT"
          }
        },
        "name": "New or changed COI?",
        "nextElementIds": [
          "E349E970-6A9F-4C21-822A-8D8AE5318832",
          "187DFBC2-F874-4981-8099-2DEE5932E244"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1024,
            "y": 219
          }
        },
        "flowElementId": "AE347661-2853-419D-85D1-674E96265340",
        "groupId": "CD45E614-7CD5-48AA-8BF3-D88EA00B8EB3",
        "id": "E79F6078-0C84-4815-812C-74A86274A46C",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "7cc654e1-9dbe-4c2f-8d6b-aa800191a5cd",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "COI check",
                      "subPathSegments": [
                        {
                          "key": "changed",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "E349E970-6A9F-4C21-822A-8D8AE5318832"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "7cc654e1-9dbe-4c2f-8d6b-aa800191a5cd"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Anything new",
          "storeResult": false,
          "thenComponent": {
            "componentId": "10767237-AE4C-46A5-B6E1-43FA1A367EDB",
            "componentType": "ELEMENT"
          }
        },
        "name": "New COI or new status?",
        "nextElementIds": [
          "10767237-AE4C-46A5-B6E1-43FA1A367EDB"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "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": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the carrier contacts Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-sheets:::getRows",
          "legacyElementId": "JS###v1###GoogleSheets###getRows",
          "methodName": "getRows",
          "position": {
            "x": 1035,
            "y": 340
          }
        },
        "flowElementId": "22BDEA92-E2C8-4780-BE37-4903A4465C5D",
        "groupId": null,
        "id": "7ED4742E-7BBC-4B7E-95AE-195C6B9E0344",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Carrier contacts sheet",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Carrier contacts sheet"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sheetId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 0
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "offset",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "limit",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "withRowNumbers",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Read the carrier contacts', Error: The placeholder \"Carrier contacts sheet\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getRows",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Carrier contacts",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-sheets",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the carrier contacts",
        "nextElementIds": [
          "B4E25B7E-CC43-46F3-9E84-EC2A82091030"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Downloads a file from Google Drive and saves it to the Files.",
          "elementId": "EXTENSION:::SHARED:::default:::google-drive-api:::downloadFile",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Download the COI Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-drive-api:::downloadFile",
          "legacyElementId": "JS###v1###GoogleDrive###downloadFile",
          "methodName": "downloadFile",
          "position": {
            "x": 422,
            "y": 40
          }
        },
        "flowElementId": "BD7E34A3-81ED-4FEA-8880-CAD05DB8703D",
        "groupId": "CD45E614-7CD5-48AA-8BF3-D88EA00B8EB3",
        "id": "187DFBC2-F874-4981-8099-2DEE5932E244",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "fileId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "fileId",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CD45E614-7CD5-48AA-8BF3-D88EA00B8EB3"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "targetDirectory",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Download the COI', Error: OAuth Connection is required",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "downloadFile",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "COI file",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-drive-api",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Download the COI",
        "nextElementIds": [
          "BD0591DF-D5C4-419A-B954-446C150D689B"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "dynamicOptionLabels": {
            "channelId": {}
          },
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Tell carrier setup Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 422,
            "y": 380
          }
        },
        "flowElementId": "9BC56ADE-950F-46A8-8BBC-8073DB1C81E2",
        "groupId": "CD45E614-7CD5-48AA-8BF3-D88EA00B8EB3",
        "id": "4F0937F0-B5CE-4D16-AA68-B8F214287531",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "COI check",
                    "subPathSegments": [
                      {
                        "key": "slackText",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E349E970-6A9F-4C21-822A-8D8AE5318832"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "COMPLEX_LIST",
              "value": []
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Message to carrier setup",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell carrier setup",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 114,
            "y": 219
          }
        },
        "flowElementId": "7F1C8D3C-187D-4708-B7EE-56C4A6987A4F",
        "groupId": "CD45E614-7CD5-48AA-8BF3-D88EA00B8EB3",
        "id": "FB2C0F1F-30FB-4551-AB96-725A26CF1A32",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "33e17fe6-ef8b-4bfe-b467-5621d4290043",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "COI check",
                      "subPathSegments": [
                        {
                          "key": "emailCarrier",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "E349E970-6A9F-4C21-822A-8D8AE5318832"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "33e17fe6-ef8b-4bfe-b467-5621d4290043"
            ]
          },
          "elseComponent": {
            "componentId": "4F0937F0-B5CE-4D16-AA68-B8F214287531",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Carrier email on file",
          "storeResult": false,
          "thenComponent": {
            "componentId": "866D0EB5-89D2-4173-B16E-EFCC02A50D62",
            "componentType": "ELEMENT"
          }
        },
        "name": "Carrier email on file?",
        "nextElementIds": [
          "866D0EB5-89D2-4173-B16E-EFCC02A50D62",
          "4F0937F0-B5CE-4D16-AA68-B8F214287531"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      }
    ],
    "firstElementId": "EB089A1D-97CF-427A-B7EB-07E2240C0290",
    "groups": [
      {
        "clientMetadata": {
          "elementId": "list-iterator",
          "isFirstElement": false,
          "blockDefinitionId": "list-iterator",
          "viewport": {
            "x": -70,
            "y": 0,
            "zoom": 1
          },
          "position": {
            "x": 722,
            "y": 519
          }
        },
        "flowElementId": "7EB8634C-D7A4-40A1-885D-D464AFE5981D",
        "groupId": null,
        "id": "CD45E614-7CD5-48AA-8BF3-D88EA00B8EB3",
        "loopType": "LIST_ITERATOR",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'For each carrier', Error: Children have error",
            "valid": false
          },
          "enabled": true,
          "firstElementId": "81546808-541D-4276-BA1E-146F7D3805C2",
          "list": {
            "expression": [
              {
                "id": "ELEMENT_RESULT",
                "label": "Latest COIs",
                "subPathSegments": [
                  {
                    "key": "items",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "B4E25B7E-CC43-46F3-9E84-EC2A82091030"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "onFailElemId": null,
          "resultAlias": "L",
          "storeResult": true
        },
        "name": "For each carrier",
        "nextElementIds": [],
        "nextGroupIds": [],
        "type": "LOOP"
      }
    ],
    "id": "21A3EBE1-7AF5-4A70-AAF8-E0909F8192DA",
    "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": "Group 'For each carrier' has an invalid configuration. Block 'Check the expiry date' has an invalid configuration. Code Argument 'company' has invalid value. Placeholder Data 'Company name': value is required",
      "executionStaticData": [
        {
          "description": "Your Anthropic API key, used by the step that reads each certificate of insurance.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "The ID of the Google Drive folder that holds one folder per carrier (the part of the folder's link after /folders/).",
          "error": null,
          "name": "Carriers folder",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "Text every certificate of insurance file name contains, such as COI.",
          "error": null,
          "name": "COI file name",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "How many days before a certificate expires to flag it.",
          "error": null,
          "name": "Days before expiry",
          "type": "INT",
          "value": ""
        },
        {
          "description": "The link or ID of the Google Sheet that logs each certificate checked. Its first tab needs the headers File ID, Modified, Carrier, File, Coverage, Expires, Status, Checked on.",
          "error": null,
          "name": "COI log sheet",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The link or ID of the Google Sheet with your carriers' emails. Its first tab needs the headers Carrier (the carrier folder's name) and Email.",
          "error": null,
          "name": "Carrier contacts sheet",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "Your company name, as it should appear as certificate holder in the email to carriers.",
          "error": "Placeholder Data 'Company name': value is required",
          "name": "Company name",
          "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-11-26T05:49:16.646Z"
}
