{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "44CAE0C2-3652-425E-AB87-85EE6914FF32",
    "name": "Google Drive: load paperwork filed by load number"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -70,
        "y": -270,
        "zoom": 1
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When load paperwork arrives by email, reads each attachment, finds the load in McLeod and files it in Google Drive in a folder named by the load number. Paperwork with no load number or no matching load goes to ops in Slack.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When load paperwork arrives by email, reads each attachment, finds the load in McLeod and files it in Google Drive in a folder named by the load number. Paperwork with no load number or no matching load goes to ops in Slack.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the document Result"
          },
          "tools": {},
          "position": {
            "x": 1042,
            "y": 49
          }
        },
        "flowElementId": "18A1CCAB-63D5-489F-AD3D-657E0A5B670A",
        "groupId": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594",
        "id": "DE188C2E-3171-4759-9936-284F25FB2F61",
        "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": "ELEMENT_RESULT",
                    "label": "File type",
                    "subPathSegments": [
                      {
                        "key": "mimeType",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "EDD541EB-0FA8-477E-9F66-A6214FC6DAED"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "STRING"
              },
              "url": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Saved file",
                    "subPathSegments": [
                      {
                        "key": "fileUrl",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DCC09A0B-AE79-4076-9E5C-65D5D8AE5D64"
                  }
                ],
                "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 sort the load paperwork that carriers, shippers and drivers email to a freight broker. Look at the attached file and reply with JSON only, with these fields:\ndocumentType: exactly one of \"Rate con\", \"BOL\", \"POD\", \"Carrier invoice\", \"Lumper receipt\", \"Other\", \"Not paperwork\". A BOL signed by the consignee at delivery is a POD. Use \"Other\" for any other load paperwork, such as a scale ticket, detention or layover backup, a TONU notice or an OS&D report. Use \"Not paperwork\" for logos, signature images, banners and anything that is not about a shipment.\nloadNumber: the broker's load or order number printed on the document (often labeled Load #, Load ID, Order # or Broker Ref), or empty text if there is none. Never put a PRO, BOL or PO number here. Use the email subject or body only when the document itself has no load number.\nproNumber: the PRO number, or empty text\nbolNumber: the bill of lading number, or empty text\ncarrier: the carrier's name, or empty text"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Attachment: "
              },
              {
                "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                "label": null,
                "subPathSegments": [
                  {
                    "key": "filename",
                    "optional": false
                  }
                ],
                "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                "value": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nEmail from "
              },
              {
                "id": "RESULT",
                "label": "Paperwork email",
                "subPathSegments": [
                  {
                    "key": "fromAddress",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "20636DF5-419F-498E-9A03-A925AE1F928A"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nSubject: "
              },
              {
                "id": "RESULT",
                "label": "Paperwork email",
                "subPathSegments": [
                  {
                    "key": "subject",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "20636DF5-419F-498E-9A03-A925AE1F928A"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\n"
              },
              {
                "id": "RESULT",
                "label": "Paperwork email",
                "subPathSegments": [
                  {
                    "key": "message",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "20636DF5-419F-498E-9A03-A925AE1F928A"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Read the document",
        "nextElementIds": [
          "C1ED00CA-2AA5-421D-BD22-094C3092AFF9"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 415,
            "y": 49
          }
        },
        "flowElementId": "A5937945-324B-4480-8961-C57F19A50A5C",
        "groupId": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594",
        "id": "B4FA5CF0-5B3E-4F25-8E19-086329D3D82F",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "b0d2f39c-302e-41dc-a51d-45c089d94b3e",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "File type",
                      "subPathSegments": [
                        {
                          "key": "readable",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "EDD541EB-0FA8-477E-9F66-A6214FC6DAED"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "b0d2f39c-302e-41dc-a51d-45c089d94b3e"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "PDF or image",
          "storeResult": false,
          "thenComponent": {
            "componentId": "DCC09A0B-AE79-4076-9E5C-65D5D8AE5D64",
            "componentType": "ELEMENT"
          }
        },
        "name": "PDF or image?",
        "nextElementIds": [
          "DCC09A0B-AE79-4076-9E5C-65D5D8AE5D64"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Downloads files from URLs and uploads them to Google Drive, enabling AI agents to archive web content, save API responses, or collect files from external sources. Perfect for automated workflows that need to backup files from other services or capture generated content.",
          "elementId": "EXTENSION:::SHARED:::default:::google-drive-api:::uploadFile",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "File it in the load folder Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-drive-api:::uploadFile",
          "legacyElementId": "JS###v1###GoogleDrive###uploadFile",
          "methodName": "uploadFile",
          "position": {
            "x": 1353,
            "y": 510
          }
        },
        "flowElementId": "9098A0AA-B387-4A28-93EE-9EAA394E379C",
        "groupId": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594",
        "id": "4E95A5BE-52BD-4E94-8447-0CA53D47557F",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "sharedDriveId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "folderId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - Load folder ID",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.Load folder ID",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "Load folder ID",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "name",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "McLeod load",
                    "subPathSegments": [
                      {
                        "key": "load",
                        "optional": false
                      },
                      {
                        "key": "orderId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "95ABF015-DFC9-4C72-970B-B18D62A75ED3"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Document reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "documentType",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DE188C2E-3171-4759-9936-284F25FB2F61"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "File type",
                    "subPathSegments": [
                      {
                        "key": "ext",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "EDD541EB-0FA8-477E-9F66-A6214FC6DAED"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileUrl",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Saved file",
                    "subPathSegments": [
                      {
                        "key": "fileUrl",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DCC09A0B-AE79-4076-9E5C-65D5D8AE5D64"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'File it in the load folder', Error: OAuth Connection is required",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "uploadFile",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Filed document",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-drive-api",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "File it in the load folder",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1361,
            "y": 349
          }
        },
        "flowElementId": "F7B4AD23-FE16-4427-8A15-CE787BC67F5E",
        "groupId": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594",
        "id": "419DAC83-C6A5-4D07-B45A-12F52446964D",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "f923e895-6458-4c0d-9d07-326c8cb8abc3",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Document reading",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "loadNumber",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "DE188C2E-3171-4759-9936-284F25FB2F61"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "f923e895-6458-4c0d-9d07-326c8cb8abc3"
            ]
          },
          "elseComponent": {
            "componentId": "5E5D0C90-EA0F-4A59-9F11-4C9F128C0152",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Load number on it",
          "storeResult": false,
          "thenComponent": {
            "componentId": "95ABF015-DFC9-4C72-970B-B18D62A75ED3",
            "componentType": "ELEMENT"
          }
        },
        "name": "Load number on it?",
        "nextElementIds": [
          "5E5D0C90-EA0F-4A59-9F11-4C9F128C0152",
          "95ABF015-DFC9-4C72-970B-B18D62A75ED3"
        ],
        "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": "Send it to ops Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 415,
            "y": 640
          }
        },
        "flowElementId": "2CF5C076-5BAC-4A49-B484-13BADB3644C1",
        "groupId": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594",
        "id": "528C481D-DE1F-4E4A-A8BB-05C229DB5530",
        "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": "Ops note",
                    "subPathSegments": [
                      {
                        "key": "text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "5E5D0C90-EA0F-4A59-9F11-4C9F128C0152"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "COMPLEX_LIST",
              "value": []
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Message to ops",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Send it to ops",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "Load folder ID": "ac27b901-98ff-4ca0-bd79-24212ace3f1b"
          },
          "position": {
            "x": 1042,
            "y": 519
          }
        },
        "flowElementId": "47B29D8D-707D-4442-A662-9A6CC3D3E713",
        "groupId": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594",
        "id": "D9F847DB-A924-4817-BAE2-8B97DC8570D8",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "Load folder ID",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "New load folder",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F07A12DA-8CFF-406F-9351-363C3DE5CA46"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "b2",
          "storeResult": true
        },
        "name": "Use the new folder",
        "nextElementIds": [
          "4E95A5BE-52BD-4E94-8447-0CA53D47557F"
        ],
        "nextGroupIds": [],
        "type": "DATA_BUCKET"
      },
      {
        "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": 110,
            "y": 310
          }
        },
        "flowElementId": "C9365768-F842-4DC9-A6DC-420FE7AD5435",
        "groupId": null,
        "id": "20636DF5-419F-498E-9A03-A925AE1F928A",
        "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": "Paperwork email",
          "serviceId": "gmail-service",
          "slaConditions": [],
          "staticData": {
            "query": "in:inbox (filename:pdf OR filename:jpg OR filename:jpeg OR filename:png)"
          },
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New paperwork email",
        "nextElementIds": [],
        "nextGroupIds": [
          "8AD05F6E-73C8-4393-94D3-71CC2E3DD594"
        ],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Finds a load by its order number, PRO number, bill of lading, consignee reference or a stop reference number (McLeod order tracking search) and returns the first match in full, as Get Load does, with every match listed. Returns found: false instead of failing when nothing matches.",
          "elementId": "EXTENSION:::SHARED:::default:::mcleod-loadmaster:::findLoadByNumber",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the load in McLeod Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::mcleod-loadmaster:::findLoadByNumber",
          "legacyElementId": null,
          "methodName": "findLoadByNumber",
          "position": {
            "x": 1030,
            "y": 340
          }
        },
        "flowElementId": "DEA8AEA6-FD78-46A2-8699-F5C1AC87D00B",
        "groupId": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594",
        "id": "95ABF015-DFC9-4C72-970B-B18D62A75ED3",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Document reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DE188C2E-3171-4759-9936-284F25FB2F61"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "proNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "billOfLading",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "consigneeReference",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "referenceNumber",
              "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": "findLoadByNumber",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "McLeod load",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "mcleod-loadmaster",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the load in McLeod",
        "nextElementIds": [
          "32469DC2-A6D8-4A78-91CB-0C193F61D533"
        ],
        "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 note for ops Result"
          },
          "position": {
            "x": 410,
            "y": 219
          }
        },
        "flowElementId": "B498CC94-A760-4009-AD79-3FF959090ECD",
        "groupId": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594",
        "id": "5E5D0C90-EA0F-4A59-9F11-4C9F128C0152",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "documentType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Document reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "documentType",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DE188C2E-3171-4759-9936-284F25FB2F61"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Document reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DE188C2E-3171-4759-9936-284F25FB2F61"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sender",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Paperwork email",
                    "subPathSegments": [
                      {
                        "key": "fromAddress",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "20636DF5-419F-498E-9A03-A925AE1F928A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Paperwork email",
                    "subPathSegments": [
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "20636DF5-419F-498E-9A03-A925AE1F928A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileUrl",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Saved file",
                    "subPathSegments": [
                      {
                        "key": "fileUrl",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DCC09A0B-AE79-4076-9E5C-65D5D8AE5D64"
                  }
                ],
                "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": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const lines = [\n  `*${documentType || 'A document'} from ${sender} was not filed*`,\n  loadNumber ? `No load ${loadNumber} in McLeod.` : 'No load number on it.',\n  `Email: ${subject}`,\n  `<${fileUrl}|Open ${fileName}>`,\n];\nreturn { text: lines.join('\\n') };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Ops note",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the note for ops",
        "nextElementIds": [
          "528C481D-DE1F-4E4A-A8BB-05C229DB5530"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Saves a Gmail attachment to FlowRunner Files and returns the file URL.",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::saveAttachment",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Save the attachment Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::saveAttachment",
          "legacyElementId": "JS###v1###GmailService###saveAttachment",
          "methodName": "saveAttachment",
          "position": {
            "x": 724,
            "y": 40
          }
        },
        "flowElementId": "8A2EBE78-AEEF-4A2C-8A09-345B3719731D",
        "groupId": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594",
        "id": "DCC09A0B-AE79-4076-9E5C-65D5D8AE5D64",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "messageId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Paperwork email",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "20636DF5-419F-498E-9A03-A925AE1F928A"
                  }
                ],
                "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": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594"
                  }
                ],
                "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": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594"
                  }
                ],
                "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 file",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Save the attachment",
        "nextElementIds": [
          "DE188C2E-3171-4759-9936-284F25FB2F61"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "Load folder ID": "93e9b5bd-cfc9-4f08-aab7-f9b265eb8b24"
          },
          "position": {
            "x": 725,
            "y": 649
          }
        },
        "flowElementId": "9952B253-C47E-49CC-B997-FDB4E96B40C6",
        "groupId": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594",
        "id": "41E4ACF2-A3BB-467C-AC21-6699F790512A",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "Load folder ID",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Load folder",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3377E69E-188C-481B-AB2A-1248BDC1E84F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "b1",
          "storeResult": true
        },
        "name": "Use the load folder",
        "nextElementIds": [
          "4E95A5BE-52BD-4E94-8447-0CA53D47557F"
        ],
        "nextGroupIds": [],
        "type": "DATA_BUCKET"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 725,
            "y": 349
          }
        },
        "flowElementId": "134C5950-91BF-481D-A768-5EBF42A3E339",
        "groupId": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594",
        "id": "32469DC2-A6D8-4A78-91CB-0C193F61D533",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "985a60e7-b61d-406d-a618-46a934215e43",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "McLeod load",
                      "subPathSegments": [
                        {
                          "key": "found",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "95ABF015-DFC9-4C72-970B-B18D62A75ED3"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "985a60e7-b61d-406d-a618-46a934215e43"
            ]
          },
          "elseComponent": {
            "componentId": "5E5D0C90-EA0F-4A59-9F11-4C9F128C0152",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Load in McLeod",
          "storeResult": false,
          "thenComponent": {
            "componentId": "3377E69E-188C-481B-AB2A-1248BDC1E84F",
            "componentType": "ELEMENT"
          }
        },
        "name": "Load in McLeod?",
        "nextElementIds": [
          "5E5D0C90-EA0F-4A59-9F11-4C9F128C0152",
          "3377E69E-188C-481B-AB2A-1248BDC1E84F"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1361,
            "y": 49
          }
        },
        "flowElementId": "B8B3E3F9-130B-45AC-9FD1-91626AA67DEE",
        "groupId": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594",
        "id": "C1ED00CA-2AA5-421D-BD22-094C3092AFF9",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "1f02a881-e56d-4141-b3e1-a2b13d4df92a",
                "nestedOperation": null,
                "operation": "notEqual",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Document reading",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "documentType",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "DE188C2E-3171-4759-9936-284F25FB2F61"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "Not paperwork"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "1f02a881-e56d-4141-b3e1-a2b13d4df92a"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Load paperwork",
          "storeResult": false,
          "thenComponent": {
            "componentId": "419DAC83-C6A5-4D07-B45A-12F52446964D",
            "componentType": "ELEMENT"
          }
        },
        "name": "Load paperwork?",
        "nextElementIds": [
          "419DAC83-C6A5-4D07-B45A-12F52446964D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Creates a new folder in Google Drive.",
          "elementId": "EXTENSION:::SHARED:::default:::google-drive-api:::createFolder",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Create the load folder Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-drive-api:::createFolder",
          "legacyElementId": "JS###v1###GoogleDrive###createFolder",
          "methodName": "createFolder",
          "position": {
            "x": 720,
            "y": 510
          }
        },
        "flowElementId": "F3262BFD-5FEF-48B6-A024-CA1E2B05CF8F",
        "groupId": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594",
        "id": "F07A12DA-8CFF-406F-9351-363C3DE5CA46",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "sharedDriveId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "parentFolderId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Loads folder",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Loads folder"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "name",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "McLeod load",
                    "subPathSegments": [
                      {
                        "key": "load",
                        "optional": false
                      },
                      {
                        "key": "orderId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "95ABF015-DFC9-4C72-970B-B18D62A75ED3"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Create the load folder', Error: The placeholder \"Loads folder\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "createFolder",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "New load folder",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-drive-api",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Create the load folder",
        "nextElementIds": [
          "D9F847DB-A924-4817-BAE2-8B97DC8570D8"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 415,
            "y": 519
          }
        },
        "flowElementId": "19BDFC71-57D6-444C-8B2D-8EA6799BF45F",
        "groupId": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594",
        "id": "759A19DA-987E-4704-882C-C900176E3711",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "d2e12d5b-1ccc-43d1-80c1-d8286082cb36",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Load folder",
                      "subPathSegments": [
                        {
                          "key": "id",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "3377E69E-188C-481B-AB2A-1248BDC1E84F"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "d2e12d5b-1ccc-43d1-80c1-d8286082cb36"
            ]
          },
          "elseComponent": {
            "componentId": "F07A12DA-8CFF-406F-9351-363C3DE5CA46",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Load folder there",
          "storeResult": false,
          "thenComponent": {
            "componentId": "41E4ACF2-A3BB-467C-AC21-6699F790512A",
            "componentType": "ELEMENT"
          }
        },
        "name": "Load folder there?",
        "nextElementIds": [
          "41E4ACF2-A3BB-467C-AC21-6699F790512A",
          "F07A12DA-8CFF-406F-9351-363C3DE5CA46"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": true,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Check the file type Result"
          },
          "position": {
            "x": 110,
            "y": 49
          }
        },
        "flowElementId": "7CFFFC1D-8FEC-4319-88A7-47E1AA3CC34B",
        "groupId": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594",
        "id": "EDD541EB-0FA8-477E-9F66-A6214FC6DAED",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "mimeType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "mimetype",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594"
                  }
                ],
                "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": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const type = String(mimeType || '').toLowerCase();\nconst ext = (String(fileName || '').match(/\\.[A-Za-z0-9]+$/) || ['.pdf'])[0].toLowerCase();\nreturn { mimeType: type, ext, readable: type.includes('pdf') || type.startsWith('image/') };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "File type",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Check the file type",
        "nextElementIds": [
          "B4FA5CF0-5B3E-4F25-8E19-086329D3D82F"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Locates folders in Google Drive for AI agents to find target directories, verify folder existence, or get folder information for file organization workflows. Perfect for automated systems that need to find specific folders before performing file operations.",
          "elementId": "EXTENSION:::SHARED:::default:::google-drive-api:::findFolder",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the load folder Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-drive-api:::findFolder",
          "legacyElementId": "JS###v1###GoogleDrive###findFolder",
          "methodName": "findFolder",
          "position": {
            "x": 415,
            "y": 340
          }
        },
        "flowElementId": "078708F4-D490-4494-A81F-657E8D2664AF",
        "groupId": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594",
        "id": "3377E69E-188C-481B-AB2A-1248BDC1E84F",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "toSharedDriveId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "search",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "McLeod load",
                    "subPathSegments": [
                      {
                        "key": "load",
                        "optional": false
                      },
                      {
                        "key": "orderId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "95ABF015-DFC9-4C72-970B-B18D62A75ED3"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "parentFolderId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Loads folder",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Loads folder"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "exactMatch",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_TRUE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": true
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Find the load folder', Error: The placeholder \"Loads folder\" has no value",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "findFolder",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Load folder",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-drive-api",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the load folder",
        "nextElementIds": [
          "759A19DA-987E-4704-882C-C900176E3711"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "20636DF5-419F-498E-9A03-A925AE1F928A",
    "groups": [
      {
        "clientMetadata": {
          "elementId": "list-iterator",
          "isFirstElement": false,
          "blockDefinitionId": "list-iterator",
          "viewport": {
            "x": -60.06497725795971,
            "y": 3.6127355425601024,
            "zoom": 0.91
          },
          "position": {
            "x": 418,
            "y": 319
          }
        },
        "flowElementId": "E698ACA9-B2DA-4B08-9FA6-B11D065F5C2D",
        "groupId": null,
        "id": "8AD05F6E-73C8-4393-94D3-71CC2E3DD594",
        "loopType": "LIST_ITERATOR",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'For each attachment', Error: Children have error",
            "valid": false
          },
          "enabled": true,
          "firstElementId": "EDD541EB-0FA8-477E-9F66-A6214FC6DAED",
          "list": {
            "expression": [
              {
                "id": "RESULT",
                "label": "Paperwork email",
                "subPathSegments": [
                  {
                    "key": "attachments",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "20636DF5-419F-498E-9A03-A925AE1F928A"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "onFailElemId": null,
          "resultAlias": "L",
          "storeResult": true
        },
        "name": "For each attachment",
        "nextElementIds": [],
        "nextGroupIds": [],
        "type": "LOOP"
      }
    ],
    "id": "431950F5-2292-4E5F-8F9B-CDF8579A294D",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": "Please fix problems before start. Blocks with issues have red badge in the top-right corner of a block, hover it to see what needs to be done.",
        "valid": false
      },
      "errorMessage": "Please fix problems before start. Blocks with issues have red badge in the top-right corner of a block, hover it to see what needs to be done.",
      "executionStaticData": [
        {
          "description": "Your Anthropic API key, used by the step that reads each document.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "The ID of the Google Drive folder that holds one folder per load (the part of the folder's link after /folders/).",
          "error": null,
          "name": "Loads folder",
          "type": "STRING",
          "value": ""
        }
      ],
      "initialData": null,
      "initialDataDefaultValues": {},
      "ownerFlowVersionId": null,
      "schedule": null,
      "sharedMemory": {
        "anchor": {
          "missingAnchorPolicy": null,
          "path": null,
          "type": "FLOW_MEMORY"
        },
        "expirationInSec": null
      },
      "wasLive": false
    }
  },
  "slaCalendars": [],
  "slaGoals": [],
  "subFlows": [],
  "exportDate": "2026-11-26T05:49:24.758Z"
}
