{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "DCCF48D1-473C-417E-B22D-CF9B3C465B75",
    "name": "Gmail: quick pay request to AP"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -55.23809523809524,
        "y": 5.367965367965368,
        "zoom": 0.87
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When a carrier emails a quick pay request, reads the carrier, load or invoice number, amount and the fee they accept, looks the load up in McLeod, and asks AP in Slack to approve or decline. The carrier gets a reply with AP's answer.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When a carrier emails a quick pay request, reads the carrier, load or invoice number, amount and the fee they accept, looks the load up in McLeod, and asks AP in Slack to approve or decline. The carrier gets a reply with AP's answer.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the question for AP Result"
          },
          "position": {
            "x": 1414,
            "y": 219
          }
        },
        "flowElementId": "DB1E3F06-6C39-4BF9-A572-ACCF18F2229A",
        "groupId": null,
        "id": "65179592-C9BB-4162-9011-BCED6B34B23D",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": "Block: 'Write the question for AP', Error: The placeholder \"Answer link\" has no value",
            "valid": false
          },
          "codeArguments": [
            {
              "name": "request",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "98C4A64D-20AA-4F9C-BF11-6DA1A60833AB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "mcleod",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "McLeod load",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "A5335AB3-479B-4176-B6CA-E972D2387C9A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "senderName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Quick pay email",
                    "subPathSegments": [
                      {
                        "key": "fromName",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "D352FB58-4EAA-4FBD-8A0E-2EADB3D1176A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "senderAddress",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Quick pay email",
                    "subPathSegments": [
                      {
                        "key": "fromAddress",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "D352FB58-4EAA-4FBD-8A0E-2EADB3D1176A"
                  }
                ],
                "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 r = request && typeof request === 'object' ? request : {};\nconst money = (n) => `$${Number(n).toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;\nconst amount = typeof r.amount === 'number' ? r.amount : null;\nlet fee = null;\nif (amount !== null && typeof r.feePercent === 'number') fee = Math.round(amount * r.feePercent) / 100;\nelse if (typeof r.feeAmount === 'number') fee = r.feeAmount;\nconst net = amount !== null && fee !== null ? Math.round((amount - fee) * 100) / 100 : null;\n\nconst found = mcleod && mcleod.found === true && mcleod.load;\nconst load = found ? mcleod.load : null;\nconst agreed = load && load.carrierPay && typeof load.carrierPay.totalPay === 'number' ? load.carrierPay.totalPay : null;\nconst ref = [r.loadNumber ? `load ${r.loadNumber}` : null, r.invoiceNumber ? `invoice ${r.invoiceNumber}` : null].filter(Boolean).join(', ') || 'no load or invoice number given';\nconst carrier = r.carrierName || senderName || senderAddress;\n\nconst lines = [\n  `*Quick pay request from ${carrier}* (${ref})`,\n  `From: ${senderName || ''} ${senderAddress}`.trim(),\n  `Amount requested: ${amount !== null ? money(amount) : 'not stated'}`,\n  `Quick pay fee the carrier accepts: ${fee !== null ? money(fee) : 'not stated'}${typeof r.feePercent === 'number' ? ` (${r.feePercent}%)` : ''}`,\n  net !== null ? `Net to pay early: ${money(net)}` : null,\n  load ? `McLeod load ${load.orderId}: ${load.statusDescription || load.status}, ready to bill ${load.readyToBill === 'Y' ? 'yes' : 'no'}` : '*No McLeod load found for this request*',\n  load && load.carrier ? `Carrier on the load: ${load.carrier.name}` : null,\n  agreed !== null ? `Agreed carrier pay: ${money(agreed)}` : null,\n  agreed !== null && amount !== null && Math.abs(amount - agreed) >= 0.005 ? `*The amount requested differs from the agreed carrier pay by ${money(Math.abs(amount - agreed))}*` : null,\n  r.summary ? `Request: ${r.summary}` : null,\n].filter(Boolean);\n\nconst hello = senderName ? `Hi ${senderName},` : 'Hello,';\nconst approvedEmail = [\n  hello,\n  '',\n  `Your quick pay request (${ref}) is approved.` + (net !== null ? ` The payment will be ${money(amount)} less the ${money(fee)} quick pay fee, ${money(net)}.` : ''),\n  '',\n  'Thank you',\n].join('\\n');\nconst declinedEmail = [\n  hello,\n  '',\n  `Your quick pay request (${ref}) is not approved. The invoice stays on our standard payment terms.`,\n  '',\n  'Thank you',\n].join('\\n');\n\nconst link = (decision) => `${answerLink}?execution=${encodeURIComponent(executionId)}&decision=${decision}`;\nreturn {\n  ref,\n  approvedEmail,\n  declinedEmail,\n  text: `Quick pay request from ${carrier} (${ref})`,\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: 'Approve quick pay' }, url: link('approve') },\n      { type: 'button', text: { type: 'plain_text', text: 'Decline' }, url: link('decline') },\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": "Question card",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the question for AP",
        "nextElementIds": [
          "950F4CE7-DDAB-453F-AB9E-970DE56059A2"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "external-callback",
          "isFirstElement": false,
          "blockDefinitionId": "external-callback",
          "position": {
            "x": 810,
            "y": 219
          }
        },
        "flowElementId": "33910563-1A5F-4735-AD64-0C0270B8B637",
        "groupId": null,
        "id": "EEC6FE1B-E93B-4F49-8CBB-B48843317DA2",
        "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": [
          "6D60E904-7276-4004-8CA6-1C3065FAA46C"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Sends emails through Gmail for AI agents to automate customer communication.",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Tell the carrier it's declined Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "legacyElementId": "JS###v1###GmailService###sendMessage",
          "methodName": "sendMessage",
          "position": {
            "x": 110,
            "y": 210
          }
        },
        "flowElementId": "D779AE95-F1CF-4B0E-B872-7791C2EB5A98",
        "groupId": null,
        "id": "1F4E6968-9B18-4099-8952-681A58858138",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "to",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Quick pay email",
                    "subPathSegments": [
                      {
                        "key": "fromAddress",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "D352FB58-4EAA-4FBD-8A0E-2EADB3D1176A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Re: "
                  },
                  {
                    "id": "RESULT",
                    "label": "Quick pay email",
                    "subPathSegments": [
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "D352FB58-4EAA-4FBD-8A0E-2EADB3D1176A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "plain"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyContent",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "declinedEmail",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "65179592-C9BB-4162-9011-BCED6B34B23D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "from",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "cc",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bcc",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Quick pay email",
                    "subPathSegments": [
                      {
                        "key": "threadId",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "D352FB58-4EAA-4FBD-8A0E-2EADB3D1176A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachments",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessage",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Decline email",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell the carrier it's declined",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the request Result"
          },
          "tools": {},
          "position": {
            "x": 812,
            "y": 49
          }
        },
        "flowElementId": "3032DCD5-6408-4382-A932-EE5FEFF29005",
        "groupId": null,
        "id": "98C4A64D-20AA-4F9C-BF11-6DA1A60833AB",
        "metaInfo": {
          "aiApiKey": null,
          "aiModel": "claude-sonnet-5",
          "aiProvider": "ANTHROPIC",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "dynamicAiApiKey": {
            "expression": [
              {
                "id": "PLACEHOLDER_DATA",
                "label": "Anthropic key",
                "subPathSegments": null,
                "type": "EXECUTION_CONTEXT_STATIC_DATA",
                "value": "Anthropic key"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "files": [],
          "forceParsedOutput": true,
          "langSmithSettings": {
            "enabled": false,
            "apiKey": null,
            "projectName": null,
            "label": "FlowRunner AI-Agent",
            "accountCluster": "US"
          },
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "messagesHistoryEnabled": false,
          "messagesHistoryLimit": 15,
          "onFailElemId": null,
          "resultAlias": "Request",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You read quick pay requests that trucking companies email to a freight broker's accounts payable team. A quick pay request asks to be paid early on a carrier invoice in exchange for a fee. Reply with JSON only, with these fields:\ncarrierName: the carrier's company name, or empty text\nloadNumber: the load, order or reference number the request is for, or empty text\ninvoiceNumber: the carrier's invoice number, or empty text\namount: the invoice amount the carrier wants paid early, as a number in dollars, or null\nfeePercent: the quick pay fee the carrier accepts as a percent (3 for 3%), or null if they state no percent\nfeeAmount: the quick pay fee as a dollar amount, if they state one instead of a percent, or null\nsummary: the request in one plain sentence"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "From: "
              },
              {
                "id": "RESULT",
                "label": "Quick pay email",
                "subPathSegments": [
                  {
                    "key": "fromName",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "D352FB58-4EAA-4FBD-8A0E-2EADB3D1176A"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": " <"
              },
              {
                "id": "RESULT",
                "label": "Quick pay email",
                "subPathSegments": [
                  {
                    "key": "fromAddress",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "D352FB58-4EAA-4FBD-8A0E-2EADB3D1176A"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ">\nSubject: "
              },
              {
                "id": "RESULT",
                "label": "Quick pay email",
                "subPathSegments": [
                  {
                    "key": "subject",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "D352FB58-4EAA-4FBD-8A0E-2EADB3D1176A"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\n"
              },
              {
                "id": "RESULT",
                "label": "Quick pay email",
                "subPathSegments": [
                  {
                    "key": "message",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "D352FB58-4EAA-4FBD-8A0E-2EADB3D1176A"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Read the request",
        "nextElementIds": [
          "43D4F7F7-21AD-4C63-9D67-CB1C9BB3A70E"
        ],
        "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,
          "dynamicOptionLabels": {
            "channelId": {}
          },
          "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": 1114,
            "y": 210
          }
        },
        "flowElementId": "31425B1E-80F8-4FEA-AFA8-42AB6B6CA956",
        "groupId": null,
        "id": "950F4CE7-DDAB-453F-AB9E-970DE56059A2",
        "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": "65179592-C9BB-4162-9011-BCED6B34B23D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "blocks",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "65179592-C9BB-4162-9011-BCED6B34B23D"
                  }
                ],
                "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": [
          "EEC6FE1B-E93B-4F49-8CBB-B48843317DA2"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Triggers when new emails arrive. Polling interval can be customized (minimum 30 seconds).",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::onNewEmail",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::gmail-service:::onNewEmail",
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::onNewEmail",
          "legacyElementId": "JS###v1###GmailService###onNewEmail",
          "methodName": "onNewEmail",
          "position": {
            "x": 475,
            "y": 40
          }
        },
        "flowElementId": "7577195B-44DA-4082-B348-5801A700A865",
        "groupId": null,
        "id": "D352FB58-4EAA-4FBD-8A0E-2EADB3D1176A",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "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": "Quick pay email",
          "serviceId": "gmail-service",
          "slaConditions": [],
          "staticData": {
            "query": "subject:(\"quick pay\" OR quickpay OR \"quick-pay\")"
          },
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New quick pay request",
        "nextElementIds": [
          "98C4A64D-20AA-4F9C-BF11-6DA1A60833AB"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 484,
            "y": 219
          }
        },
        "flowElementId": "7A044825-C2E6-420D-B11D-5EF0655E91D6",
        "groupId": null,
        "id": "6D60E904-7276-4004-8CA6-1C3065FAA46C",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "32b65bd9-27dc-45ba-8f94-1708e8b2d666",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "RESULT",
                      "label": "AP decision",
                      "subPathSegments": [
                        {
                          "key": "decision",
                          "optional": false
                        }
                      ],
                      "type": "TRIGGER_DATA",
                      "value": "EEC6FE1B-E93B-4F49-8CBB-B48843317DA2"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "approve"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "32b65bd9-27dc-45ba-8f94-1708e8b2d666"
            ]
          },
          "elseComponent": {
            "componentId": "1F4E6968-9B18-4099-8952-681A58858138",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Approved",
          "storeResult": false,
          "thenComponent": {
            "componentId": "FEF433E1-63CB-4BDB-BB17-6BF197A627D5",
            "componentType": "ELEMENT"
          }
        },
        "name": "Approved?",
        "nextElementIds": [
          "1F4E6968-9B18-4099-8952-681A58858138",
          "FEF433E1-63CB-4BDB-BB17-6BF197A627D5"
        ],
        "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": 1419,
            "y": 40
          }
        },
        "flowElementId": "6B3DD853-C4DB-4788-96D9-2F4F5D92F14C",
        "groupId": null,
        "id": "A5335AB3-479B-4176-B6CA-E972D2387C9A",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "98C4A64D-20AA-4F9C-BF11-6DA1A60833AB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "proNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "billOfLading",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "consigneeReference",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "referenceNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "findLoadByNumber",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "McLeod load",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "mcleod-loadmaster",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the load in McLeod",
        "nextElementIds": [
          "65179592-C9BB-4162-9011-BCED6B34B23D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends emails through Gmail for AI agents to automate customer communication.",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Tell the carrier it's approved Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "legacyElementId": "JS###v1###GmailService###sendMessage",
          "methodName": "sendMessage",
          "position": {
            "x": 457,
            "y": 380
          }
        },
        "flowElementId": "F640C61A-D5A7-4518-A8A2-1F97C8EC8773",
        "groupId": null,
        "id": "FEF433E1-63CB-4BDB-BB17-6BF197A627D5",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "to",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Quick pay email",
                    "subPathSegments": [
                      {
                        "key": "fromAddress",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "D352FB58-4EAA-4FBD-8A0E-2EADB3D1176A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Re: "
                  },
                  {
                    "id": "RESULT",
                    "label": "Quick pay email",
                    "subPathSegments": [
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "D352FB58-4EAA-4FBD-8A0E-2EADB3D1176A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "plain"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyContent",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "approvedEmail",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "65179592-C9BB-4162-9011-BCED6B34B23D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "from",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "cc",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bcc",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Quick pay email",
                    "subPathSegments": [
                      {
                        "key": "threadId",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "D352FB58-4EAA-4FBD-8A0E-2EADB3D1176A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachments",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessage",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Approval email",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell the carrier it's approved",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1114,
            "y": 49
          }
        },
        "flowElementId": "364B6E17-4FF8-4774-BC99-C1A4E322C7E8",
        "groupId": null,
        "id": "43D4F7F7-21AD-4C63-9D67-CB1C9BB3A70E",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "c61d55fb-989a-4a35-ad64-8eda60d28a7f",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Request",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "loadNumber",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "98C4A64D-20AA-4F9C-BF11-6DA1A60833AB"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "c61d55fb-989a-4a35-ad64-8eda60d28a7f"
            ]
          },
          "elseComponent": {
            "componentId": "65179592-C9BB-4162-9011-BCED6B34B23D",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Load number given",
          "storeResult": false,
          "thenComponent": {
            "componentId": "A5335AB3-479B-4176-B6CA-E972D2387C9A",
            "componentType": "ELEMENT"
          }
        },
        "name": "Load number given?",
        "nextElementIds": [
          "65179592-C9BB-4162-9011-BCED6B34B23D",
          "A5335AB3-479B-4176-B6CA-E972D2387C9A"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      }
    ],
    "firstElementId": "D352FB58-4EAA-4FBD-8A0E-2EADB3D1176A",
    "groups": [],
    "id": "91B3854A-CAFA-4A63-BC05-37998AA4F9B0",
    "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": "Block 'Write the question for AP' has an invalid configuration. Code Argument 'answerLink' has invalid value. Placeholder Data 'Answer link': value is required",
      "executionStaticData": [
        {
          "description": "Your Anthropic API key for the AI step.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "The URL of the block Wait for AP's answer. The Slack buttons open it.",
          "error": "Placeholder Data 'Answer link': value is required",
          "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-26T05:49:03.404Z"
}
