{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "C382C4CF-3271-418F-8C98-A12047C57411",
    "name": "SharePoint: load paperwork requests answered"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -70,
        "y": -480,
        "zoom": 1
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When an auditor or customer emails the billing inbox in Outlook asking for a load's paperwork, each load is found in McLeod LoadMaster and its folder in the SharePoint archive gets an expiring view link. An AI agent drafts the reply with the links, the draft is saved in Outlook, and billing is told in Slack. A person checks and sends it.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When an auditor or customer emails the billing inbox in Outlook asking for a load's paperwork, each load is found in McLeod LoadMaster and its folder in the SharePoint archive gets an expiring view link. An AI agent drafts the reply with the links, the draft is saved in Outlook, and billing is told in Slack. A person checks and sends it.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "Loads": "dc7eb834-6241-425a-9d14-c0aaec8f98df"
          },
          "position": {
            "x": 122,
            "y": 519
          }
        },
        "flowElementId": "E473B3E5-6AF0-4749-9BAD-2912A333A630",
        "groupId": "CB87BF38-253F-474C-9B82-4DCC6C77305C",
        "id": "28BD44FC-E99A-4B7C-AE08-2B5F97CBDD42",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "Loads",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - Loads",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.Loads",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "Loads",
                        "optional": false
                      }
                    ]
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Load note",
                    "subPathSegments": [
                      {
                        "key": "line",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4D31897E-D654-4838-A6F0-70B4EC95CE33"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "b1",
          "storeResult": true
        },
        "name": "Add it to the list",
        "nextElementIds": [],
        "nextGroupIds": [],
        "type": "DATA_BUCKET"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Draft the reply Result"
          },
          "tools": {},
          "position": {
            "x": 139,
            "y": 869
          }
        },
        "flowElementId": "CBD357BB-194C-4D66-8526-7161D327E231",
        "groupId": null,
        "id": "6EC8CCD7-C7FE-41DA-9FC3-48FB5794D922",
        "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": "Reply",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You draft a reply for the billing team at a freight broker, 3PL or carrier to someone who asked for load paperwork. A person on the team reads your draft, checks it and sends it, so write it ready to send. Reply with JSON only, with two fields:\nsubject: \"RE: \" followed by their subject.\nbody: the reply as plain text. Greet them by first name if you have it. Give one line per load with its load number, its PO or BOL when listed, and its SharePoint link exactly as given, character for character. Say the links open the load's documents, are view only, and work until the date given. For a load listed as not found or not in the archive, say you are pulling that paperwork and will follow up; never explain why and never invent a link. Mention no rates, carrier names, carrier pay or anything that is not in the list. Do not promise a date for the follow up. Keep it short and plain. End with \"Thanks,\" and no name, because the sender adds their signature."
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Their email\nFrom: "
              },
              {
                "id": "RESULT",
                "label": "Request email",
                "subPathSegments": [
                  {
                    "key": "from",
                    "optional": false
                  },
                  {
                    "key": "emailAddress",
                    "optional": false
                  },
                  {
                    "key": "name",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "F36BF6F3-F5DF-4E3B-807A-600C7C91F1A0"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": " <"
              },
              {
                "id": "RESULT",
                "label": "Request email",
                "subPathSegments": [
                  {
                    "key": "from",
                    "optional": false
                  },
                  {
                    "key": "emailAddress",
                    "optional": false
                  },
                  {
                    "key": "address",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "F36BF6F3-F5DF-4E3B-807A-600C7C91F1A0"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ">\nSubject: "
              },
              {
                "id": "RESULT",
                "label": "Request email",
                "subPathSegments": [
                  {
                    "key": "subject",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "F36BF6F3-F5DF-4E3B-807A-600C7C91F1A0"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\n"
              },
              {
                "id": "RESULT",
                "label": "Request email",
                "subPathSegments": [
                  {
                    "key": "body",
                    "optional": false
                  },
                  {
                    "key": "content",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "F36BF6F3-F5DF-4E3B-807A-600C7C91F1A0"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\nWhat they asked for: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Request",
                "subPathSegments": [
                  {
                    "key": "output",
                    "optional": false
                  },
                  {
                    "key": "documentsAsked",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "77D772F2-DEBA-4416-85AD-F4590A6CBC5B"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nThe links work until: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Library",
                "subPathSegments": [
                  {
                    "key": "expiresOn",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "42BDD99A-D59A-4A6C-AF64-72015611A3FA"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\nLoads:\n"
              },
              {
                "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                "label": "Default - Loads",
                "subPathSegments": null,
                "type": "EXECUTION_CONTEXT_PATH",
                "value": "executionContext.dataBuckets.Default.Loads",
                "valueSegments": [
                  {
                    "key": "executionContext",
                    "optional": false
                  },
                  {
                    "key": "dataBuckets",
                    "optional": false
                  },
                  {
                    "key": "Default",
                    "optional": false
                  },
                  {
                    "key": "Loads",
                    "optional": false
                  }
                ]
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Draft the reply",
        "nextElementIds": [
          "6B142E70-C5CB-42D8-9629-01A60E0325E7"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "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": true,
          "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": 110,
            "y": 40
          }
        },
        "flowElementId": "BA0E930D-5262-4541-85E5-EA8EDC3D695D",
        "groupId": "CB87BF38-253F-474C-9B82-4DCC6C77305C",
        "id": "D956DA36-3459-4D97-9A71-38031BA62719",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "orderNumber",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CB87BF38-253F-474C-9B82-4DCC6C77305C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "proNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "proNumber",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CB87BF38-253F-474C-9B82-4DCC6C77305C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "billOfLading",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "billOfLading",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CB87BF38-253F-474C-9B82-4DCC6C77305C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "consigneeReference",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "referenceNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "reference",
                        "optional": false
                      }
                    ],
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CB87BF38-253F-474C-9B82-4DCC6C77305C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "includeCustomerContacts",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "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 match",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "mcleod-loadmaster",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the load in McLeod",
        "nextElementIds": [
          "0AF1C32A-826E-4B1F-84D8-EC227C4E95E3"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "error-handler",
          "isFirstElement": false,
          "blockDefinitionId": "error-handler",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Not in the archive Result"
          },
          "position": {
            "x": 433,
            "y": 349
          }
        },
        "flowElementId": "71983D8C-D614-48D2-94E8-6ED712081246",
        "groupId": "CB87BF38-253F-474C-9B82-4DCC6C77305C",
        "id": "66120C66-FF2E-4D41-A1A6-C10DBFFDF250",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Not archived",
          "saveToVariable": null,
          "storeResult": true
        },
        "name": "Not in the archive",
        "nextElementIds": [
          "4D31897E-D654-4838-A6F0-70B4EC95CE33"
        ],
        "nextGroupIds": [],
        "type": "ERROR_HANDLER"
      },
      {
        "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,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Tell billing a draft is waiting Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 769,
            "y": 860
          }
        },
        "flowElementId": "E7A7B7B8-2305-4114-A6D8-54C7805E349C",
        "groupId": null,
        "id": "32F2133B-1878-4DE3-AC93-AC77F72551CF",
        "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": "A draft reply to "
                  },
                  {
                    "id": "RESULT",
                    "label": "Request email",
                    "subPathSegments": [
                      {
                        "key": "from",
                        "optional": false
                      },
                      {
                        "key": "emailAddress",
                        "optional": false
                      },
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "F36BF6F3-F5DF-4E3B-807A-600C7C91F1A0"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " <"
                  },
                  {
                    "id": "RESULT",
                    "label": "Request email",
                    "subPathSegments": [
                      {
                        "key": "from",
                        "optional": false
                      },
                      {
                        "key": "emailAddress",
                        "optional": false
                      },
                      {
                        "key": "address",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "F36BF6F3-F5DF-4E3B-807A-600C7C91F1A0"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "> is in Outlook Drafts: "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Reply",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6EC8CCD7-C7FE-41DA-9FC3-48FB5794D922"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "\nCheck the sender works for that customer or audit firm, then send it.\n"
                  },
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - Loads",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.Loads",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "Loads",
                        "optional": false
                      }
                    ]
                  }
                ],
                "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": "Billing message",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell billing a draft is waiting",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Pick the library Result"
          },
          "position": {
            "x": 792,
            "y": 699
          }
        },
        "flowElementId": "C7BDF344-307E-4C8F-839F-9B7B886FDB61",
        "groupId": null,
        "id": "42BDD99A-D59A-4A6C-AF64-72015611A3FA",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "drives",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Libraries",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "F15B6FA9-651B-4A8E-959D-6D8030849706"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "library",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Document library",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Document library"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "archive",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Archive folder",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Archive folder"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "site",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Site",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "90BB0CBC-0D7D-498E-8A62-EA6B4EEE8CEC"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "days",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Link expires after days",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Link expires after days"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const list = drives && Array.isArray(drives.value) ? drives.value : (Array.isArray(drives) ? drives : []);\nconst want = String(library || '').trim().toLowerCase();\nconst drive = list.find((d) => String(d.name || '').trim().toLowerCase() === want);\nif (!drive) {\n  throw new Error(`No document library named \"${library}\" on this SharePoint site. Libraries found: ${list.map((d) => d.name).join(', ') || 'none'}`);\n}\nconst root = String(archive || '').replace(/^\\/+|\\/+$/g, '');\nif (!root) throw new Error('Set the flow setting Archive folder.');\nconst n = Number(days);\nconst exp = new Date(Date.now() + (n > 0 ? n : 14) * 86400000);\nreturn { siteId: String(site || ''), driveId: drive.id, archivePath: root, expiresAt: exp.toISOString().replace(/\\.\\d{3}Z$/, 'Z'), expiresOn: exp.toISOString().slice(0, 10) };\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Library",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Pick the library",
        "nextElementIds": [
          "FAAD0523-B1EC-48BA-9770-5EF339064FE6"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Creates a draft email with the specified content and optional parameters that can be sent later.",
          "elementId": "EXTENSION:::SHARED:::default:::outlook:::createDraftEmail",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Save the draft reply Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::outlook:::createDraftEmail",
          "legacyElementId": "JS###v1###OutlookService###createDraftEmail",
          "methodName": "createDraftEmail",
          "position": {
            "x": 468,
            "y": 860
          }
        },
        "flowElementId": "26DAAD28-590D-4591-A248-E0A25D053C75",
        "groupId": null,
        "id": "6B142E70-C5CB-42D8-9629-01A60E0325E7",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "to",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Request email",
                    "subPathSegments": [
                      {
                        "key": "from",
                        "optional": false
                      },
                      {
                        "key": "emailAddress",
                        "optional": false
                      },
                      {
                        "key": "address",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "F36BF6F3-F5DF-4E3B-807A-600C7C91F1A0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "from",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Reply",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6EC8CCD7-C7FE-41DA-9FC3-48FB5794D922"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Text"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "body",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Reply",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "body",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6EC8CCD7-C7FE-41DA-9FC3-48FB5794D922"
                  }
                ],
                "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": "conversationId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Save the draft reply', 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": "createDraftEmail",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Draft",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "outlook",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Save the draft reply",
        "nextElementIds": [
          "32F2133B-1878-4DE3-AC93-AC77F72551CF"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Fires once for each new email that arrives in a mail folder (the Inbox unless another folder is chosen), optionally only for emails from a sender, with a subject, with attachments or still unread.",
          "elementId": "EXTENSION:::SHARED:::default:::outlook:::onNewEmail",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::outlook:::onNewEmail",
          "newElementId": "EXTENSION:::SHARED:::default:::outlook:::onNewEmail",
          "legacyElementId": "JS###v1###OutlookService###onNewEmail",
          "methodName": "onNewEmail",
          "position": {
            "x": 110,
            "y": 520
          }
        },
        "flowElementId": "75B991FE-FDEE-41FB-9A79-0EE341730FA3",
        "groupId": null,
        "id": "F36BF6F3-F5DF-4E3B-807A-600C7C91F1A0",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'New email in the billing inbox', Error: OAuth Connection is required",
            "valid": false
          },
          "condition": null,
          "connectionId": null,
          "dynamicData": [],
          "eventName": "onNewEmail",
          "frequency": {
            "repeat": {
              "every": 120
            },
            "schedule": "custom"
          },
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Request email",
          "serviceId": "outlook",
          "slaConditions": [],
          "staticData": {
            "bodyFormat": "text"
          },
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New email in the billing inbox",
        "nextElementIds": [
          "77D772F2-DEBA-4416-85AD-F4590A6CBC5B"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 768,
            "y": 529
          }
        },
        "flowElementId": "B05B6C87-0280-4A48-A642-A9CDF6188179",
        "groupId": null,
        "id": "49FDD434-7E15-44FB-BCCD-10C943182430",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "a0f76278-bfae-439e-a696-97c8df75e3f2",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Request",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "isPaperworkRequest",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "77D772F2-DEBA-4416-85AD-F4590A6CBC5B"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              },
              {
                "id": "9517227f-c3d0-48b2-a73e-83e4fdee496c",
                "nestedOperation": null,
                "operation": "arrayIsNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Request",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "loads",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "77D772F2-DEBA-4416-85AD-F4590A6CBC5B"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "ARRAY",
                "values": []
              }
            ],
            "grouping": [
              "a0f76278-bfae-439e-a696-97c8df75e3f2",
              "AND",
              "9517227f-c3d0-48b2-a73e-83e4fdee496c"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Paperwork request",
          "storeResult": false,
          "thenComponent": {
            "componentId": "90BB0CBC-0D7D-498E-8A62-EA6B4EEE8CEC",
            "componentType": "ELEMENT"
          }
        },
        "name": "Asking for load paperwork?",
        "nextElementIds": [
          "90BB0CBC-0D7D-498E-8A62-EA6B4EEE8CEC"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 433,
            "y": 49
          }
        },
        "flowElementId": "B8ADFBAB-401A-4643-B7BB-00346C4CDE2D",
        "groupId": "CB87BF38-253F-474C-9B82-4DCC6C77305C",
        "id": "0AF1C32A-826E-4B1F-84D8-EC227C4E95E3",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "c6d379e8-6e2b-41f4-ab23-aa05dfc16fda",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "McLeod match",
                      "subPathSegments": [
                        {
                          "key": "found",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "D956DA36-3459-4D97-9A71-38031BA62719"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "c6d379e8-6e2b-41f4-ab23-aa05dfc16fda"
            ]
          },
          "elseComponent": {
            "componentId": "4D31897E-D654-4838-A6F0-70B4EC95CE33",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Load found",
          "storeResult": false,
          "thenComponent": {
            "componentId": "69472766-098D-4677-B9B6-ED9FB84C59AB",
            "componentType": "ELEMENT"
          }
        },
        "name": "Load found?",
        "nextElementIds": [
          "69472766-098D-4677-B9B6-ED9FB84C59AB",
          "4D31897E-D654-4838-A6F0-70B4EC95CE33"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves a drive item by its path within the drive root.",
          "elementId": "EXTENSION:::SHARED:::default:::sharepoint:::getDriveItemByPath",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find its archive folder Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::sharepoint:::getDriveItemByPath",
          "legacyElementId": "JS###v1###SharePointService###getDriveItemByPath",
          "methodName": "getDriveItemByPath",
          "position": {
            "x": 733,
            "y": 210
          }
        },
        "flowElementId": "7789994C-53C2-44EC-899E-B8D8DA762AF6",
        "groupId": "CB87BF38-253F-474C-9B82-4DCC6C77305C",
        "id": "E1EBA9F3-7DC2-473E-87D7-F8D82E3DA6DD",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "siteId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Library",
                    "subPathSegments": [
                      {
                        "key": "siteId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "42BDD99A-D59A-4A6C-AF64-72015611A3FA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "driveId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Library",
                    "subPathSegments": [
                      {
                        "key": "driveId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "42BDD99A-D59A-4A6C-AF64-72015611A3FA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "itemPath",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Folder path",
                    "subPathSegments": [
                      {
                        "key": "loadPath",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "69472766-098D-4677-B9B6-ED9FB84C59AB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Find its archive 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": "getDriveItemByPath",
          "onFailElemId": "66120C66-FF2E-4D41-A1A6-C10DBFFDF250",
          "packageId": "default",
          "resultAlias": "Load folder",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "sharepoint",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find its archive folder",
        "nextElementIds": [
          "396DCFE0-B421-4793-99E9-E6EEBCFAA49F"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Creates a shareable link to a file or folder. Choose link type (view, edit, embed) and scope (anonymous, organization).",
          "elementId": "EXTENSION:::SHARED:::default:::sharepoint:::createSharingLink",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Create a view link Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::sharepoint:::createSharingLink",
          "legacyElementId": "JS###v1###SharePointService###createSharingLink",
          "methodName": "createSharingLink",
          "position": {
            "x": 433,
            "y": 210
          }
        },
        "flowElementId": "3B916649-F486-4685-A6FA-D82E263BC733",
        "groupId": "CB87BF38-253F-474C-9B82-4DCC6C77305C",
        "id": "396DCFE0-B421-4793-99E9-E6EEBCFAA49F",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "siteId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Library",
                    "subPathSegments": [
                      {
                        "key": "siteId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "42BDD99A-D59A-4A6C-AF64-72015611A3FA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "driveId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Library",
                    "subPathSegments": [
                      {
                        "key": "driveId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "42BDD99A-D59A-4A6C-AF64-72015611A3FA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "itemId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Load folder",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E1EBA9F3-7DC2-473E-87D7-F8D82E3DA6DD"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "linkType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "view"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "scope",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Link scope",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Link scope"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "password",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "expirationDateTime",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Library",
                    "subPathSegments": [
                      {
                        "key": "expiresAt",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "42BDD99A-D59A-4A6C-AF64-72015611A3FA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Create a view link', 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": "createSharingLink",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Share link",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "sharepoint",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Create a view link",
        "nextElementIds": [
          "4D31897E-D654-4838-A6F0-70B4EC95CE33"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves all document libraries (drives) for a SharePoint site.",
          "elementId": "EXTENSION:::SHARED:::default:::sharepoint:::getDrives",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "List the document libraries Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::sharepoint:::getDrives",
          "legacyElementId": "JS###v1###SharePointService###getDrives",
          "methodName": "getDrives",
          "position": {
            "x": 1116,
            "y": 690
          }
        },
        "flowElementId": "B4918AD5-5D3B-403B-89C2-8266C55F4BE5",
        "groupId": null,
        "id": "F15B6FA9-651B-4A8E-959D-6D8030849706",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "siteId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Site",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "90BB0CBC-0D7D-498E-8A62-EA6B4EEE8CEC"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'List the document libraries', 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": "getDrives",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Libraries",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "sharepoint",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "List the document libraries",
        "nextElementIds": [
          "42BDD99A-D59A-4A6C-AF64-72015611A3FA"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "Loads": "d472b15a-5c0b-4ec7-ab4b-13592d005c77"
          },
          "position": {
            "x": 468,
            "y": 699
          }
        },
        "flowElementId": "884200A4-B9F9-4318-85D5-D25BA0089892",
        "groupId": null,
        "id": "FAAD0523-B1EC-48BA-9770-5EF339064FE6",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "Loads",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EMPTY_STRING",
                    "label": null,
                    "type": "KEYWORD",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "b0",
          "storeResult": true
        },
        "name": "Start the list",
        "nextElementIds": [],
        "nextGroupIds": [
          "CB87BF38-253F-474C-9B82-4DCC6C77305C"
        ],
        "type": "DATA_BUCKET"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the request Result"
          },
          "tools": {},
          "position": {
            "x": 468,
            "y": 529
          }
        },
        "flowElementId": "4779881D-B9AE-4100-B91C-2612C5D07930",
        "groupId": null,
        "id": "77D772F2-DEBA-4416-85AD-F4590A6CBC5B",
        "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": "Request",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You read emails that reach the billing inbox of a freight broker, 3PL or carrier. Decide whether the sender is asking for paperwork on one or more loads (a rate con, BOL, POD, invoice, lumper or detention receipt, or all the documents for a load), as an auditor, a customer's AP team or anyone else might. Reply with JSON only, with these fields:\nisPaperworkRequest: true or false.\nrequesterKind: one of \"auditor\", \"customer\", \"carrier\", \"other\".\ndocumentsAsked: what they ask for in a few words, such as \"POD and BOL\" or \"all paperwork\", or empty text.\nloads: a list of at most 25 entries, one per load they name. Each entry has asked (the number exactly as they wrote it), orderNumber, proNumber, billOfLading and reference. Fill only one of the last four: the load or order number if that is what they gave, otherwise the PRO number, otherwise the bill of lading number, otherwise their PO or shipment reference in reference. Leave the other three as empty text. Use an empty list when no load is named.\nNever guess a number that is not in the email."
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "From: "
              },
              {
                "id": "RESULT",
                "label": "Request email",
                "subPathSegments": [
                  {
                    "key": "from",
                    "optional": false
                  },
                  {
                    "key": "emailAddress",
                    "optional": false
                  },
                  {
                    "key": "name",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "F36BF6F3-F5DF-4E3B-807A-600C7C91F1A0"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": " <"
              },
              {
                "id": "RESULT",
                "label": "Request email",
                "subPathSegments": [
                  {
                    "key": "from",
                    "optional": false
                  },
                  {
                    "key": "emailAddress",
                    "optional": false
                  },
                  {
                    "key": "address",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "F36BF6F3-F5DF-4E3B-807A-600C7C91F1A0"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ">\nSubject: "
              },
              {
                "id": "RESULT",
                "label": "Request email",
                "subPathSegments": [
                  {
                    "key": "subject",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "F36BF6F3-F5DF-4E3B-807A-600C7C91F1A0"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\n"
              },
              {
                "id": "RESULT",
                "label": "Request email",
                "subPathSegments": [
                  {
                    "key": "body",
                    "optional": false
                  },
                  {
                    "key": "content",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "F36BF6F3-F5DF-4E3B-807A-600C7C91F1A0"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Read the request",
        "nextElementIds": [
          "49FDD434-7E15-44FB-BCCD-10C943182430"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves a SharePoint site by hostname and server-relative path.",
          "elementId": "EXTENSION:::SHARED:::default:::sharepoint:::getSiteByPath",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the SharePoint site Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::sharepoint:::getSiteByPath",
          "legacyElementId": "JS###v1###SharePointService###getSiteByPath",
          "methodName": "getSiteByPath",
          "position": {
            "x": 1126,
            "y": 520
          }
        },
        "flowElementId": "08E520AD-96A5-412D-96AA-6D9762CF15B9",
        "groupId": null,
        "id": "90BB0CBC-0D7D-498E-8A62-EA6B4EEE8CEC",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "hostname",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "SharePoint host name",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "SharePoint host name"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sitePath",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "SharePoint site path",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "SharePoint site path"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Find the SharePoint site', 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": "getSiteByPath",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Site",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "sharepoint",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the SharePoint site",
        "nextElementIds": [
          "F15B6FA9-651B-4A8E-959D-6D8030849706"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Work out its folder Result"
          },
          "position": {
            "x": 738,
            "y": 49
          }
        },
        "flowElementId": "77E6EF10-3B54-4736-B52A-7B8C6CCACE5D",
        "groupId": "CB87BF38-253F-474C-9B82-4DCC6C77305C",
        "id": "69472766-098D-4677-B9B6-ED9FB84C59AB",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "match",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "McLeod match",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "D956DA36-3459-4D97-9A71-38031BA62719"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "root",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Library",
                    "subPathSegments": [
                      {
                        "key": "archivePath",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "42BDD99A-D59A-4A6C-AF64-72015611A3FA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const clean = (s) => String(s == null ? '' : s).replace(/[\"*:<>?\\/\\\\|#%{}~&]/g, ' ').replace(/\\s+/g, ' ').trim().replace(/[. ]+$/, '');\nconst l = match && match.load ? match.load : {};\nconst cust = l.customer || {};\nconst customerFolder = clean(cust.name ? `${cust.name} (${cust.id})` : (cust.id || 'No customer')) || 'No customer';\nconst stops = Array.isArray(l.stops) ? l.stops : [];\nconst last = stops[stops.length - 1] || {};\nconst when = String(last.actualArrival || last.actualDeparture || last.scheduledArriveEarly || '');\nconst monthFolder = /^\\d{4}-\\d{2}/.test(when) ? when.slice(0, 7) : 'unknown';\nconst loadFolder = clean(l.orderId);\nreturn { loadPath: `${root}/${customerFolder}/${monthFolder}/${loadFolder}` };\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Folder path",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Work out its folder",
        "nextElementIds": [
          "E1EBA9F3-7DC2-473E-87D7-F8D82E3DA6DD"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Note this load Result"
          },
          "position": {
            "x": 122,
            "y": 219
          }
        },
        "flowElementId": "219FDDBC-2039-4751-839D-73B6820DDFA3",
        "groupId": "CB87BF38-253F-474C-9B82-4DCC6C77305C",
        "id": "4D31897E-D654-4838-A6F0-70B4EC95CE33",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "item",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "label": null,
                    "subPathSegments": null,
                    "type": "LIST_ITERATOR_CURRENT_ELEMENT",
                    "value": "CB87BF38-253F-474C-9B82-4DCC6C77305C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "match",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "McLeod match",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "D956DA36-3459-4D97-9A71-38031BA62719"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "path",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Folder path",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "69472766-098D-4677-B9B6-ED9FB84C59AB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "folder",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Load folder",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "E1EBA9F3-7DC2-473E-87D7-F8D82E3DA6DD"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "link",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Share link",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "396DCFE0-B421-4793-99E9-E6EEBCFAA49F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const it = item && typeof item === 'object' ? item : {};\nconst asked = String(it.asked || it.orderNumber || it.proNumber || it.billOfLading || it.reference || '').trim();\nconst found = Boolean(match && match.found === true);\nconst load = found && match.load ? match.load : {};\nif (!found) {\n  return { line: `Load ${asked}: no load with that number in McLeod. Check the number and answer this one by hand.\\n` };\n}\nconst refs = [load.poNumber && `PO ${load.poNumber}`, load.billOfLading && `BOL ${load.billOfLading}`].filter(Boolean).join(', ');\nconst head = `Load ${load.orderId}${asked && asked !== String(load.orderId) ? ` (asked as ${asked})` : ''}${refs ? `, ${refs}` : ''}`;\nconst count = folder && folder.folder && typeof folder.folder.childCount === 'number' ? folder.folder.childCount : null;\nconst url = link && link.link && link.link.webUrl ? link.link.webUrl : '';\nif (!url || count === 0) {\n  return { line: `${head}: found in McLeod, but its paperwork is not in the SharePoint archive (${path && path.loadPath ? path.loadPath : 'no folder'}). Answer this one by hand.\\n` };\n}\nreturn { line: `${head}: ${url}${count != null ? ` (${count} document${count === 1 ? '' : 's'})` : ''}\\n` };\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Load note",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Note this load",
        "nextElementIds": [
          "28BD44FC-E99A-4B7C-AE08-2B5F97CBDD42"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "F36BF6F3-F5DF-4E3B-807A-600C7C91F1A0",
    "groups": [
      {
        "clientMetadata": {
          "elementId": "list-iterator",
          "isFirstElement": false,
          "blockDefinitionId": "list-iterator",
          "viewport": {
            "x": -70,
            "y": 0,
            "zoom": 1
          },
          "position": {
            "x": 129,
            "y": 699
          }
        },
        "flowElementId": "477F1FCF-8BDB-426D-87DB-8D8D3CC8AA05",
        "groupId": null,
        "id": "CB87BF38-253F-474C-9B82-4DCC6C77305C",
        "loopType": "LIST_ITERATOR",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'For each load asked for', Error: Children have error",
            "valid": false
          },
          "enabled": true,
          "firstElementId": "D956DA36-3459-4D97-9A71-38031BA62719",
          "list": {
            "expression": [
              {
                "id": "ELEMENT_RESULT",
                "label": "Request",
                "subPathSegments": [
                  {
                    "key": "output",
                    "optional": false
                  },
                  {
                    "key": "loads",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "77D772F2-DEBA-4416-85AD-F4590A6CBC5B"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "onFailElemId": null,
          "resultAlias": "Each load",
          "storeResult": true
        },
        "name": "For each load asked for",
        "nextElementIds": [
          "6EC8CCD7-C7FE-41DA-9FC3-48FB5794D922"
        ],
        "nextGroupIds": [],
        "type": "LOOP"
      }
    ],
    "id": "D508D0AD-C13E-4D0B-8602-2D591CF36170",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": "Please fix problems before start. Blocks with issues have red badge in the top-right corner of a block, hover it to see what needs to be done.",
        "valid": false
      },
      "errorMessage": "Please fix problems before start. Blocks with issues have red badge in the top-right corner of a block, hover it to see what needs to be done.",
      "executionStaticData": [
        {
          "description": "The Anthropic key the AI agents read the request and draft the reply with.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "Your SharePoint host name, the part of a site's address before /sites.",
          "error": null,
          "name": "SharePoint host name",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The path of the SharePoint site that holds the load paperwork archive, such as /sites/Operations.",
          "error": null,
          "name": "SharePoint site path",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The name of the document library on that site, as SharePoint shows it.",
          "error": null,
          "name": "Document library",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "The archive folder in that library, by its path from the top of the library. It holds a folder per customer, then per delivery month, then per load.",
          "error": null,
          "name": "Archive folder",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "Who can open the links: anonymous (anyone with the link) or organization (people in your Microsoft 365 tenant only).",
          "error": null,
          "name": "Link scope",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "How many days each view link works.",
          "error": null,
          "name": "Link expires after days",
          "type": "INT",
          "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-29T02:51:26.268Z"
}
