{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "CD77E56E-1B73-4E99-AC88-8FAA39EC9829",
    "name": "Onfleet: driver packet checked, driver added"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -55.032397408207345,
        "y": 5.442764578833696,
        "zoom": 0.86
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When a contract driver emails an onboarding packet, AI reads each document: the W-9, the driver's license and the certificate of insurance. A packet with something missing or expired gets a reply listing what is still needed. A complete packet goes to the ops lead in Slack, and on approval the driver is added to the Onfleet team and gets the driver app invite.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When a contract driver emails an onboarding packet, AI reads each document: the W-9, the driver's license and the certificate of insurance. A packet with something missing or expired gets a reply listing what is still needed. A complete packet goes to the ops lead in Slack, and on approval the driver is added to the Onfleet team and gets the driver app invite.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the document Result"
          },
          "tools": {},
          "position": {
            "x": 410,
            "y": 49
          }
        },
        "flowElementId": "E1E1BBD2-E2BF-4347-A695-2F47FBB50187",
        "groupId": "A2E9192A-897A-4FBE-A3A0-65AC7EA716E6",
        "id": "952967FE-1E05-4DFF-99A5-6DEDE17BC3CB",
        "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": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "mimetype",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "A2E9192A-897A-4FBE-A3A0-65AC7EA716E6"
                  },
                  {
                    "id": "EMPTY_STRING",
                    "label": null,
                    "type": "KEYWORD",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "STRING"
              },
              "url": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Saved document",
                    "subPathSegments": [
                      {
                        "key": "fileUrl",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "5122B41C-09A2-4E3F-85CB-EC1733419CB4"
                  }
                ],
                "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": "Document reading",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You check the documents a contract delivery driver sends with an onboarding packet. From the attached file, reply with JSON only, with these fields:\ndocType: \"w9\" for an IRS Form W-9, \"license\" for a driver's license, \"insurance\" for a certificate of auto insurance or an insurance declarations page, \"other\" for anything else\nname: the person or business name on the document\ntinPresent: for a W-9, true if a Social Security number or EIN is filled in; otherwise false\nsigned: for a W-9, true if it is signed; otherwise false\nexpires: the expiration date as YYYY-MM-DD for a license or insurance, or empty text\ndetails: one short line. For a license, the state and class. For insurance, the insurer, the policy number and the liability limit. For a W-9, the tax classification. For anything else, what the document is.\nvehicle: the vehicle year, make, model and plate if the document shows them, or empty text\nNever write out a Social Security number, an EIN or a driver's license number in any field."
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "File name: "
              },
              {
                "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                "label": null,
                "subPathSegments": [
                  {
                    "key": "filename",
                    "optional": false
                  }
                ],
                "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                "value": "A2E9192A-897A-4FBE-A3A0-65AC7EA716E6"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nSent by "
              },
              {
                "id": "RESULT",
                "label": "New driver packet",
                "subPathSegments": [
                  {
                    "key": "fromName",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "6DB74AA1-2F86-4D0E-8245-58DF0F784210"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": " <"
              },
              {
                "id": "RESULT",
                "label": "New driver packet",
                "subPathSegments": [
                  {
                    "key": "fromAddress",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "6DB74AA1-2F86-4D0E-8245-58DF0F784210"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ">\nSubject: "
              },
              {
                "id": "RESULT",
                "label": "New driver packet",
                "subPathSegments": [
                  {
                    "key": "subject",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "6DB74AA1-2F86-4D0E-8245-58DF0F784210"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Read the document",
        "nextElementIds": [
          "463ECA3A-4BFC-418C-A453-90B851D1E16C"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Triggers when an email with a new attachment is received. Polling interval can be customized (minimum 30 seconds).",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::onNewAttachment",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::gmail-service:::onNewAttachment",
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::onNewAttachment",
          "legacyElementId": "JS###v1###GmailService###onNewAttachment",
          "methodName": "onNewAttachment",
          "position": {
            "x": 131,
            "y": 40
          }
        },
        "flowElementId": "66E0C28D-9E31-46FE-93D2-B81E5999B6B4",
        "groupId": null,
        "id": "6DB74AA1-2F86-4D0E-8245-58DF0F784210",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "connectionId": null,
          "dynamicData": [],
          "eventName": "onNewAttachment",
          "frequency": {
            "repeat": {
              "every": 300
            },
            "schedule": "custom"
          },
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "New driver packet",
          "serviceId": "gmail-service",
          "slaConditions": [],
          "staticData": {
            "query": "subject:(\"driver packet\" OR \"driver onboarding\" OR \"driver application\")"
          },
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New driver packet email",
        "nextElementIds": [
          "7CF282D0-1E71-4F14-B934-0C6D66688684"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "Documents": "4d4014ef-d5f1-4a66-85ea-c1e86a1a69bb"
          },
          "position": {
            "x": 525,
            "y": 49
          }
        },
        "flowElementId": "5AF68643-F700-4467-B99F-56415199F322",
        "groupId": null,
        "id": "7CF282D0-1E71-4F14-B934-0C6D66688684",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "Documents",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EMPTY_LIST",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "arrays.create()"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "start",
          "storeResult": true
        },
        "name": "Start the packet",
        "nextElementIds": [],
        "nextGroupIds": [
          "A2E9192A-897A-4FBE-A3A0-65AC7EA716E6"
        ],
        "type": "DATA_BUCKET"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "Documents": "18f030a3-0bdc-42bc-b1c6-de72ff70f6ac"
          },
          "position": {
            "x": 1010,
            "y": 49
          }
        },
        "flowElementId": "8D94A8EC-CF50-4E46-9ABD-D422DED87930",
        "groupId": "A2E9192A-897A-4FBE-A3A0-65AC7EA716E6",
        "id": "9C5609A1-69B7-4A1F-B563-82FF5DD21C06",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "Documents",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Packet so far",
                    "subPathSegments": [
                      {
                        "key": "documents",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "463ECA3A-4BFC-418C-A453-90B851D1E16C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "keepDoc",
          "storeResult": true
        },
        "name": "Keep the document",
        "nextElementIds": [],
        "nextGroupIds": [],
        "type": "DATA_BUCKET"
      },
      {
        "clientMetadata": {
          "notes": "Saves a Gmail attachment to FlowRunner Files and returns the file URL.",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::saveAttachment",
          "isFirstElement": true,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Save the document Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::saveAttachment",
          "legacyElementId": "JS###v1###GmailService###saveAttachment",
          "methodName": "saveAttachment",
          "position": {
            "x": 110,
            "y": 40
          }
        },
        "flowElementId": "FA3BA170-CE91-44CA-A215-4ED7035A0F28",
        "groupId": "A2E9192A-897A-4FBE-A3A0-65AC7EA716E6",
        "id": "5122B41C-09A2-4E3F-85CB-EC1733419CB4",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "messageId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "New driver packet",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "6DB74AA1-2F86-4D0E-8245-58DF0F784210"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachmentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "A2E9192A-897A-4FBE-A3A0-65AC7EA716E6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "filename",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "A2E9192A-897A-4FBE-A3A0-65AC7EA716E6"
                  }
                ],
                "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": "saveAttachment",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Saved document",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Save the document",
        "nextElementIds": [
          "952967FE-1E05-4DFF-99A5-6DEDE17BC3CB"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Add it to the packet Result"
          },
          "position": {
            "x": 710,
            "y": 49
          }
        },
        "flowElementId": "452C6D6B-373E-4643-8AC1-4D7CD8E98826",
        "groupId": "A2E9192A-897A-4FBE-A3A0-65AC7EA716E6",
        "id": "463ECA3A-4BFC-418C-A453-90B851D1E16C",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "collected",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - Documents",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.Documents",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "Documents",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "reading",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Document reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "952967FE-1E05-4DFF-99A5-6DEDE17BC3CB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "filename",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "filename",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "A2E9192A-897A-4FBE-A3A0-65AC7EA716E6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileUrl",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Saved document",
                    "subPathSegments": [
                      {
                        "key": "fileUrl",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "5122B41C-09A2-4E3F-85CB-EC1733419CB4"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const docs = Array.isArray(collected) ? collected : [];\nconst r = reading && typeof reading === 'object' ? reading : { docType: 'other', details: String(reading || '') };\nreturn { documents: docs.concat([{ ...r, filename, fileUrl }]) };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Packet so far",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Add it to the packet",
        "nextElementIds": [
          "9C5609A1-69B7-4A1F-B563-82FF5DD21C06"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Check the packet Result"
          },
          "position": {
            "x": 1304,
            "y": 219
          }
        },
        "flowElementId": "A65DA31B-6B41-4AB3-8DDF-45986C9C021A",
        "groupId": null,
        "id": "08691EDB-6A2E-4A03-A659-5504399CB31F",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'Check the packet', Error: The placeholder \"Driver team\" has no value",
            "valid": false
          },
          "codeArguments": [
            {
              "name": "documents",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - Documents",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.Documents",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "Documents",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "details",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Driver details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4F3D989A-C2FD-4D67-9537-1F289500B475"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fromName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "New driver packet",
                    "subPathSegments": [
                      {
                        "key": "fromName",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "6DB74AA1-2F86-4D0E-8245-58DF0F784210"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "teamId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Driver team",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Driver team"
                  }
                ],
                "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 docs = Array.isArray(documents) ? documents : [];\nconst d = details && typeof details === 'object' ? details : {};\nconst today = new Date().toISOString().slice(0, 10);\nconst find = (type) => docs.find((x) => x && x.docType === type);\nconst w9 = find('w9'), license = find('license'), insurance = find('insurance');\nconst needed = [];\nif (!w9) needed.push('A signed W-9.');\nelse {\n  if (!w9.tinPresent) needed.push('Your W-9 is missing your Social Security number or EIN.');\n  if (!w9.signed) needed.push('Your W-9 is not signed.');\n}\nif (!license) needed.push(\"A clear copy of your driver's license.\");\nelse if (!license.expires) needed.push(\"A clearer copy of your driver's license. We could not read the expiration date.\");\nelse if (license.expires < today) needed.push(`A current driver's license. The one you sent expired on ${license.expires}.`);\nif (!insurance) needed.push('A certificate of insurance for the vehicle you will drive.');\nelse if (!insurance.expires) needed.push('A certificate of insurance that shows the policy expiration date.');\nelse if (insurance.expires < today) needed.push(`A current certificate of insurance. The one you sent expired on ${insurance.expires}.`);\nconst phone = String(d.phone || '').replace(/[^+\\d]/g, '');\nif (!/^\\+[1-9]\\d{7,14}$/.test(phone)) needed.push('The mobile number you will use for the driver app.');\nconst name = String(d.name || fromName || '').trim();\nconst first = name.split(' ')[0] || 'there';\nconst types = ['CAR', 'TRUCK', 'MOTORCYCLE', 'BICYCLE'];\nconst vehicleType = types.includes(String(d.vehicleType || '').toUpperCase()) ? String(d.vehicleType).toUpperCase() : 'CAR';\nconst docLines = docs.map((x) => `<${x.fileUrl}|${x.filename}>: ${x.docType === 'w9' ? 'W-9' : x.docType === 'license' ? \"Driver's license\" : x.docType === 'insurance' ? 'Insurance' : 'Other'}, ${x.name || 'no name'}${x.expires ? `, expires ${x.expires}` : ''}. ${x.details || ''}`);\nreturn {\n  complete: needed.length === 0,\n  name,\n  phone,\n  vehicleType,\n  vehicleDescription: String(d.vehicleDescription || ''),\n  licensePlate: String(d.licensePlate || ''),\n  teams: [String(teamId || '')],\n  docLines: docLines.join('\\n'),\n  missingEmail: `Hi ${first},\\n\\nThanks for sending your driver packet. Before we can set you up, we still need:\\n\\n${needed.map((n) => `- ${n}`).join('\\n')}\\n\\nReply to this email with the missing pieces and we will pick it up from there.\\n\\n${company}`,\n  welcomeEmail: `Hi ${first},\\n\\nYour packet is complete and you are set up as a driver. You will get a text with a link to install the Onfleet driver app on ${phone}. Sign in with that number.\\n\\n${company}`,\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Packet check",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Check the packet",
        "nextElementIds": [
          "429132DA-1646-409A-AC6D-EF497CCA45C0"
        ],
        "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": "Tell the driver to expect the app invite Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "legacyElementId": "JS###v1###GmailService###sendMessage",
          "methodName": "sendMessage",
          "position": {
            "x": 1245,
            "y": 510
          }
        },
        "flowElementId": "C9DD9A62-46DD-4F2F-BFB0-F7BD07280F23",
        "groupId": null,
        "id": "15EA1015-4870-4AE6-92A1-FAB363AB050B",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "to",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "New driver packet",
                    "subPathSegments": [
                      {
                        "key": "fromAddress",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "6DB74AA1-2F86-4D0E-8245-58DF0F784210"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Re: "
                  },
                  {
                    "id": "RESULT",
                    "label": "New driver packet",
                    "subPathSegments": [
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "6DB74AA1-2F86-4D0E-8245-58DF0F784210"
                  }
                ],
                "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": "Packet check",
                    "subPathSegments": [
                      {
                        "key": "welcomeEmail",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "08691EDB-6A2E-4A03-A659-5504399CB31F"
                  }
                ],
                "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": [
                  {
                    "id": "RESULT",
                    "label": "New driver packet",
                    "subPathSegments": [
                      {
                        "key": "threadId",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "6DB74AA1-2F86-4D0E-8245-58DF0F784210"
                  }
                ],
                "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": "Welcome email",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell the driver to expect the app invite",
        "nextElementIds": [
          "DD15ABE8-4CE8-4C72-88D0-9A3EBB1E1BCB"
        ],
        "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": "Ask the ops lead Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 144,
            "y": 210
          }
        },
        "flowElementId": "8B721E9C-63B7-4986-99D4-3B10A62ADE8D",
        "groupId": null,
        "id": "E573FEE6-E0C6-48DA-B08D-08CC83AE28BF",
        "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": "Question card",
                    "subPathSegments": [
                      {
                        "key": "text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B09C7404-A55A-4346-ACAD-4014C51C0EFD"
                  }
                ],
                "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": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "blocks",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B09C7404-A55A-4346-ACAD-4014C51C0EFD"
                  }
                ],
                "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": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Question to ops lead",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask the ops lead",
        "nextElementIds": [
          "1CC99424-A900-4068-9AEC-86F1E99E1A02"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the question for the ops lead Result"
          },
          "position": {
            "x": 477,
            "y": 219
          }
        },
        "flowElementId": "85014EAE-0E1F-4189-86E1-315FC4249EBE",
        "groupId": null,
        "id": "B09C7404-A55A-4346-ACAD-4014C51C0EFD",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'Write the question for the ops lead', Error: The placeholder \"Answer link\" has no value",
            "valid": false
          },
          "codeArguments": [
            {
              "name": "name",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Packet check",
                    "subPathSegments": [
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "08691EDB-6A2E-4A03-A659-5504399CB31F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "email",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "New driver packet",
                    "subPathSegments": [
                      {
                        "key": "fromAddress",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "6DB74AA1-2F86-4D0E-8245-58DF0F784210"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "phone",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Packet check",
                    "subPathSegments": [
                      {
                        "key": "phone",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "08691EDB-6A2E-4A03-A659-5504399CB31F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "vehicleType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Packet check",
                    "subPathSegments": [
                      {
                        "key": "vehicleType",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "08691EDB-6A2E-4A03-A659-5504399CB31F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "vehicleDescription",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Packet check",
                    "subPathSegments": [
                      {
                        "key": "vehicleDescription",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "08691EDB-6A2E-4A03-A659-5504399CB31F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "licensePlate",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Packet check",
                    "subPathSegments": [
                      {
                        "key": "licensePlate",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "08691EDB-6A2E-4A03-A659-5504399CB31F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "docLines",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Packet check",
                    "subPathSegments": [
                      {
                        "key": "docLines",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "08691EDB-6A2E-4A03-A659-5504399CB31F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "answerLink",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Answer link",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Answer link"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "executionId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_ID",
                    "label": null,
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.executionId",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "executionId",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const link = (decision) => `${answerLink}?execution=${encodeURIComponent(executionId)}&decision=${decision}`;\nconst lines = [\n  `*New driver packet: ${name}*`,\n  `Email: ${email}   Mobile: ${phone}`,\n  `Vehicle: ${[vehicleType, vehicleDescription, licensePlate].filter(Boolean).join(', ')}`,\n  'The W-9, license and insurance are in and current:',\n  docLines,\n].filter(Boolean);\nreturn {\n  text: `New driver packet from ${name}. Add them to Onfleet?`,\n  blocks: [\n    { type: 'section', text: { type: 'mrkdwn', text: lines.join('\\n') } },\n    { type: 'actions', elements: [\n      { type: 'button', style: 'primary', text: { type: 'plain_text', text: 'Add the driver' }, url: link('add') },\n      { type: 'button', text: { type: 'plain_text', text: 'Do not add' }, url: link('skip') },\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": "Question card",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the question for the ops lead",
        "nextElementIds": [
          "E573FEE6-E0C6-48DA-B08D-08CC83AE28BF"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "external-callback",
          "isFirstElement": false,
          "blockDefinitionId": "external-callback",
          "position": {
            "x": 110,
            "y": 519
          }
        },
        "flowElementId": "5DADF8DD-D786-4454-911D-328CDF538622",
        "groupId": null,
        "id": "1CC99424-A900-4068-9AEC-86F1E99E1A02",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "resultAlias": "Ops decision",
          "slaConditions": [],
          "storeResult": true,
          "type": "CALLBACK"
        },
        "name": "Wait for the ops lead's answer",
        "nextElementIds": [
          "AB1CF813-C818-414C-86F9-7FC29CC028E4"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 525,
            "y": 519
          }
        },
        "flowElementId": "7A4A6E26-05E2-4519-B7D4-2BF413A272D9",
        "groupId": null,
        "id": "AB1CF813-C818-414C-86F9-7FC29CC028E4",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "f4c61d6a-c816-4455-88d0-ec270cbef094",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "RESULT",
                      "label": "Ops decision",
                      "subPathSegments": [
                        {
                          "key": "decision",
                          "optional": false
                        }
                      ],
                      "type": "TRIGGER_DATA",
                      "value": "1CC99424-A900-4068-9AEC-86F1E99E1A02"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "add"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "f4c61d6a-c816-4455-88d0-ec270cbef094"
            ]
          },
          "elseComponent": {
            "componentId": "6F6AF99C-92A9-49E4-997E-2E757F139AFA",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Add the driver",
          "storeResult": false,
          "thenComponent": {
            "componentId": "A2EF359B-FED8-408E-B555-F59E023EEFA9",
            "componentType": "ELEMENT"
          }
        },
        "name": "Add the driver?",
        "nextElementIds": [
          "6F6AF99C-92A9-49E4-997E-2E757F139AFA",
          "A2EF359B-FED8-408E-B555-F59E023EEFA9"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "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": "Confirm the driver is not added Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 873,
            "y": 640
          }
        },
        "flowElementId": "A223C1A0-E4E8-4F28-B35B-27A04F1BE504",
        "groupId": null,
        "id": "6F6AF99C-92A9-49E4-997E-2E757F139AFA",
        "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": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Not added. "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Packet check",
                    "subPathSegments": [
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "08691EDB-6A2E-4A03-A659-5504399CB31F"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " is not in Onfleet and has not been emailed. Reply to the driver from the inbox when you are ready."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to ops lead",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E573FEE6-E0C6-48DA-B08D-08CC83AE28BF"
                  }
                ],
                "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": "Not added confirmation",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the driver is not added",
        "nextElementIds": [],
        "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": "Ask the driver for what's missing Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "legacyElementId": "JS###v1###GmailService###sendMessage",
          "methodName": "sendMessage",
          "position": {
            "x": 483,
            "y": 340
          }
        },
        "flowElementId": "C45A5747-7156-493F-A418-119390801AF2",
        "groupId": null,
        "id": "E88DC157-D11A-444D-9665-7456EFDAD168",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "to",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "New driver packet",
                    "subPathSegments": [
                      {
                        "key": "fromAddress",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "6DB74AA1-2F86-4D0E-8245-58DF0F784210"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Re: "
                  },
                  {
                    "id": "RESULT",
                    "label": "New driver packet",
                    "subPathSegments": [
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "6DB74AA1-2F86-4D0E-8245-58DF0F784210"
                  }
                ],
                "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": "Packet check",
                    "subPathSegments": [
                      {
                        "key": "missingEmail",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "08691EDB-6A2E-4A03-A659-5504399CB31F"
                  }
                ],
                "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": [
                  {
                    "id": "RESULT",
                    "label": "New driver packet",
                    "subPathSegments": [
                      {
                        "key": "threadId",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "6DB74AA1-2F86-4D0E-8245-58DF0F784210"
                  }
                ],
                "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": "Missing items email",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask the driver for what's missing",
        "nextElementIds": [],
        "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": "Confirm the driver is added Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1281,
            "y": 810
          }
        },
        "flowElementId": "FE7BAF96-BFB7-4488-A619-C87F0F9F6772",
        "groupId": null,
        "id": "DD15ABE8-4CE8-4C72-88D0-9A3EBB1E1BCB",
        "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": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Added. "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Packet check",
                    "subPathSegments": [
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "08691EDB-6A2E-4A03-A659-5504399CB31F"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " is on the Onfleet team and gets the driver app invite by text at "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Packet check",
                    "subPathSegments": [
                      {
                        "key": "phone",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "08691EDB-6A2E-4A03-A659-5504399CB31F"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ". The driver was told by email."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to ops lead",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E573FEE6-E0C6-48DA-B08D-08CC83AE28BF"
                  }
                ],
                "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": "Added confirmation",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the driver is added",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Pull the driver's details Result"
          },
          "tools": {},
          "position": {
            "x": 1296,
            "y": 49
          }
        },
        "flowElementId": "65B8B03C-A2E9-4BAE-ABA2-16C9DA3D51D1",
        "groupId": null,
        "id": "4F3D989A-C2FD-4D67-9537-1F289500B475",
        "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": [],
          "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": "Driver details",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "A contract delivery driver emailed an onboarding packet. From the email and the readings of the documents in it, reply with JSON only, with these fields:\nname: the driver's full name as it appears on the driver's license, or on the email if there is no license\nphone: the driver's mobile phone number in international format, such as +14155550120, or empty text if the email and documents give none\nvehicleType: one of CAR, TRUCK, MOTORCYCLE, BICYCLE. Use TRUCK for a van, pickup or box truck, and CAR when you cannot tell\nvehicleDescription: the vehicle's year, make and model, or empty text\nlicensePlate: the vehicle's plate, or empty text"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "From: "
              },
              {
                "id": "RESULT",
                "label": "New driver packet",
                "subPathSegments": [
                  {
                    "key": "fromName",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "6DB74AA1-2F86-4D0E-8245-58DF0F784210"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": " <"
              },
              {
                "id": "RESULT",
                "label": "New driver packet",
                "subPathSegments": [
                  {
                    "key": "fromAddress",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "6DB74AA1-2F86-4D0E-8245-58DF0F784210"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ">\nSubject: "
              },
              {
                "id": "RESULT",
                "label": "New driver packet",
                "subPathSegments": [
                  {
                    "key": "subject",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "6DB74AA1-2F86-4D0E-8245-58DF0F784210"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\n"
              },
              {
                "id": "RESULT",
                "label": "New driver packet",
                "subPathSegments": [
                  {
                    "key": "message",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "6DB74AA1-2F86-4D0E-8245-58DF0F784210"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\nDocument readings:\n"
              },
              {
                "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                "label": "Default - Documents",
                "subPathSegments": null,
                "type": "EXECUTION_CONTEXT_PATH",
                "value": "executionContext.dataBuckets.Default.Documents",
                "valueSegments": [
                  {
                    "key": "executionContext",
                    "optional": false
                  },
                  {
                    "key": "dataBuckets",
                    "optional": false
                  },
                  {
                    "key": "Default",
                    "optional": false
                  },
                  {
                    "key": "Documents",
                    "optional": false
                  }
                ]
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Pull the driver's details",
        "nextElementIds": [
          "08691EDB-6A2E-4A03-A659-5504399CB31F"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Creates a new worker (driver). Requires a name, a phone number in international format, and at least one team. Optionally provide a vehicle. The worker receives an SMS invite to the Onfleet driver app.",
          "elementId": "EXTENSION:::SHARED:::default:::onfleet:::createWorker",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Add the driver to Onfleet Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::onfleet:::createWorker",
          "legacyElementId": "JS###v1###OnfleetService###createWorker",
          "methodName": "createWorker",
          "position": {
            "x": 894,
            "y": 510
          }
        },
        "flowElementId": "6A90E8E4-01A0-4051-B036-0C461ED9FFA0",
        "groupId": null,
        "id": "A2EF359B-FED8-408E-B555-F59E023EEFA9",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "name",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Packet check",
                    "subPathSegments": [
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "08691EDB-6A2E-4A03-A659-5504399CB31F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "phone",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Packet check",
                    "subPathSegments": [
                      {
                        "key": "phone",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "08691EDB-6A2E-4A03-A659-5504399CB31F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "teams",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Packet check",
                    "subPathSegments": [
                      {
                        "key": "teams",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "08691EDB-6A2E-4A03-A659-5504399CB31F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "vehicleType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Packet check",
                    "subPathSegments": [
                      {
                        "key": "vehicleType",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "08691EDB-6A2E-4A03-A659-5504399CB31F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "vehicleDescription",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Packet check",
                    "subPathSegments": [
                      {
                        "key": "vehicleDescription",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "08691EDB-6A2E-4A03-A659-5504399CB31F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "licensePlate",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Packet check",
                    "subPathSegments": [
                      {
                        "key": "licensePlate",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "08691EDB-6A2E-4A03-A659-5504399CB31F"
                  }
                ],
                "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": "createWorker",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "New driver",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "onfleet",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Add the driver to Onfleet",
        "nextElementIds": [
          "15EA1015-4870-4AE6-92A1-FAB363AB050B"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 909,
            "y": 219
          }
        },
        "flowElementId": "7657F0D5-CBF4-4397-9D88-D002E3B0524F",
        "groupId": null,
        "id": "429132DA-1646-409A-AC6D-EF497CCA45C0",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "1e2f8b0d-e1c3-4941-8864-51067dec9325",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Packet check",
                      "subPathSegments": [
                        {
                          "key": "complete",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "08691EDB-6A2E-4A03-A659-5504399CB31F"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "1e2f8b0d-e1c3-4941-8864-51067dec9325"
            ]
          },
          "elseComponent": {
            "componentId": "E88DC157-D11A-444D-9665-7456EFDAD168",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Packet complete",
          "storeResult": false,
          "thenComponent": {
            "componentId": "B09C7404-A55A-4346-ACAD-4014C51C0EFD",
            "componentType": "ELEMENT"
          }
        },
        "name": "Packet complete?",
        "nextElementIds": [
          "E88DC157-D11A-444D-9665-7456EFDAD168",
          "B09C7404-A55A-4346-ACAD-4014C51C0EFD"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      }
    ],
    "firstElementId": "6DB74AA1-2F86-4D0E-8245-58DF0F784210",
    "groups": [
      {
        "clientMetadata": {
          "elementId": "list-iterator",
          "isFirstElement": false,
          "blockDefinitionId": "list-iterator",
          "viewport": {
            "x": -70,
            "y": 0,
            "zoom": 1
          },
          "position": {
            "x": 880,
            "y": 49
          }
        },
        "flowElementId": "A103DD19-7780-4695-A5FE-B7FA9E158C17",
        "groupId": null,
        "id": "A2E9192A-897A-4FBE-A3A0-65AC7EA716E6",
        "loopType": "LIST_ITERATOR",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "enabled": true,
          "firstElementId": "5122B41C-09A2-4E3F-85CB-EC1733419CB4",
          "list": {
            "expression": [
              {
                "id": "RESULT",
                "label": "New driver packet",
                "subPathSegments": [
                  {
                    "key": "attachments",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "6DB74AA1-2F86-4D0E-8245-58DF0F784210"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "onFailElemId": null,
          "resultAlias": "each",
          "storeResult": true
        },
        "name": "Each document in the packet",
        "nextElementIds": [
          "4F3D989A-C2FD-4D67-9537-1F289500B475"
        ],
        "nextGroupIds": [],
        "type": "LOOP"
      }
    ],
    "id": "30A558D5-8616-4005-8633-7D906E392F85",
    "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": "Block 'Check the packet' has an invalid configuration. Code Argument 'teamId' has invalid value. Placeholder Data 'Driver team': value is required",
      "executionStaticData": [
        {
          "description": "",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "The URL of the block Wait for the ops lead's answer. The Slack buttons open it.",
          "error": null,
          "name": "Answer link",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The ID of the Onfleet team new drivers join.",
          "error": "Placeholder Data 'Driver team': value is required",
          "name": "Driver team",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "Your company name as drivers know it, used to sign the emails.",
          "error": null,
          "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:50:51.311Z"
}
