{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "D714BA12-75D3-490A-A25F-202B059E14E8",
    "name": "QuickBooks Online: invoice with the POD attached"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -31.778140293637847,
        "y": 13.898858075040785,
        "zoom": 0.65
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When a Turvo load is marked ready to bill, creates the QuickBooks Online invoice with the load number in a custom field, attaches the signed POD so it goes out with the invoice, and sends it once the POD is signed, clean and for the same load. A mismatch, a missing signature or a shortage, overage, damage or refusal note goes to the billing lead in Slack.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When a Turvo load is marked ready to bill, creates the QuickBooks Online invoice with the load number in a custom field, attaches the signed POD so it goes out with the invoice, and sends it once the POD matches the load. A mismatch goes to the billing lead in Slack.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "external-callback",
          "isFirstElement": false,
          "blockDefinitionId": "external-callback",
          "position": {
            "x": 111,
            "y": 989
          }
        },
        "flowElementId": "B8A85877-DAA7-4E18-A6D4-44032F8D4278",
        "groupId": null,
        "id": "25792B67-BBCE-4D62-B24A-6326D9C6DDFF",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "resultAlias": "Billing decision",
          "slaConditions": [],
          "storeResult": true,
          "type": "CALLBACK"
        },
        "name": "Wait for the billing lead's answer",
        "nextElementIds": [
          "8E670663-02B1-4B64-969B-72940DB9BBC8"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Sends an invoice to the customer via email. Uses the customer's email address on file or a specified email address. QuickBooks Online generates and sends a professionally formatted email with the invoice details.",
          "elementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::sendInvoice",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Send the invoice Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::sendInvoice",
          "legacyElementId": "JS###v1###QuickBooksOnlineService###sendInvoice",
          "methodName": "sendInvoice",
          "position": {
            "x": 928,
            "y": 980
          }
        },
        "flowElementId": "29CFE1FE-6819-4565-802B-1990D5360B4B",
        "groupId": null,
        "id": "651333CC-6985-4356-9E52-3FB06A988948",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "invoiceId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "Invoice",
                        "optional": false
                      },
                      {
                        "key": "Id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "8915D5F2-D62B-42F5-BF1D-C9E4B14CBCC1"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "emailTo",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Send the invoice', 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": "sendInvoice",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Sent invoice",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "quickbooks-online",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Send the invoice",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 135,
            "y": 519
          }
        },
        "flowElementId": "EE51B5A4-D1F1-4287-B41C-36497E4D30D2",
        "groupId": null,
        "id": "2918033F-C33A-4542-ACFC-C40A4B90424C",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "087de184-f22a-420a-80b5-7f44028fe040",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "QuickBooks customer",
                      "subPathSegments": [
                        {
                          "key": "QueryResponse",
                          "optional": false
                        },
                        {
                          "key": "Customer",
                          "optional": false
                        },
                        {
                          "index": 0,
                          "last": false
                        },
                        {
                          "key": "Id",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "4B3A7517-C80B-4EEF-90CC-61D4CDDEAFAD"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "087de184-f22a-420a-80b5-7f44028fe040"
            ]
          },
          "elseComponent": {
            "componentId": "C63840FF-E956-4AD2-9C0C-06E0B21ABEE1",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Customer there",
          "storeResult": false,
          "thenComponent": {
            "componentId": "5A39AECA-BE98-4A18-81EA-6ACA89216061",
            "componentType": "ELEMENT"
          }
        },
        "name": "Customer in QuickBooks?",
        "nextElementIds": [
          "5A39AECA-BE98-4A18-81EA-6ACA89216061",
          "C63840FF-E956-4AD2-9C0C-06E0B21ABEE1"
        ],
        "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,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Tell billing the customer is missing Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 504,
            "y": 640
          }
        },
        "flowElementId": "21C11002-AB49-4653-A937-38A4D0F5A33E",
        "groupId": null,
        "id": "C63840FF-E956-4AD2-9C0C-06E0B21ABEE1",
        "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": "Load "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Turvo load",
                    "subPathSegments": [
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " is ready to bill, but QuickBooks has no customer named \""
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Turvo load",
                    "subPathSegments": [
                      {
                        "key": "customers",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "\", so no invoice was created. Add the customer in QuickBooks under the same name as in Turvo, then set the load to Ready for billing again."
                  }
                ],
                "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": "No customer message",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell billing the customer is missing",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Downloads a load's document (every file in it) into FlowRunner file storage and returns a link to each file, ready to email, archive or send to OCR.",
          "elementId": "EXTENSION:::SHARED:::default:::turvo:::downloadDocument",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Download the POD Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::turvo:::downloadDocument",
          "legacyElementId": null,
          "methodName": "downloadDocument",
          "position": {
            "x": 928,
            "y": 210
          }
        },
        "flowElementId": "2A707E5C-2D5A-4770-BF0F-A72D3B929647",
        "groupId": null,
        "id": "4879F66A-2BFA-4A8B-80D1-A2E6E3E322B0",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "loadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Ready to bill",
                    "subPathSegments": [
                      {
                        "key": "loadId",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "FA448A66-AC38-43BC-8C19-0233C8494A50"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Load documents",
                    "subPathSegments": [
                      {
                        "key": "documents",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "5C20FE90-D358-4C4C-8CEC-06C8B450505D"
                  }
                ],
                "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": "downloadDocument",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "POD file",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "turvo",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Download the POD",
        "nextElementIds": [
          "AA99C1A6-2EB4-4C9B-9D69-1A0DFC33EA81"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the POD Result"
          },
          "tools": {},
          "position": {
            "x": 551,
            "y": 219
          }
        },
        "flowElementId": "C84ED5F2-A4EE-48BC-93A2-846AE52FF3DC",
        "groupId": null,
        "id": "AA99C1A6-2EB4-4C9B-9D69-1A0DFC33EA81",
        "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": "POD file",
                    "subPathSegments": [
                      {
                        "key": "fileType",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4879F66A-2BFA-4A8B-80D1-A2E6E3E322B0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "STRING"
              },
              "url": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD file",
                    "subPathSegments": [
                      {
                        "key": "fileUrl",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4879F66A-2BFA-4A8B-80D1-A2E6E3E322B0"
                  }
                ],
                "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": "POD reading",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You check proofs of delivery (PODs) before a customer invoice goes out. The user message gives the load number the invoice is for. Read the attached POD and reply with JSON only, with these fields:\nloadNumber: the load number printed on the POD, or empty text if there is none\nmatchesLoad: true only if the load number on the POD is the same as the given load number, ignoring spaces, dashes and letter case; false otherwise, including when the POD shows no load number\nsigned: true if the consignee signed the POD, false if the signature line is blank\nnotes: any shortage, overage, damage or refusal written on the POD, in one sentence; empty text if the POD is clean"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Load number on the invoice: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Turvo load",
                "subPathSegments": [
                  {
                    "key": "loadNumber",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nCustomer: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Turvo load",
                "subPathSegments": [
                  {
                    "key": "customers",
                    "optional": false
                  },
                  {
                    "index": 0,
                    "last": false
                  },
                  {
                    "key": "name",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nDelivered at: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Turvo load",
                "subPathSegments": [
                  {
                    "key": "stops",
                    "optional": false
                  },
                  {
                    "index": null,
                    "last": true
                  },
                  {
                    "key": "name",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ", "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Turvo load",
                "subPathSegments": [
                  {
                    "key": "stops",
                    "optional": false
                  },
                  {
                    "index": null,
                    "last": true
                  },
                  {
                    "key": "city",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ", "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Turvo load",
                "subPathSegments": [
                  {
                    "key": "stops",
                    "optional": false
                  },
                  {
                    "index": null,
                    "last": true
                  },
                  {
                    "key": "state",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Read the POD",
        "nextElementIds": [
          "4B3A7517-C80B-4EEF-90CC-61D4CDDEAFAD"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Fires when a load's status changes in Turvo (e.g. Delivered or Ready for billing). Setup is manual: copy this trigger's callback URL into Turvo Admin Console → API & Webhooks as a Webhooks V2 subscription with the SHIPMENT_STATUS_UPDATE event.",
          "elementId": "EXTENSION:::SHARED:::default:::turvo:::onLoadStatusChanged",
          "isFirstElement": true,
          "blockDefinitionId": "api-service-trigger",
          "newElementId": "EXTENSION:::SHARED:::default:::turvo:::onLoadStatusChanged",
          "legacyElementId": null,
          "methodName": "onLoadStatusChanged",
          "position": {
            "x": 153,
            "y": 40
          }
        },
        "flowElementId": "F26ECF8A-9A55-4A84-8B57-4481FF080BF9",
        "groupId": null,
        "id": "FA448A66-AC38-43BC-8C19-0233C8494A50",
        "metaInfo": {
          "callbackUrl": null,
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "connectionId": null,
          "eventName": "onLoadStatusChanged",
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Ready to bill",
          "scope": "SINGLE_APP",
          "serviceId": "turvo",
          "slaConditions": [],
          "staticData": {
            "status": "2108"
          },
          "storeResult": true,
          "subtype": "REALTIME",
          "type": "CUSTOM"
        },
        "name": "Load ready to bill",
        "nextElementIds": [
          "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Queries customers in QuickBooks Online with optional search filtering. Search matches against the DisplayName field. Results are paginated and sorted by DisplayName.",
          "elementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::listCustomers",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the customer in QuickBooks Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::listCustomers",
          "legacyElementId": "JS###v1###QuickBooksOnlineService###listCustomers",
          "methodName": "listCustomers",
          "position": {
            "x": 110,
            "y": 210
          }
        },
        "flowElementId": "77DF74BF-4631-4691-B15C-58AB50F411B9",
        "groupId": null,
        "id": "4B3A7517-C80B-4EEF-90CC-61D4CDDEAFAD",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "search",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Turvo load",
                    "subPathSegments": [
                      {
                        "key": "customers",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "maxResults",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 5
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "startPosition",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Find the customer in QuickBooks', 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": "listCustomers",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "QuickBooks customer",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "quickbooks-online",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the customer in QuickBooks",
        "nextElementIds": [
          "2918033F-C33A-4542-ACFC-C40A4B90424C"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Gets one load by its Turvo ID: status, pickup and delivery dates, the delivered timestamp, every stop with its appointment and actual arrival and departure, every carrier with its dispatcher and driver contact, every customer, the users assigned to the load (role, email, phone; the first one as the assigned rep) and the customer account's owner, plus the full Turvo record. For a canceled load, also when it was canceled, by whom, the reason and the note.",
          "elementId": "EXTENSION:::SHARED:::default:::turvo:::getLoad",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Get the load Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::turvo:::getLoad",
          "legacyElementId": null,
          "methodName": "getLoad",
          "position": {
            "x": 551,
            "y": 40
          }
        },
        "flowElementId": "9D355939-7DA8-49BC-9D9D-574ED0232A27",
        "groupId": null,
        "id": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "loadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Ready to bill",
                    "subPathSegments": [
                      {
                        "key": "loadId",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "FA448A66-AC38-43BC-8C19-0233C8494A50"
                  }
                ],
                "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": "getLoad",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Turvo load",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "turvo",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Get the load",
        "nextElementIds": [
          "264C0C28-DCC8-427A-A0BA-D45423326B51"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Attaches a file, such as a proof of delivery or a signed timesheet, to an existing invoice in QuickBooks Online. The file is downloaded from the given URL (for example a FlowRunner file URL from an earlier step) and uploaded as an attachment linked to the invoice. Turn on Include When Sending to email it with the invoice. Returns the created attachment.",
          "elementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::attachFileToInvoice",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Attach the POD to the invoice Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::attachFileToInvoice",
          "legacyElementId": "JS###v1###QuickBooksOnlineService###attachFileToInvoice",
          "methodName": "attachFileToInvoice",
          "position": {
            "x": 1249,
            "y": 810
          }
        },
        "flowElementId": "311B6265-6F86-4557-B2B1-479D5C5C7BCE",
        "groupId": null,
        "id": "CF218EDD-77F9-4DFF-9A1A-A0B1A694001E",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "invoiceId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "Invoice",
                        "optional": false
                      },
                      {
                        "key": "Id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "8915D5F2-D62B-42F5-BF1D-C9E4B14CBCC1"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileUrl",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD file",
                    "subPathSegments": [
                      {
                        "key": "fileUrl",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4879F66A-2BFA-4A8B-80D1-A2E6E3E322B0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD file",
                    "subPathSegments": [
                      {
                        "key": "fileName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4879F66A-2BFA-4A8B-80D1-A2E6E3E322B0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "contentType",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "note",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Signed POD for load "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Turvo load",
                    "subPathSegments": [
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ", from Turvo"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "includeOnSend",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_TRUE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": true
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Attach the POD to the invoice', 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": "attachFileToInvoice",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "POD attachment",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "quickbooks-online",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Attach the POD to the invoice",
        "nextElementIds": [
          "5D7303C1-ACE3-4EDD-8530-69B4AF4229A2"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1280,
            "y": 219
          }
        },
        "flowElementId": "2C0D88D5-387F-4196-A83A-C217C37565FC",
        "groupId": null,
        "id": "FB056795-5CA3-43F0-8DA4-E1DFD2171F7E",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "1bffc26d-b1d0-4bda-a108-73341d25bb49",
                "nestedOperation": null,
                "operation": "arrayIsNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Load documents",
                      "subPathSegments": [
                        {
                          "key": "documents",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "5C20FE90-D358-4C4C-8CEC-06C8B450505D"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "ARRAY",
                "values": []
              }
            ],
            "grouping": [
              "1bffc26d-b1d0-4bda-a108-73341d25bb49"
            ]
          },
          "elseComponent": {
            "componentId": "3A4AFE9F-0F59-4A59-B9BD-8278F4175DDB",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "POD there",
          "storeResult": false,
          "thenComponent": {
            "componentId": "4879F66A-2BFA-4A8B-80D1-A2E6E3E322B0",
            "componentType": "ELEMENT"
          }
        },
        "name": "POD on the load?",
        "nextElementIds": [
          "4879F66A-2BFA-4A8B-80D1-A2E6E3E322B0",
          "3A4AFE9F-0F59-4A59-B9BD-8278F4175DDB"
        ],
        "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,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Confirm the invoice is held Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 907,
            "y": 1110
          }
        },
        "flowElementId": "D81060CB-32A4-47C1-AB22-4DE88C35266E",
        "groupId": null,
        "id": "B685A754-B788-4407-A632-970CFD0160C3",
        "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": "The invoice for load "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Turvo load",
                    "subPathSegments": [
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " is on hold in QuickBooks. It was not sent to the customer."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to billing lead",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "756BBED1-DF5E-40A5-AE46-E7D5B95165E7"
                  }
                ],
                "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": "Held message",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the invoice is held",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 910,
            "y": 819
          }
        },
        "flowElementId": "5C094E07-CCDA-405A-A008-639BE6611463",
        "groupId": null,
        "id": "5D7303C1-ACE3-4EDD-8530-69B4AF4229A2",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "5018916e-5167-48cf-991d-f6160c82d086",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "POD reading",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "matchesLoad",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "AA99C1A6-2EB4-4C9B-9D69-1A0DFC33EA81"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              },
              {
                "id": "01f25fc1-9d28-42e1-ac47-a6fa62630843",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "POD reading",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "signed",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "AA99C1A6-2EB4-4C9B-9D69-1A0DFC33EA81"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              },
              {
                "id": "1929b6f3-5c9a-4d75-8aa9-fbf84cdd6972",
                "nestedOperation": null,
                "operation": "isEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "POD reading",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "notes",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "AA99C1A6-2EB4-4C9B-9D69-1A0DFC33EA81"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "5018916e-5167-48cf-991d-f6160c82d086",
              "AND",
              "01f25fc1-9d28-42e1-ac47-a6fa62630843",
              "AND",
              "1929b6f3-5c9a-4d75-8aa9-fbf84cdd6972"
            ]
          },
          "elseComponent": {
            "componentId": "E31F7B16-FFBA-4CDD-9B0A-9F882EC433CF",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "POD matches",
          "storeResult": false,
          "thenComponent": {
            "componentId": "651333CC-6985-4356-9E52-3FB06A988948",
            "componentType": "ELEMENT"
          }
        },
        "name": "POD clean and matching?",
        "nextElementIds": [
          "651333CC-6985-4356-9E52-3FB06A988948",
          "E31F7B16-FFBA-4CDD-9B0A-9F882EC433CF"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the question for the billing lead Result"
          },
          "position": {
            "x": 495,
            "y": 819
          }
        },
        "flowElementId": "0154FA6C-F936-4DB5-9148-92B6CC086A86",
        "groupId": null,
        "id": "E31F7B16-FFBA-4CDD-9B0A-9F882EC433CF",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Turvo load",
                    "subPathSegments": [
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customer",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "QuickBooks customer",
                    "subPathSegments": [
                      {
                        "key": "QueryResponse",
                        "optional": false
                      },
                      {
                        "key": "Customer",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "DisplayName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4B3A7517-C80B-4EEF-90CC-61D4CDDEAFAD"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "total",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice",
                    "subPathSegments": [
                      {
                        "key": "Invoice",
                        "optional": false
                      },
                      {
                        "key": "TotalAmt",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "8915D5F2-D62B-42F5-BF1D-C9E4B14CBCC1"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "podLoadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "AA99C1A6-2EB4-4C9B-9D69-1A0DFC33EA81"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "matchesLoad",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "matchesLoad",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "AA99C1A6-2EB4-4C9B-9D69-1A0DFC33EA81"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "signed",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "signed",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "AA99C1A6-2EB4-4C9B-9D69-1A0DFC33EA81"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "notes",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "notes",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "AA99C1A6-2EB4-4C9B-9D69-1A0DFC33EA81"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "podUrl",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD file",
                    "subPathSegments": [
                      {
                        "key": "fileUrl",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4879F66A-2BFA-4A8B-80D1-A2E6E3E322B0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "answerLink",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Answer link",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Answer link"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "executionId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_ID",
                    "label": null,
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.executionId",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "executionId",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const link = (decision) => `${answerLink}?execution=${encodeURIComponent(executionId)}&decision=${decision}`;\nconst problems = [];\nif (!matchesLoad) problems.push(podLoadNumber ? `The POD shows load ${podLoadNumber}, not ${loadNumber}.` : 'No load number could be read on the POD.');\nif (!signed) problems.push('The POD is not signed.');\nconst lines = [\n  `*The invoice for load ${loadNumber} is created but not sent*`,\n  `Customer: ${customer}`,\n  `Total: $${Number(total || 0).toFixed(2)}`,\n  ...problems,\n  notes ? `Noted on the POD: ${notes}` : null,\n  `The POD is attached to the invoice in QuickBooks and goes out with it. If it is the wrong POD, replace it on the invoice before you send. <${podUrl}|Open the POD>`,\n].filter(Boolean);\nreturn {\n  text: `The invoice for load ${loadNumber} needs a look before it goes out`,\n  blocks: [\n    { type: 'section', text: { type: 'mrkdwn', text: lines.join('\\n') } },\n    { type: 'actions', elements: [\n      { type: 'button', style: 'primary', text: { type: 'plain_text', text: 'Send the invoice' }, url: link('send') },\n      { type: 'button', text: { type: 'plain_text', text: 'Hold it' }, url: link('hold') },\n    ] },\n  ],\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Question card",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the question for the billing lead",
        "nextElementIds": [
          "756BBED1-DF5E-40A5-AE46-E7D5B95165E7"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Creates a new invoice in QuickBooks Online for a specified customer. Line items define the products or services being invoiced. Each line item should include an ItemRef (from the Items dictionary), UnitPrice, and Qty.",
          "elementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::createInvoice",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Create the invoice Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::createInvoice",
          "legacyElementId": "JS###v1###QuickBooksOnlineService###createInvoice",
          "methodName": "createInvoice",
          "position": {
            "x": 1280,
            "y": 510
          }
        },
        "flowElementId": "C9344EFD-74D3-4108-8157-CEAAA0015752",
        "groupId": null,
        "id": "8915D5F2-D62B-42F5-BF1D-C9E4B14CBCC1",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "customerId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "QuickBooks customer",
                    "subPathSegments": [
                      {
                        "key": "QueryResponse",
                        "optional": false
                      },
                      {
                        "key": "Customer",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "Id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4B3A7517-C80B-4EEF-90CC-61D4CDDEAFAD"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "lineItems",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice lines",
                    "subPathSegments": [
                      {
                        "key": "lines",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2E14EDCD-64BF-4037-BD1B-EC9B09EA33FA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dueDate",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "txnDate",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "privateNote",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Created from Turvo load "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Turvo load",
                    "subPathSegments": [
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " when it was marked ready to bill."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "docNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customerMemo",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Load "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Turvo load",
                    "subPathSegments": [
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ", "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Turvo load",
                    "subPathSegments": [
                      {
                        "key": "stops",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "city",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ", "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Turvo load",
                    "subPathSegments": [
                      {
                        "key": "stops",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "state",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " to "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Turvo load",
                    "subPathSegments": [
                      {
                        "key": "stops",
                        "optional": false
                      },
                      {
                        "index": null,
                        "last": true
                      },
                      {
                        "key": "city",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ", "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Turvo load",
                    "subPathSegments": [
                      {
                        "key": "stops",
                        "optional": false
                      },
                      {
                        "index": null,
                        "last": true
                      },
                      {
                        "key": "state",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ". The signed proof of delivery is attached."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customFieldId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customFieldValue",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Turvo load",
                    "subPathSegments": [
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Create the invoice', 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": "createInvoice",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Invoice",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "quickbooks-online",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Create the invoice",
        "nextElementIds": [
          "CF218EDD-77F9-4DFF-9A1A-A0B1A694001E"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Ask the billing lead Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 153,
            "y": 810
          }
        },
        "flowElementId": "AFA430BA-E861-4CC0-AD64-CB90CD818CF4",
        "groupId": null,
        "id": "756BBED1-DF5E-40A5-AE46-E7D5B95165E7",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E31F7B16-FFBA-4CDD-9B0A-9F882EC433CF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "blocks",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E31F7B16-FFBA-4CDD-9B0A-9F882EC433CF"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Question to billing lead",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask the billing lead",
        "nextElementIds": [
          "25792B67-BBCE-4D62-B24A-6326D9C6DDFF"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Lists the documents attached to a load (rate confirmations, BOLs, PODs, invoices) with their type, status and file names.",
          "elementId": "EXTENSION:::SHARED:::default:::turvo:::listLoadDocuments",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the POD on the load Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::turvo:::listLoadDocuments",
          "legacyElementId": null,
          "methodName": "listLoadDocuments",
          "position": {
            "x": 1265,
            "y": 40
          }
        },
        "flowElementId": "5786267D-9D68-46F5-A41D-7C0826EF3F60",
        "groupId": null,
        "id": "5C20FE90-D358-4C4C-8CEC-06C8B450505D",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "loadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Ready to bill",
                    "subPathSegments": [
                      {
                        "key": "loadId",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "FA448A66-AC38-43BC-8C19-0233C8494A50"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "documentType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "3010"
                  }
                ],
                "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": "listLoadDocuments",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Load documents",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "turvo",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the POD on the load",
        "nextElementIds": [
          "FB056795-5CA3-43F0-8DA4-E1DFD2171F7E"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Tell billing there's no POD Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 910,
            "y": 340
          }
        },
        "flowElementId": "E5704C99-A8B3-4106-BA70-DBE6899D0BA3",
        "groupId": null,
        "id": "3A4AFE9F-0F59-4A59-B9BD-8278F4175DDB",
        "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": "Load "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Turvo load",
                    "subPathSegments": [
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " for "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Turvo load",
                    "subPathSegments": [
                      {
                        "key": "customers",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " is ready to bill in Turvo, but there is no POD on it, so no invoice was created. Add the POD to the load in Turvo and set it to Ready for billing again."
                  }
                ],
                "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": "No POD message",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell billing there's no POD",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 551,
            "y": 989
          }
        },
        "flowElementId": "DD003BAC-71FB-4169-9232-6009F9FC6B13",
        "groupId": null,
        "id": "8E670663-02B1-4B64-969B-72940DB9BBC8",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "62bebc04-a4e8-4feb-a4af-c365b99962b7",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "RESULT",
                      "label": "Billing decision",
                      "subPathSegments": [
                        {
                          "key": "decision",
                          "optional": false
                        }
                      ],
                      "type": "TRIGGER_DATA",
                      "value": "25792B67-BBCE-4D62-B24A-6326D9C6DDFF"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "send"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "62bebc04-a4e8-4feb-a4af-c365b99962b7"
            ]
          },
          "elseComponent": {
            "componentId": "B685A754-B788-4407-A632-970CFD0160C3",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Send it",
          "storeResult": false,
          "thenComponent": {
            "componentId": "651333CC-6985-4356-9E52-3FB06A988948",
            "componentType": "ELEMENT"
          }
        },
        "name": "Send it?",
        "nextElementIds": [
          "B685A754-B788-4407-A632-970CFD0160C3",
          "651333CC-6985-4356-9E52-3FB06A988948"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Gets what the customer is billed on a load: total, subtotal, tax, currency and every line item, plus linehaul, fuel, detention, lumper, TONU, layover and all-accessorial totals. Deleted lines are left out.",
          "elementId": "EXTENSION:::SHARED:::default:::turvo:::getCustomerCharges",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Get the customer charges Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::turvo:::getCustomerCharges",
          "legacyElementId": null,
          "methodName": "getCustomerCharges",
          "position": {
            "x": 909,
            "y": 40
          }
        },
        "flowElementId": "0A71B766-3998-467B-9DE6-CDB5BC0E6AEC",
        "groupId": null,
        "id": "264C0C28-DCC8-427A-A0BA-D45423326B51",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "loadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Ready to bill",
                    "subPathSegments": [
                      {
                        "key": "loadId",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "FA448A66-AC38-43BC-8C19-0233C8494A50"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customerOrderId",
              "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": "getCustomerCharges",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Customer charges",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "turvo",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Get the customer charges",
        "nextElementIds": [
          "5C20FE90-D358-4C4C-8CEC-06C8B450505D"
        ],
        "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 invoice lines Result"
          },
          "position": {
            "x": 922,
            "y": 519
          }
        },
        "flowElementId": "CA89AB4F-D73D-4308-BC4D-70524CAEE27A",
        "groupId": null,
        "id": "2E14EDCD-64BF-4037-BD1B-EC9B09EA33FA",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "charges",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Customer charges",
                    "subPathSegments": [
                      {
                        "key": "lineItems",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "264C0C28-DCC8-427A-A0BA-D45423326B51"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Turvo load",
                    "subPathSegments": [
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A19CB86C-9AB5-4B59-B8F0-A7AA8B8BD89C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "items",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "QuickBooks items",
                    "subPathSegments": [
                      {
                        "key": "QueryResponse",
                        "optional": false
                      },
                      {
                        "key": "Item",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "5A39AECA-BE98-4A18-81EA-6ACA89216061"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "freightItemName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Freight item name",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Freight item name"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "accessorialItemName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Accessorial item name",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Accessorial item name"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const toNum = (v) => Number(v) || 0;\nconst findItem = (name) => {\n  const wanted = String(name || '').trim().toLowerCase();\n  const item = (items || []).find((i) => String(i.Name || '').toLowerCase() === wanted)\n    || (items || []).find((i) => String(i.Name || '').toLowerCase().includes(wanted));\n  if (!item) throw new Error(`QuickBooks has no product or service named \"${name}\". Set the right name in the flow settings.`);\n  return String(item.Id);\n};\nconst freightItem = findItem(freightItemName);\nconst accessorialItem = findItem(accessorialItemName);\nconst accessorial = /detention|lumper|tonu|truck order not used|layover|accessorial|stop.?off|driver assist/i;\nconst lines = (charges || []).filter((c) => toNum(c.amount) !== 0).map((c) => {\n  const amount = Math.round(toNum(c.amount) * 100) / 100;\n  const qty = toNum(c.qty) || 1;\n  const price = toNum(c.price);\n  const even = Math.abs(qty * price - amount) < 0.005;\n  return {\n    DetailType: 'SalesItemLineDetail',\n    Amount: amount,\n    Description: [c.codeName, c.notes].filter(Boolean).join(', ') + ' (load ' + loadNumber + ')',\n    SalesItemLineDetail: {\n      ItemRef: { value: accessorial.test(c.codeName || '') ? accessorialItem : freightItem },\n      Qty: even ? qty : 1,\n      UnitPrice: even ? price : amount,\n    },\n  };\n});\nif (!lines.length) throw new Error('Turvo has no customer charges on load ' + loadNumber + '.');\nreturn { lines, total: Math.round(lines.reduce((sum, l) => sum + l.Amount, 0) * 100) / 100 };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Invoice lines",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the invoice lines",
        "nextElementIds": [
          "8915D5F2-D62B-42F5-BF1D-C9E4B14CBCC1"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Queries items in QuickBooks Online with optional filtering by name and type. Results are paginated and sorted by name. Use this to browse your product and service catalog.",
          "elementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::listItems",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the billing items Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::quickbooks-online:::listItems",
          "legacyElementId": "JS###v1###QuickBooksOnlineService###listItems",
          "methodName": "listItems",
          "position": {
            "x": 550,
            "y": 510
          }
        },
        "flowElementId": "E74DC721-CFD0-4B0E-A09E-5A97EB0A40D2",
        "groupId": null,
        "id": "5A39AECA-BE98-4A18-81EA-6ACA89216061",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "search",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "type",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "maxResults",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 1000
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "startPosition",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Find the billing items', 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": "listItems",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "QuickBooks items",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "quickbooks-online",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the billing items",
        "nextElementIds": [
          "2E14EDCD-64BF-4037-BD1B-EC9B09EA33FA"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "FA448A66-AC38-43BC-8C19-0233C8494A50",
    "groups": [],
    "id": "878D96AA-A383-474A-8EEC-F50D06DFF839",
    "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 step uses to read the POD.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "The URL of the block Wait for the billing lead's answer. The Slack buttons open it.",
          "error": null,
          "name": "Answer link",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "Name of the QuickBooks product or service that linehaul and fuel lines are billed under. Change it to match your QuickBooks.",
          "error": null,
          "name": "Freight item name",
          "type": "STRING",
          "value": ""
        },
        {
          "description": "Name of the QuickBooks product or service that detention, lumper, TONU and layover lines are billed under. Change it to match your QuickBooks.",
          "error": null,
          "name": "Accessorial item name",
          "type": "STRING",
          "value": ""
        }
      ],
      "initialData": null,
      "initialDataDefaultValues": {},
      "ownerFlowVersionId": null,
      "schedule": null,
      "sharedMemory": {
        "anchor": {
          "missingAnchorPolicy": null,
          "path": null,
          "type": "FLOW_MEMORY"
        },
        "expirationInSec": null
      },
      "wasLive": false
    }
  },
  "slaCalendars": [],
  "slaGoals": [],
  "subFlows": [],
  "exportDate": "2026-11-19T06:32:58.557Z"
}
