{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "6ABE39FA-7EBC-43C3-99C6-A58B6B002D24",
    "name": "Ramp: carrier bill checked against McLeod pay"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -51.448931116389545,
        "y": 6.7458432304038,
        "zoom": 0.83
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When a new bill appears in Ramp, reads the load number from the bill memo or line items (or the invoice number), finds the load in McLeod and compares the bill with the carrier pay plus extra pay and the carrier name. An exact match gets a comment and is left to Ramp's approval. A mismatch is held, commented and sent to AP in Slack, and AP's answer releases the hold or keeps it.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When a carrier bill lands in Ramp, checks it against the McLeod carrier pay plus extra pay. A match is noted on the bill; a mismatch is held and sent to AP in Slack.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 793,
            "y": 49
          }
        },
        "flowElementId": "B7147DD7-BE70-4812-8019-0239442E762B",
        "groupId": null,
        "id": "58B5A70D-29C1-4B95-A5FD-3CB1B8DC1D55",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "569781ad-77c7-4335-a547-ed4e1fa5108a",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Bill",
                      "subPathSegments": [
                        {
                          "key": "hasSearch",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "2B1181FB-5F32-4AB8-8C5C-D7EAABD6A9CB"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "569781ad-77c7-4335-a547-ed4e1fa5108a"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Reference check",
          "storeResult": false,
          "thenComponent": {
            "componentId": "5B667BD0-A413-49E9-A40A-358A110C13A7",
            "componentType": "ELEMENT"
          }
        },
        "name": "Load number on the bill?",
        "nextElementIds": [
          "5B667BD0-A413-49E9-A40A-358A110C13A7"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Finds a load by its order number, PRO number, bill of lading, consignee reference or a stop reference number (McLeod order tracking search) and returns the first match in full, as Get Load does, with every match listed. Returns found: false instead of failing when nothing matches.",
          "elementId": "EXTENSION:::SHARED:::default:::mcleod-loadmaster:::findLoadByNumber",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the load in McLeod Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::mcleod-loadmaster:::findLoadByNumber",
          "legacyElementId": null,
          "methodName": "findLoadByNumber",
          "position": {
            "x": 1157,
            "y": 40
          }
        },
        "flowElementId": "3B2496D2-F0D7-4A90-B7C6-D5C7EAEF1957",
        "groupId": null,
        "id": "5B667BD0-A413-49E9-A40A-358A110C13A7",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Bill",
                    "subPathSegments": [
                      {
                        "key": "searchLoad",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2B1181FB-5F32-4AB8-8C5C-D7EAABD6A9CB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "proNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Bill",
                    "subPathSegments": [
                      {
                        "key": "searchPro",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2B1181FB-5F32-4AB8-8C5C-D7EAABD6A9CB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "billOfLading",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "consigneeReference",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "referenceNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "includeCustomerContacts",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "findLoadByNumber",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "McLeod load",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "mcleod-loadmaster",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the load in McLeod",
        "nextElementIds": [
          "577BAB92-7ECC-49BD-87B8-094DBF6F0004"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Posts a comment on a bill's discussion thread in Ramp, optionally mentioning users, for example to explain why it was held. Needs the bills:write scope on your Ramp app.",
          "elementId": "EXTENSION:::SHARED:::default:::ramp-service:::addBillComment",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Note the release on the bill Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::ramp-service:::addBillComment",
          "legacyElementId": "JS###v1###RampService###addBillComment",
          "methodName": "addBillComment",
          "position": {
            "x": 450,
            "y": 680
          }
        },
        "flowElementId": "675DFAB2-DDAD-4779-BA92-9F30E370F7E8",
        "groupId": null,
        "id": "2F5732B2-FB84-4D9D-B867-F46C50948551",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "billId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Bill",
                    "subPathSegments": [
                      {
                        "key": "billId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2B1181FB-5F32-4AB8-8C5C-D7EAABD6A9CB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "message",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Check",
                    "subPathSegments": [
                      {
                        "key": "releaseComment",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "577BAB92-7ECC-49BD-87B8-094DBF6F0004"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageFormat",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "PLAIN_TEXT"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "mentionUserIds",
              "type": "SIMPLE_LIST",
              "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": "addBillComment",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Release comment",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "ramp-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Note the release on the bill",
        "nextElementIds": [
          "5E262D95-7010-4A29-90AA-7641AA98CDB9"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the bill Result"
          },
          "position": {
            "x": 472,
            "y": 49
          }
        },
        "flowElementId": "A87C5250-73D8-4B60-91BB-1805E194ACC1",
        "groupId": null,
        "id": "2B1181FB-5F32-4AB8-8C5C-D7EAABD6A9CB",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "bill",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "New bill",
                    "subPathSegments": null,
                    "type": "TRIGGER_DATA",
                    "value": "AE6E283A-A5C1-49E4-BB5E-80F4A3A353E0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const b = bill || {};\nconst amt = b.amount || {};\nconst rate = Number(amt.minor_unit_conversion_rate) || 100;\nconst amount = typeof amt.amount === 'number' ? amt.amount / rate : null;\nconst lines = Array.isArray(b.line_items) ? b.line_items : [];\nconst text = [b.memo].concat(lines.map((li) => li && li.memo)).filter(Boolean).map(String).join(' \\n ');\nconst grab = (re) => {\n  const m = text.match(re);\n  return m && m[1].length >= 3 ? m[1] : '';\n};\nconst loadRef = grab(/\\b(?:load|order)\\s*(?:#|no\\.?|number)?\\s*[:#]?\\s*([A-Z0-9-]*\\d[A-Z0-9-]*)/i);\nconst proRef = loadRef ? '' : grab(/\\bPRO\\s*(?:#|no\\.?|number)?\\s*[:#]?\\s*([A-Z0-9-]*\\d[A-Z0-9-]*)/i);\nconst invoice = String(b.invoice_number || '').trim();\nconst searchLoad = loadRef || (proRef ? '' : invoice);\nconst vendor = b.vendor || {};\nreturn {\n  billId: String(b.id || ''),\n  invoiceNumber: invoice,\n  amount,\n  currency: String(amt.currency_code || 'USD'),\n  vendorName: String(vendor.name || vendor.remote_name || ''),\n  labeled: !!(loadRef || proRef),\n  searchLoad,\n  searchPro: proRef,\n  hasSearch: !!(searchLoad || proRef),\n};\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Bill",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Read the bill",
        "nextElementIds": [
          "58B5A70D-29C1-4B95-A5FD-3CB1B8DC1D55"
        ],
        "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 AP it's released Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 130,
            "y": 680
          }
        },
        "flowElementId": "DE7CF331-5D05-4E0B-958E-3528054EB27E",
        "groupId": null,
        "id": "5E262D95-7010-4A29-90AA-7641AA98CDB9",
        "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": "Check",
                    "subPathSegments": [
                      {
                        "key": "releasedText",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "577BAB92-7ECC-49BD-87B8-094DBF6F0004"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to AP",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "32A93E21-0A92-43CF-A9D5-4D03EE173A89"
                  }
                ],
                "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": "Released note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell AP it's released",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 808,
            "y": 519
          }
        },
        "flowElementId": "1CB5FE0E-9CB7-4503-AC0B-184975EE1328",
        "groupId": null,
        "id": "B6F6290F-A4F8-4E40-A2AB-D1E5DAB747DE",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "6e509bac-4bc3-4eb4-9336-a8d0a995c6bf",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "RESULT",
                      "label": "AP decision",
                      "subPathSegments": [
                        {
                          "key": "decision",
                          "optional": false
                        }
                      ],
                      "type": "TRIGGER_DATA",
                      "value": "29D48FF9-FB61-4A9A-8F0E-ACA511CA49A7"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "release"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "6e509bac-4bc3-4eb4-9336-a8d0a995c6bf"
            ]
          },
          "elseComponent": {
            "componentId": "3FC0324F-156D-4DDE-A8EF-80575A1C8D89",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Release check",
          "storeResult": false,
          "thenComponent": {
            "componentId": "94AF7620-6745-46B1-AF3E-75108E85D025",
            "componentType": "ELEMENT"
          }
        },
        "name": "Release it?",
        "nextElementIds": [
          "94AF7620-6745-46B1-AF3E-75108E85D025",
          "3FC0324F-156D-4DDE-A8EF-80575A1C8D89"
        ],
        "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": "Ask AP Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 130,
            "y": 510
          }
        },
        "flowElementId": "D221226A-63A5-41F0-BF91-777743C7A628",
        "groupId": null,
        "id": "32A93E21-0A92-43CF-A9D5-4D03EE173A89",
        "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": "Check",
                    "subPathSegments": [
                      {
                        "key": "text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "577BAB92-7ECC-49BD-87B8-094DBF6F0004"
                  }
                ],
                "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": "Check",
                    "subPathSegments": [
                      {
                        "key": "blocks",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "577BAB92-7ECC-49BD-87B8-094DBF6F0004"
                  }
                ],
                "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 AP",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask AP",
        "nextElementIds": [
          "29D48FF9-FB61-4A9A-8F0E-ACA511CA49A7"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "router",
          "isFirstElement": false,
          "blockDefinitionId": "router",
          "casesViewMode": {
            "50d112f7-35ec-4cd4-a558-8d527076eff3": "SIMPLE",
            "7da890d8-4d20-402f-8005-738d9050de1d": "SIMPLE"
          },
          "position": {
            "x": 793,
            "y": 219
          }
        },
        "flowElementId": "1079C5D8-ABA4-45F2-B3F8-CBA53CBB1AEC",
        "groupId": null,
        "id": "B7779FD7-2976-41D2-A94E-6CD375CEB950",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Bill route",
          "storeResult": true,
          "switchCases": [
            {
              "defaultCase": false,
              "id": "50d112f7-35ec-4cd4-a558-8d527076eff3",
              "label": "Matches McLeod",
              "nextComponents": [
                {
                  "componentId": "5274FE6F-0F1F-48F6-B0B1-15864F1536AF",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "match"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": false,
              "id": "7da890d8-4d20-402f-8005-738d9050de1d",
              "label": "Doesn't match",
              "nextComponents": [
                {
                  "componentId": "CA71C40F-C3C8-422E-B10F-3697CECDE8B7",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "hold"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": true,
              "id": "18a8d060-6a1b-4abe-ac76-c6cb531b3204",
              "label": "Everything Else",
              "nextComponents": [],
              "type": "SIMPLE",
              "value": null
            }
          ],
          "switchExpression": {
            "expression": [
              {
                "id": "ELEMENT_RESULT",
                "label": "Check",
                "subPathSegments": [
                  {
                    "key": "action",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "577BAB92-7ECC-49BD-87B8-094DBF6F0004"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "What does the bill need?",
        "nextElementIds": [
          "CA71C40F-C3C8-422E-B10F-3697CECDE8B7",
          "5274FE6F-0F1F-48F6-B0B1-15864F1536AF"
        ],
        "nextGroupIds": [],
        "type": "VALUE_ROUTER"
      },
      {
        "clientMetadata": {
          "notes": "Posts a comment on a bill's discussion thread in Ramp, optionally mentioning users, for example to explain why it was held. Needs the bills:write scope on your Ramp app.",
          "elementId": "EXTENSION:::SHARED:::default:::ramp-service:::addBillComment",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Note the match on the bill Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::ramp-service:::addBillComment",
          "legacyElementId": "JS###v1###RampService###addBillComment",
          "methodName": "addBillComment",
          "position": {
            "x": 453,
            "y": 340
          }
        },
        "flowElementId": "9350166C-AF3D-444C-A17F-B909ECCC0388",
        "groupId": null,
        "id": "5274FE6F-0F1F-48F6-B0B1-15864F1536AF",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "billId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Bill",
                    "subPathSegments": [
                      {
                        "key": "billId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2B1181FB-5F32-4AB8-8C5C-D7EAABD6A9CB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "message",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Check",
                    "subPathSegments": [
                      {
                        "key": "matchComment",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "577BAB92-7ECC-49BD-87B8-094DBF6F0004"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageFormat",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "PLAIN_TEXT"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "mentionUserIds",
              "type": "SIMPLE_LIST",
              "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": "addBillComment",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Match comment",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "ramp-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Note the match on the bill",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Check against McLeod carrier pay Result"
          },
          "position": {
            "x": 1122,
            "y": 219
          }
        },
        "flowElementId": "6F086A20-0FAD-4E3D-860D-931268F30E69",
        "groupId": null,
        "id": "577BAB92-7ECC-49BD-87B8-094DBF6F0004",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "bill",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Bill",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "2B1181FB-5F32-4AB8-8C5C-D7EAABD6A9CB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "found",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "McLeod load",
                    "subPathSegments": [
                      {
                        "key": "found",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "5B667BD0-A413-49E9-A40A-358A110C13A7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "load",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "McLeod load",
                    "subPathSegments": [
                      {
                        "key": "load",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "5B667BD0-A413-49E9-A40A-358A110C13A7"
                  }
                ],
                "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 money = (n) => Number(n || 0).toLocaleString('en-US', { style: 'currency', currency: 'USD' });\nconst norm = (s) => String(s || '').toLowerCase().replace(/[^a-z0-9 ]/g, ' ').replace(/\\b(llc|inc|corp|corporation|co|ltd|company)\\b/g, ' ').replace(/\\s+/g, ' ').trim();\nconst l = found && load ? load : null;\nif (!l && !bill.labeled) return { action: 'skip' };\nconst billRef = bill.searchLoad || bill.searchPro;\nconst reasons = [];\nlet lineHaul = 0;\nlet extra = 0;\nlet total = 0;\nlet carrier = '';\nlet extras = [];\nif (l) {\n  const pay = l.carrierPay || {};\n  lineHaul = Number(pay.amount || 0);\n  const ep = Array.isArray(l.carrierExtraPay) ? l.carrierExtraPay : [];\n  extra = ep.length ? ep.reduce((s, e) => s + Number((e && e.amount) || 0), 0) : Number(pay.otherPay || 0);\n  extras = ep.map((e) => (e.description || e.shortDescription || 'Extra pay') + ' ' + money(e.amount));\n  total = Math.round((lineHaul + extra) * 100) / 100;\n  carrier = (l.carrier && l.carrier.name) || '';\n} else {\n  reasons.push('no McLeod load matches ' + billRef);\n}\nif (bill.amount == null) reasons.push('the bill has no amount');\nif (String(bill.currency).toUpperCase() !== 'USD') reasons.push('the bill is in ' + bill.currency);\nconst diff = l && bill.amount != null ? Math.round((bill.amount - total) * 100) / 100 : null;\nif (l && !(total > 0)) reasons.push('McLeod has no carrier pay on the load');\nelse if (diff) reasons.push('the bill is ' + money(Math.abs(diff)) + (diff > 0 ? ' over' : ' under') + ' the McLeod carrier pay');\nconst vn = norm(bill.vendorName);\nconst cn = norm(carrier);\nconst vendorOk = !!vn && !!cn && (vn === cn || vn.includes(cn) || cn.includes(vn));\nif (l && !vendorOk) reasons.push('the Ramp vendor ' + (bill.vendorName || '(none)') + ' is not the McLeod carrier ' + (carrier || '(none)'));\nconst loadId = l ? String(l.orderId) : billRef;\nconst payText = money(total) + ' (' + money(lineHaul) + ' line haul plus ' + money(extra) + ' extra pay)';\nconst billName = (bill.vendorName || 'Carrier') + ' bill' + (bill.invoiceNumber ? ' ' + bill.invoiceNumber : '');\nconst link = (d) => answerLink + '?execution=' + encodeURIComponent(executionId) + '&decision=' + d;\nconst detail = [\n  '*' + billName + ' is on hold in Ramp*',\n  'Bill amount: ' + money(bill.amount),\n  l ? 'McLeod load ' + loadId + ', carrier ' + (carrier || 'not set') + ': ' + payText : 'McLeod load: none found for ' + billRef,\n];\nif (extras.length) detail.push('Extra pay on the load: ' + extras.join(', '));\ndetail.push('Why it was held: ' + reasons.join('; ') + '.');\ndetail.push('Check the carrier invoice and the rate con, then release the hold or keep it.');\nreturn {\n  action: reasons.length ? 'hold' : 'match',\n  loadId,\n  matchComment: 'Checked against McLeod load ' + loadId + ': ' + money(bill.amount) + ' matches the carrier pay of ' + payText + ' for ' + carrier + '. Left for approval in Ramp.',\n  holdReason: ('Does not match McLeod carrier pay for load ' + loadId).slice(0, 200),\n  holdComment: 'Held for AP review: ' + reasons.join('; ') + '. Bill ' + money(bill.amount) + (l ? ', McLeod carrier pay ' + payText : '') + '. Sent to AP in Slack.',\n  releaseComment: 'AP released the hold after checking this bill against McLeod load ' + loadId + '.',\n  keepComment: 'AP kept this bill on hold after checking it against McLeod load ' + loadId + '. It stays held until someone releases it in Ramp.',\n  releasedText: 'Hold released on ' + billName + '. Ramp can schedule the payment.',\n  keptText: billName + ' stays on hold in Ramp.',\n  text: billName + ' is on hold in Ramp',\n  blocks: [\n    { type: 'section', text: { type: 'mrkdwn', text: detail.join('\\n') } },\n    { type: 'actions', elements: [\n      { type: 'button', style: 'primary', text: { type: 'plain_text', text: 'Release the hold' }, url: link('release') },\n      { type: 'button', style: 'danger', text: { type: 'plain_text', text: 'Keep it held' }, url: link('keep') },\n    ] },\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": "Check",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Check against McLeod carrier pay",
        "nextElementIds": [
          "B7779FD7-2976-41D2-A94E-6CD375CEB950"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Releases the hold on a bill so its payments can be scheduled again. Needs the bills:write scope on your Ramp app.",
          "elementId": "EXTENSION:::SHARED:::default:::ramp-service:::releaseBillHold",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Release the hold Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::ramp-service:::releaseBillHold",
          "legacyElementId": "JS###v1###RampService###releaseBillHold",
          "methodName": "releaseBillHold",
          "position": {
            "x": 808,
            "y": 680
          }
        },
        "flowElementId": "63B6B0C3-1F2B-4B53-A647-7B76CC407C38",
        "groupId": null,
        "id": "94AF7620-6745-46B1-AF3E-75108E85D025",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "billId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Bill",
                    "subPathSegments": [
                      {
                        "key": "billId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2B1181FB-5F32-4AB8-8C5C-D7EAABD6A9CB"
                  }
                ],
                "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": "releaseBillHold",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Released bill",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "ramp-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Release the hold",
        "nextElementIds": [
          "2F5732B2-FB84-4D9D-B867-F46C50948551"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Places a bill on hold: Ramp blocks every payment rail on it and unschedules its payments until the hold is released. An optional reason is recorded with the hold. Needs the bills:write scope on your Ramp app.",
          "elementId": "EXTENSION:::SHARED:::default:::ramp-service:::holdBill",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Hold the bill Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::ramp-service:::holdBill",
          "legacyElementId": "JS###v1###RampService###holdBill",
          "methodName": "holdBill",
          "position": {
            "x": 472,
            "y": 210
          }
        },
        "flowElementId": "A09CDB59-8521-4038-B2EA-AF535C14DBCE",
        "groupId": null,
        "id": "CA71C40F-C3C8-422E-B10F-3697CECDE8B7",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "billId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Bill",
                    "subPathSegments": [
                      {
                        "key": "billId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2B1181FB-5F32-4AB8-8C5C-D7EAABD6A9CB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "reason",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Check",
                    "subPathSegments": [
                      {
                        "key": "holdReason",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "577BAB92-7ECC-49BD-87B8-094DBF6F0004"
                  }
                ],
                "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": "holdBill",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Held bill",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "ramp-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Hold the bill",
        "nextElementIds": [
          "8772E33F-18AD-42C6-99B7-628C8C0D314F"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Posts a comment on a bill's discussion thread in Ramp, optionally mentioning users, for example to explain why it was held. Needs the bills:write scope on your Ramp app.",
          "elementId": "EXTENSION:::SHARED:::default:::ramp-service:::addBillComment",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Explain the hold on the bill Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::ramp-service:::addBillComment",
          "legacyElementId": "JS###v1###RampService###addBillComment",
          "methodName": "addBillComment",
          "position": {
            "x": 110,
            "y": 210
          }
        },
        "flowElementId": "8BC8DB35-81C0-491A-8D12-421515A5E2BF",
        "groupId": null,
        "id": "8772E33F-18AD-42C6-99B7-628C8C0D314F",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "billId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Bill",
                    "subPathSegments": [
                      {
                        "key": "billId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2B1181FB-5F32-4AB8-8C5C-D7EAABD6A9CB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "message",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Check",
                    "subPathSegments": [
                      {
                        "key": "holdComment",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "577BAB92-7ECC-49BD-87B8-094DBF6F0004"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageFormat",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "PLAIN_TEXT"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "mentionUserIds",
              "type": "SIMPLE_LIST",
              "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": "addBillComment",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Hold comment",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "ramp-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Explain the hold on the bill",
        "nextElementIds": [
          "32A93E21-0A92-43CF-A9D5-4D03EE173A89"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Triggers when a new bill is created in Ramp Bill Pay. Optionally filter by vendor to scope which bills wake the flow. Useful for AP approval workflows. Polling interval can be customized (minimum 30 seconds).",
          "elementId": "EXTENSION:::SHARED:::default:::ramp-service:::onNewBill",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::ramp-service:::onNewBill",
          "newElementId": "EXTENSION:::SHARED:::default:::ramp-service:::onNewBill",
          "legacyElementId": "JS###v1###RampService###onNewBill",
          "methodName": "onNewBill",
          "position": {
            "x": 130,
            "y": 40
          }
        },
        "flowElementId": "A9870105-42E2-4223-B429-FDF4BB65CC77",
        "groupId": null,
        "id": "AE6E283A-A5C1-49E4-BB5E-80F4A3A353E0",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "connectionId": null,
          "dynamicData": [],
          "eventName": "onNewBill",
          "frequency": {
            "repeat": {
              "every": 300
            },
            "schedule": "custom"
          },
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "New bill",
          "serviceId": "ramp-service",
          "slaConditions": [],
          "staticData": {},
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New bill in Ramp",
        "nextElementIds": [
          "2B1181FB-5F32-4AB8-8C5C-D7EAABD6A9CB"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "external-callback",
          "isFirstElement": false,
          "blockDefinitionId": "external-callback",
          "position": {
            "x": 470,
            "y": 519
          }
        },
        "flowElementId": "29A63747-E157-4F53-A87E-A3910D969599",
        "groupId": null,
        "id": "29D48FF9-FB61-4A9A-8F0E-ACA511CA49A7",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "resultAlias": "AP decision",
          "slaConditions": [],
          "storeResult": true,
          "type": "CALLBACK"
        },
        "name": "Wait for AP's answer",
        "nextElementIds": [
          "B6F6290F-A4F8-4E40-A2AB-D1E5DAB747DE"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Posts a comment on a bill's discussion thread in Ramp, optionally mentioning users, for example to explain why it was held. Needs the bills:write scope on your Ramp app.",
          "elementId": "EXTENSION:::SHARED:::default:::ramp-service:::addBillComment",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Note AP kept the hold Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::ramp-service:::addBillComment",
          "legacyElementId": "JS###v1###RampService###addBillComment",
          "methodName": "addBillComment",
          "position": {
            "x": 1163,
            "y": 510
          }
        },
        "flowElementId": "7B1CBCAA-3CB2-4480-AB1E-9D3492AB5072",
        "groupId": null,
        "id": "3FC0324F-156D-4DDE-A8EF-80575A1C8D89",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "billId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Bill",
                    "subPathSegments": [
                      {
                        "key": "billId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2B1181FB-5F32-4AB8-8C5C-D7EAABD6A9CB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "message",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Check",
                    "subPathSegments": [
                      {
                        "key": "keepComment",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "577BAB92-7ECC-49BD-87B8-094DBF6F0004"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageFormat",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "PLAIN_TEXT"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "mentionUserIds",
              "type": "SIMPLE_LIST",
              "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": "addBillComment",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Keep comment",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "ramp-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Note AP kept the hold",
        "nextElementIds": [
          "8123B5B7-3973-42B8-9022-97DBA7C65D87"
        ],
        "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 AP it stays held Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1514,
            "y": 510
          }
        },
        "flowElementId": "3DFA9BB6-5A1D-4596-B761-DD7A86D570B8",
        "groupId": null,
        "id": "8123B5B7-3973-42B8-9022-97DBA7C65D87",
        "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": "Check",
                    "subPathSegments": [
                      {
                        "key": "keptText",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "577BAB92-7ECC-49BD-87B8-094DBF6F0004"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to AP",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "32A93E21-0A92-43CF-A9D5-4D03EE173A89"
                  }
                ],
                "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": "Kept note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell AP it stays held",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "AE6E283A-A5C1-49E4-BB5E-80F4A3A353E0",
    "groups": [],
    "id": "F8900065-B59F-4B06-8C8D-1FDB6A2D7C16",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": null,
        "valid": true
      },
      "errorMessage": null,
      "executionStaticData": [
        {
          "description": "The URL of the block Wait for AP'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-29T02:54:13.748Z"
}
