{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "84693A17-5BF3-45F1-91D1-740A171A5725",
    "name": "NetSuite: emailed POD to customer invoice"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -45.176991150442475,
        "y": 9.02654867256637,
        "zoom": 0.77
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When a POD reaches the mailbox in Outlook, reads it, finds the NetSuite sales order for that load and creates the customer invoice from its lines. A POD with no signature, a shortage or damage goes to billing in Slack first.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When a POD reaches the mailbox in Outlook, reads it, finds the NetSuite sales order for that load and creates the customer invoice from its lines. A POD with no signature, a shortage or damage goes to billing in Slack first.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "external-callback",
          "isFirstElement": false,
          "blockDefinitionId": "external-callback",
          "position": {
            "x": 891,
            "y": 519
          }
        },
        "flowElementId": "0E72D0BD-25E9-4635-8E06-09E094622347",
        "groupId": null,
        "id": "297B4DC1-0DDC-44C4-8EEF-D97B7258ACE5",
        "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 billing's answer",
        "nextElementIds": [
          "9F2AEA3E-1CD7-475D-9C3F-610ADB9A64EA"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the question for billing Result"
          },
          "position": {
            "x": 121,
            "y": 519
          }
        },
        "flowElementId": "CA914454-0BA6-4FD5-AD8D-3EE61C9E07B4",
        "groupId": null,
        "id": "08B901A7-0E7C-47C8-963D-86D29C3032FC",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D95C407-6E1E-497F-9812-361EFD009053"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customerName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice lines",
                    "subPathSegments": [
                      {
                        "key": "customerName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3E607881-CD12-443A-B20A-DCA7B2928BC5"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "salesOrderNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice lines",
                    "subPathSegments": [
                      {
                        "key": "salesOrderNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3E607881-CD12-443A-B20A-DCA7B2928BC5"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "total",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice lines",
                    "subPathSegments": [
                      {
                        "key": "total",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3E607881-CD12-443A-B20A-DCA7B2928BC5"
                  }
                ],
                "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": "7D95C407-6E1E-497F-9812-361EFD009053"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "exceptions",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "exceptions",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D95C407-6E1E-497F-9812-361EFD009053"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "podUrl",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD file",
                    "subPathSegments": [
                      {
                        "key": "files",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "url",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D6B35A7-F7F1-40D5-BE70-ECFA37F09C20"
                  }
                ],
                "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 money = (n) => Number(n || 0).toLocaleString('en-US', { style: 'currency', currency: 'USD' });\nconst lines = [\n  `*POD for load ${loadNumber} needs a look before the customer is invoiced*`,\n  `Customer: ${customerName}, sales order ${salesOrderNumber}, ${money(total)}`,\n  signed ? 'Signed: yes' : 'Signed: *no signature on the POD*',\n  exceptions ? `Noted on the POD: ${exceptions}` : null,\n  `<${podUrl}|Open the POD>`,\n].filter(Boolean);\nreturn {\n  text: `POD for load ${loadNumber} needs a look before invoicing`,\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: 'Invoice the customer' }, url: link('bill') },\n      { type: 'button', text: { type: 'plain_text', text: 'Hold the load' }, 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 billing",
        "nextElementIds": [
          "5DE74EC1-6FBB-42A8-8F04-3A135EAB7731"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Downloads the file attachments of an email message into FlowRunner file storage and returns a link to each saved file. Choose one attachment, or leave it empty to save every file attachment. Attached Outlook items (emails, events, contacts) and links to cloud files have no file to save and are listed as skipped. A stored file with the same name is replaced.",
          "elementId": "EXTENSION:::SHARED:::default:::outlook:::saveAttachment",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Save the POD file Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::outlook:::saveAttachment",
          "legacyElementId": "JS###v1###OutlookService###saveAttachment",
          "methodName": "saveAttachment",
          "position": {
            "x": 539,
            "y": 40
          }
        },
        "flowElementId": "56BCA7C3-BDE2-44EC-B03D-8D5907FDC43C",
        "groupId": null,
        "id": "7D6B35A7-F7F1-40D5-BE70-ECFA37F09C20",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "messageId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "POD email",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "BA4D894A-0096-4DAD-B071-EDFC72C06F43"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachmentId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "includeInline",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Save the POD file', 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": "saveAttachment",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "POD file",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "outlook",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Save the POD file",
        "nextElementIds": [
          "7D95C407-6E1E-497F-9812-361EFD009053"
        ],
        "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": "Confirm the load is held Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1615,
            "y": 510
          }
        },
        "flowElementId": "7562C593-6FEB-4A76-82BF-753F82C66224",
        "groupId": null,
        "id": "13D97D4D-647A-4007-9C05-5668915B6F45",
        "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": "Held. Load "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D95C407-6E1E-497F-9812-361EFD009053"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " is not invoiced in NetSuite."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to billing",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "5DE74EC1-6FBB-42A8-8F04-3A135EAB7731"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "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": "EXPRESSION",
                "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": "Hold note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the load is held",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Executes a custom SuiteQL query against the NetSuite database. SuiteQL is a SQL-like query language for querying NetSuite records. Use this for advanced queries not covered by other methods.",
          "elementId": "EXTENSION:::SHARED:::default:::netsuite:::runSuiteQL",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the sales order for the load Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::netsuite:::runSuiteQL",
          "legacyElementId": "JS###v1###NetSuiteService###runSuiteQL",
          "methodName": "runSuiteQL",
          "position": {
            "x": 1227,
            "y": 40
          }
        },
        "flowElementId": "324B9EFE-A3F0-4BC7-975F-D489C1650DC5",
        "groupId": null,
        "id": "3F2B6E05-15B0-451C-96C8-2458E3C29223",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "query",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "SELECT t.id AS salesorderid, t.tranid, t.entity, BUILTIN.DF(t.entity) AS customername, t.otherrefnum, BUILTIN.DF(t.status) AS status, tl.item, ABS(tl.quantity) AS quantity, tl.rate, ABS(tl.netamount) AS amount FROM transaction t JOIN transactionline tl ON tl.transaction = t.id WHERE t.type = 'SalesOrd' AND tl.mainline = 'F' AND tl.taxline = 'F' AND tl.item IS NOT NULL AND (t.otherrefnum = '"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D95C407-6E1E-497F-9812-361EFD009053"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "' OR t.tranid = '"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D95C407-6E1E-497F-9812-361EFD009053"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "') ORDER BY t.id DESC, tl.linesequencenumber"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "limit",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 50
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "offset",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Find the sales order for the load', 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": "runSuiteQL",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Sales order lines",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "netsuite",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the sales order for the load",
        "nextElementIds": [
          "3E9B046F-F43B-43A0-AAAC-0400636441A6"
        ],
        "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": 904,
            "y": 49
          }
        },
        "flowElementId": "A0E47362-6169-4337-B10D-763807FDEC63",
        "groupId": null,
        "id": "7D95C407-6E1E-497F-9812-361EFD009053",
        "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": "files",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "contentType",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D6B35A7-F7F1-40D5-BE70-ECFA37F09C20"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "STRING"
              },
              "url": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD file",
                    "subPathSegments": [
                      {
                        "key": "files",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "url",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D6B35A7-F7F1-40D5-BE70-ECFA37F09C20"
                  }
                ],
                "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 read proof of delivery documents (PODs) for truckload and LTL freight. From the attached POD, reply with JSON only, with these fields:\nloadNumber: the load number printed on the POD, letters, digits and dashes only; empty text if there is none\nproNumber: the PRO number, or empty text\nbolNumber: the bill of lading number, or empty text\ndeliveryDate: the delivery date as YYYY-MM-DD, or empty text\nsigned: true if the consignee signed the POD, false if the signature line is blank\nexceptions: 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": "Email from "
              },
              {
                "id": "RESULT",
                "label": "POD email",
                "subPathSegments": [
                  {
                    "key": "from",
                    "optional": false
                  },
                  {
                    "key": "emailAddress",
                    "optional": false
                  },
                  {
                    "key": "address",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "BA4D894A-0096-4DAD-B071-EDFC72C06F43"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nSubject: "
              },
              {
                "id": "RESULT",
                "label": "POD email",
                "subPathSegments": [
                  {
                    "key": "subject",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "BA4D894A-0096-4DAD-B071-EDFC72C06F43"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\n"
              },
              {
                "id": "RESULT",
                "label": "POD email",
                "subPathSegments": [
                  {
                    "key": "body",
                    "optional": false
                  },
                  {
                    "key": "content",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "BA4D894A-0096-4DAD-B071-EDFC72C06F43"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Read the POD",
        "nextElementIds": [
          "3F2B6E05-15B0-451C-96C8-2458E3C29223"
        ],
        "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 billing Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 539,
            "y": 510
          }
        },
        "flowElementId": "53BE0128-0854-4461-95B2-97F81CF866DB",
        "groupId": null,
        "id": "5DE74EC1-6FBB-42A8-8F04-3A135EAB7731",
        "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": "08B901A7-0E7C-47C8-963D-86D29C3032FC"
                  }
                ],
                "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": "EXPRESSION",
                "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": "EXPRESSION",
                "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": "08B901A7-0E7C-47C8-963D-86D29C3032FC"
                  }
                ],
                "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",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask billing",
        "nextElementIds": [
          "297B4DC1-0DDC-44C4-8EEF-D97B7258ACE5"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Build the invoice lines Result"
          },
          "position": {
            "x": 899,
            "y": 349
          }
        },
        "flowElementId": "43D029BE-5472-4C26-8D1D-71697F44B673",
        "groupId": null,
        "id": "3E607881-CD12-443A-B20A-DCA7B2928BC5",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "soLines",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Sales order lines",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "3F2B6E05-15B0-451C-96C8-2458E3C29223"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "existing",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Existing invoices",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "3E9B046F-F43B-43A0-AAAC-0400636441A6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D95C407-6E1E-497F-9812-361EFD009053"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const rows = (soLines && soLines.items) || [];\nconst invoiced = (existing && existing.totalResults) || 0;\nif (!loadNumber) return { ready: false, reason: 'The POD shows no load number.' };\nif (!rows.length) return { ready: false, reason: `No sales order in NetSuite has load ${loadNumber} as its number or PO/reference number.` };\nconst soId = rows[0].salesorderid;\nconst mine = rows.filter(r => r.salesorderid === soId);\nconst order = mine[0];\nconst status = String(order.status || '');\nif (/\\bbilled\\b|closed|cancel/i.test(status)) return { ready: false, reason: `Sales order ${order.tranid} for load ${loadNumber} is already ${status}.` };\nif (invoiced > 0) return { ready: false, reason: `An invoice for load ${loadNumber} is already in NetSuite.` };\nconst lines = mine.map(r => {\n  const quantity = Number(r.quantity) || 1;\n  const amount = Number(r.amount) || 0;\n  const rate = r.rate !== null && r.rate !== undefined && r.rate !== '' ? Number(r.rate) : amount / quantity;\n  return { item: { id: String(r.item) }, quantity, rate, amount };\n});\nconst total = Math.round(lines.reduce((sum, l) => sum + l.amount, 0) * 100) / 100;\nreturn {\n  ready: true,\n  reason: '',\n  salesOrderId: String(soId),\n  salesOrderNumber: order.tranid,\n  customerId: String(order.entity),\n  customerName: order.customername || '',\n  lines,\n  total,\n};"
              }
            ],
            "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": "Build the invoice lines",
        "nextElementIds": [
          "D63D4BC9-A3DD-4421-A60C-A43270DA3385"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1266,
            "y": 519
          }
        },
        "flowElementId": "CADC76E1-9941-42BF-9C45-0D7B8EAD27BE",
        "groupId": null,
        "id": "9F2AEA3E-1CD7-475D-9C3F-610ADB9A64EA",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "0f03cb18-e4bf-4b5f-889d-db6c63c6f37a",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "RESULT",
                      "label": "Billing decision",
                      "subPathSegments": [
                        {
                          "key": "decision",
                          "optional": false
                        }
                      ],
                      "type": "TRIGGER_DATA",
                      "value": "297B4DC1-0DDC-44C4-8EEF-D97B7258ACE5"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "bill"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "0f03cb18-e4bf-4b5f-889d-db6c63c6f37a"
            ]
          },
          "elseComponent": {
            "componentId": "13D97D4D-647A-4007-9C05-5668915B6F45",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Invoice it",
          "storeResult": false,
          "thenComponent": {
            "componentId": "0F4DD374-E62C-42F4-A16C-EA1F5F21B999",
            "componentType": "ELEMENT"
          }
        },
        "name": "Invoice it?",
        "nextElementIds": [
          "0F4DD374-E62C-42F4-A16C-EA1F5F21B999",
          "13D97D4D-647A-4007-9C05-5668915B6F45"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Creates a new invoice in NetSuite for a specified customer. Line items define the products or services being invoiced. Each line item should include an item reference with quantity and amount.",
          "elementId": "EXTENSION:::SHARED:::default:::netsuite:::createInvoice",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Create the invoice Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::netsuite:::createInvoice",
          "legacyElementId": "JS###v1###NetSuiteService###createInvoice",
          "methodName": "createInvoice",
          "position": {
            "x": 1266,
            "y": 680
          }
        },
        "flowElementId": "DF398654-4047-43D3-9410-0451403B13DC",
        "groupId": null,
        "id": "0F4DD374-E62C-42F4-A16C-EA1F5F21B999",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "customerId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice lines",
                    "subPathSegments": [
                      {
                        "key": "customerId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3E607881-CD12-443A-B20A-DCA7B2928BC5"
                  }
                ],
                "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": "3E607881-CD12-443A-B20A-DCA7B2928BC5"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "tranDate",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dueDate",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subsidiaryId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "currencyId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "memo",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Load "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D95C407-6E1E-497F-9812-361EFD009053"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ", PRO "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "proNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D95C407-6E1E-497F-9812-361EFD009053"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ", BOL "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "bolNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D95C407-6E1E-497F-9812-361EFD009053"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ". Delivered "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "deliveryDate",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D95C407-6E1E-497F-9812-361EFD009053"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ". Sales order "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice lines",
                    "subPathSegments": [
                      {
                        "key": "salesOrderNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3E607881-CD12-443A-B20A-DCA7B2928BC5"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "."
                  }
                ],
                "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": "Customer invoice",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "netsuite",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Create the invoice",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Fires once for each new email that arrives in a mail folder (the Inbox unless another folder is chosen), optionally only for emails from a sender, with a subject, with attachments or still unread.",
          "elementId": "EXTENSION:::SHARED:::default:::outlook:::onNewEmail",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::outlook:::onNewEmail",
          "newElementId": "EXTENSION:::SHARED:::default:::outlook:::onNewEmail",
          "legacyElementId": "JS###v1###OutlookService###onNewEmail",
          "methodName": "onNewEmail",
          "position": {
            "x": 148,
            "y": 40
          }
        },
        "flowElementId": "1536AA30-5E30-4BB1-8861-D3C9AF9DDF41",
        "groupId": null,
        "id": "BA4D894A-0096-4DAD-B071-EDFC72C06F43",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'New POD email', Error: OAuth Connection is required",
            "valid": false
          },
          "condition": null,
          "connectionId": null,
          "dynamicData": [],
          "eventName": "onNewEmail",
          "frequency": {
            "repeat": {
              "every": 300
            },
            "schedule": "custom"
          },
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "POD email",
          "serviceId": "outlook",
          "slaConditions": [],
          "staticData": {
            "subjectContains": "POD",
            "hasAttachmentsOnly": true,
            "includeAttachments": true,
            "bodyFormat": "text"
          },
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New POD email",
        "nextElementIds": [
          "7D6B35A7-F7F1-40D5-BE70-ECFA37F09C20"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Executes a custom SuiteQL query against the NetSuite database. SuiteQL is a SQL-like query language for querying NetSuite records. Use this for advanced queries not covered by other methods.",
          "elementId": "EXTENSION:::SHARED:::default:::netsuite:::runSuiteQL",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Check for an invoice already raised Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::netsuite:::runSuiteQL",
          "legacyElementId": "JS###v1###NetSuiteService###runSuiteQL",
          "methodName": "runSuiteQL",
          "position": {
            "x": 1216,
            "y": 340
          }
        },
        "flowElementId": "0C6B609C-3436-41AF-8F98-1E6A5899A371",
        "groupId": null,
        "id": "3E9B046F-F43B-43A0-AAAC-0400636441A6",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "query",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "SELECT id, tranid FROM transaction WHERE type = 'CustInvc' AND memo LIKE 'Load "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D95C407-6E1E-497F-9812-361EFD009053"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ",%'"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "limit",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 5
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "offset",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Check for an invoice already raised', 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": "runSuiteQL",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Existing invoices",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "netsuite",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Check for an invoice already raised",
        "nextElementIds": [
          "3E607881-CD12-443A-B20A-DCA7B2928BC5"
        ],
        "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": "Send the POD to billing by hand Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 110,
            "y": 210
          }
        },
        "flowElementId": "7E328750-C6D3-4EC1-A79C-028C9E9F1DFD",
        "groupId": null,
        "id": "0996FE5C-1FE4-4BC7-AB99-27C151536F14",
        "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": "POD for load "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D95C407-6E1E-497F-9812-361EFD009053"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " (PRO "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "proNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D95C407-6E1E-497F-9812-361EFD009053"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ", BOL "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "bolNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D95C407-6E1E-497F-9812-361EFD009053"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ") was not invoiced: "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice lines",
                    "subPathSegments": [
                      {
                        "key": "reason",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3E607881-CD12-443A-B20A-DCA7B2928BC5"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "\nFrom "
                  },
                  {
                    "id": "RESULT",
                    "label": "POD email",
                    "subPathSegments": [
                      {
                        "key": "from",
                        "optional": false
                      },
                      {
                        "key": "emailAddress",
                        "optional": false
                      },
                      {
                        "key": "address",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "BA4D894A-0096-4DAD-B071-EDFC72C06F43"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ": "
                  },
                  {
                    "id": "RESULT",
                    "label": "POD email",
                    "subPathSegments": [
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "BA4D894A-0096-4DAD-B071-EDFC72C06F43"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "\n<"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "POD file",
                    "subPathSegments": [
                      {
                        "key": "files",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "url",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D6B35A7-F7F1-40D5-BE70-ECFA37F09C20"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "|Open the POD>"
                  }
                ],
                "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": "EXPRESSION",
                "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": "EXPRESSION",
                "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": "By hand note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Send the POD to billing by hand",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 486,
            "y": 349
          }
        },
        "flowElementId": "8E47B826-A0C4-4AC9-8AB2-305244557AB2",
        "groupId": null,
        "id": "D63D4BC9-A3DD-4421-A60C-A43270DA3385",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "45ae9860-da33-42ce-b530-0af4a903252b",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Invoice lines",
                      "subPathSegments": [
                        {
                          "key": "ready",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "3E607881-CD12-443A-B20A-DCA7B2928BC5"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "45ae9860-da33-42ce-b530-0af4a903252b"
            ]
          },
          "elseComponent": {
            "componentId": "0996FE5C-1FE4-4BC7-AB99-27C151536F14",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Ready to invoice",
          "storeResult": false,
          "thenComponent": {
            "componentId": "0327E9A7-D2D7-444C-BC95-1A0403C42D44",
            "componentType": "ELEMENT"
          }
        },
        "name": "Sales order found and not invoiced?",
        "nextElementIds": [
          "0996FE5C-1FE4-4BC7-AB99-27C151536F14",
          "0327E9A7-D2D7-444C-BC95-1A0403C42D44"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 139,
            "y": 349
          }
        },
        "flowElementId": "C77AD647-094A-4D4B-8FC1-F92F38436014",
        "groupId": null,
        "id": "0327E9A7-D2D7-444C-BC95-1A0403C42D44",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "a7c4a754-a072-4cca-bd76-24b001d29dbb",
                "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": "7D95C407-6E1E-497F-9812-361EFD009053"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              },
              {
                "id": "e3646e98-1549-454f-a321-19d945ae7628",
                "nestedOperation": null,
                "operation": "isEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "POD reading",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "exceptions",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "7D95C407-6E1E-497F-9812-361EFD009053"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "a7c4a754-a072-4cca-bd76-24b001d29dbb",
              "AND",
              "e3646e98-1549-454f-a321-19d945ae7628"
            ]
          },
          "elseComponent": {
            "componentId": "08B901A7-0E7C-47C8-963D-86D29C3032FC",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "POD clean",
          "storeResult": false,
          "thenComponent": {
            "componentId": "0F4DD374-E62C-42F4-A16C-EA1F5F21B999",
            "componentType": "ELEMENT"
          }
        },
        "name": "POD signed and clean?",
        "nextElementIds": [
          "0F4DD374-E62C-42F4-A16C-EA1F5F21B999",
          "08B901A7-0E7C-47C8-963D-86D29C3032FC"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      }
    ],
    "firstElementId": "BA4D894A-0096-4DAD-B071-EDFC72C06F43",
    "groups": [],
    "id": "F88812FD-EB1C-4F19-B949-907DB0C5C000",
    "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 POD reading step uses.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "The URL of the block Wait for billing's answer. The Slack buttons open it.",
          "error": null,
          "name": "Answer link",
          "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:33:19.986Z"
}
