{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "99A84B15-A2A0-4B8E-BAD4-6961EE221AAA",
    "name": "Zendesk: carrier invoice exception to an AP ticket"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -44.80176211453744,
        "y": 9.162995594713657,
        "zoom": 0.77
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When a carrier emails an invoice to AP, reads it, finds the rate con for the same load in the mailbox's sent mail by load number, and compares them charge by charge. A match is labeled Matched to rate con. A mismatch, or an invoice with no rate con to check, becomes a Zendesk ticket for AP with both sets of numbers.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "Checks each emailed carrier invoice against the rate con for the same load in the AP mailbox's sent mail, labels it when it matches, and opens a Zendesk ticket for AP with both sets of numbers when it does not.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1618,
            "y": 219
          }
        },
        "flowElementId": "7B84FBDA-2C3B-4064-8584-1113B658CC5F",
        "groupId": null,
        "id": "1DB66D4D-72B6-48E0-97EA-EB65D9D3F4AF",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "e2b7d510-5fa3-4916-b586-25d8ab8fb3d8",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Invoice reading",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "loadNumber",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "758C5313-2E65-4066-8910-F992687FAD89"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              },
              {
                "id": "8a6505be-9850-4ba4-b1ec-afc7727ea001",
                "nestedOperation": null,
                "operation": "arrayIsNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Rate con emails",
                      "subPathSegments": null,
                      "type": "ELEMENT_LINK",
                      "value": "95D3C5BC-73D1-45E0-9EA9-2134568D2FD0"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "ARRAY",
                "values": []
              }
            ],
            "grouping": [
              "e2b7d510-5fa3-4916-b586-25d8ab8fb3d8",
              "AND",
              "8a6505be-9850-4ba4-b1ec-afc7727ea001"
            ]
          },
          "elseComponent": {
            "componentId": "B3B02171-2399-450D-9277-0C3EF584DF63",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "found",
          "storeResult": false,
          "thenComponent": {
            "componentId": "0713BEEB-8D88-4CCB-B0A1-52A954D98657",
            "componentType": "ELEMENT"
          }
        },
        "name": "Rate con found?",
        "nextElementIds": [
          "0713BEEB-8D88-4CCB-B0A1-52A954D98657",
          "B3B02171-2399-450D-9277-0C3EF584DF63"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Saves a Gmail attachment to FlowRunner Files and returns the file URL.",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::saveAttachment",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Save the rate con Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::saveAttachment",
          "legacyElementId": "JS###v1###GmailService###saveAttachment",
          "methodName": "saveAttachment",
          "position": {
            "x": 1262,
            "y": 210
          }
        },
        "flowElementId": "0A0F0B65-1B44-454F-A4FE-AF499F790AF1",
        "groupId": null,
        "id": "0713BEEB-8D88-4CCB-B0A1-52A954D98657",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "messageId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Rate con emails",
                    "subPathSegments": [
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "95D3C5BC-73D1-45E0-9EA9-2134568D2FD0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachmentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Rate con emails",
                    "subPathSegments": [
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "attachments",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "95D3C5BC-73D1-45E0-9EA9-2134568D2FD0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Rate con emails",
                    "subPathSegments": [
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "attachments",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "filename",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "95D3C5BC-73D1-45E0-9EA9-2134568D2FD0"
                  }
                ],
                "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": "saveAttachment",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Rate con file",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Save the rate con",
        "nextElementIds": [
          "BDD9AEF1-E2A4-4BA8-85AA-82971B59DB83"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Adds labels to a message.",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::addLabelToMessage",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Label the invoice matched Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::addLabelToMessage",
          "legacyElementId": "JS###v1###GmailService###addLabelToMessage",
          "methodName": "addLabelToMessage",
          "position": {
            "x": 110,
            "y": 210
          }
        },
        "flowElementId": "82A1EAF8-AA59-4FE1-8B6F-985DF6469179",
        "groupId": null,
        "id": "397918AC-8F0B-4803-AC05-B0F70036F32D",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "messageId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Invoice email",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "89927563-94AC-401D-88CC-69461EFE592E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "labels",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "JSON",
                    "label": null,
                    "parsedValue": [
                      "Matched to rate con"
                    ],
                    "type": "INPUT",
                    "value": "[\"Matched to rate con\"]"
                  }
                ],
                "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": "addLabelToMessage",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Matched label",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Label the invoice matched",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Compare the invoice with the rate con Result"
          },
          "tools": {},
          "position": {
            "x": 815,
            "y": 219
          }
        },
        "flowElementId": "3DD3F10E-0C5A-48C0-8A9F-6ABA10FF31EA",
        "groupId": null,
        "id": "BDD9AEF1-E2A4-4BA8-85AA-82971B59DB83",
        "metaInfo": {
          "aiApiKey": null,
          "aiModel": "claude-sonnet-5",
          "aiProvider": "ANTHROPIC",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "dynamicAiApiKey": {
            "expression": [
              {
                "id": "PLACEHOLDER_DATA",
                "label": "Anthropic key",
                "subPathSegments": null,
                "type": "EXECUTION_CONTEXT_STATIC_DATA",
                "value": "Anthropic key"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "files": [
            {
              "mimeType": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Rate con emails",
                    "subPathSegments": [
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "attachments",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "mimetype",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "95D3C5BC-73D1-45E0-9EA9-2134568D2FD0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "STRING"
              },
              "url": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Rate con file",
                    "subPathSegments": [
                      {
                        "key": "fileUrl",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "0713BEEB-8D88-4CCB-B0A1-52A954D98657"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "STRING"
              }
            }
          ],
          "forceParsedOutput": true,
          "langSmithSettings": {
            "enabled": false,
            "apiKey": null,
            "projectName": null,
            "label": "FlowRunner AI-Agent",
            "accountCluster": "US"
          },
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "messagesHistoryEnabled": false,
          "messagesHistoryLimit": 15,
          "onFailElemId": null,
          "resultAlias": "Rate con check",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You check a carrier invoice against the rate confirmation (rate con) the broker sent the carrier for the same load. The attached file is the rate con. The carrier invoice's numbers are in the message. Compare them charge by charge: linehaul, fuel, and any accessorials such as detention, lumper, layover, stop-off or TONU. Reply with JSON only, with these fields:\nrateConTotal: the total agreed on the rate con as a number, no currency sign\nrateConCharges: every charge on the rate con on one line, separated by semicolons, each as name and amount\ndifference: the invoice total minus the rate con total, as a number\nmatches: true only when the totals are equal and every charge on the invoice is on the rate con at the same amount; otherwise false\ndifferences: each charge that differs or is missing from the rate con, in one or two plain sentences, for example: Detention 150.00 billed, not on the rate con. Empty text when it matches."
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Carrier invoice "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Invoice reading",
                "subPathSegments": [
                  {
                    "key": "output",
                    "optional": false
                  },
                  {
                    "key": "invoiceNumber",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "758C5313-2E65-4066-8910-F992687FAD89"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": " from "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Invoice reading",
                "subPathSegments": [
                  {
                    "key": "output",
                    "optional": false
                  },
                  {
                    "key": "carrier",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "758C5313-2E65-4066-8910-F992687FAD89"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": " for load "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Invoice reading",
                "subPathSegments": [
                  {
                    "key": "output",
                    "optional": false
                  },
                  {
                    "key": "loadNumber",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "758C5313-2E65-4066-8910-F992687FAD89"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nInvoice total: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Invoice reading",
                "subPathSegments": [
                  {
                    "key": "output",
                    "optional": false
                  },
                  {
                    "key": "invoiceTotal",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "758C5313-2E65-4066-8910-F992687FAD89"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nCharges: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Invoice reading",
                "subPathSegments": [
                  {
                    "key": "output",
                    "optional": false
                  },
                  {
                    "key": "charges",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "758C5313-2E65-4066-8910-F992687FAD89"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Compare the invoice with the rate con",
        "nextElementIds": [
          "64B36525-D018-4DC9-9636-D32761DD6EA9"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves Gmail messages for AI agents to analyze email content, extract leads, monitor communications, or automate email-based workflows.",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::getMessagesList",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the rate con in sent mail Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::getMessagesList",
          "legacyElementId": "JS###v1###GmailService###getMessagesList",
          "methodName": "getMessagesList",
          "position": {
            "x": 1589,
            "y": 40
          }
        },
        "flowElementId": "77DF3827-545B-4658-8429-9E39205608E0",
        "groupId": null,
        "id": "95D3C5BC-73D1-45E0-9EA9-2134568D2FD0",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "query",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "in:sent has:attachment \""
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "758C5313-2E65-4066-8910-F992687FAD89"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "\" (\"rate confirmation\" OR \"rate con\" OR ratecon)"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "loadUnread",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "maxResults",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 1
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "labels",
              "type": "SIMPLE_LIST",
              "value": [
                {
                  "expression": [],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                }
              ]
            },
            {
              "name": "includeSpamTrash",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "includeContent",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_TRUE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": true
                  }
                ],
                "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": "getMessagesList",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Rate con emails",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the rate con in sent mail",
        "nextElementIds": [
          "1DB66D4D-72B6-48E0-97EA-EB65D9D3F4AF"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Triggers when an email with a new attachment is received. Polling interval can be customized (minimum 30 seconds).",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::onNewAttachment",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::gmail-service:::onNewAttachment",
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::onNewAttachment",
          "legacyElementId": "JS###v1###GmailService###onNewAttachment",
          "methodName": "onNewAttachment",
          "position": {
            "x": 467,
            "y": 40
          }
        },
        "flowElementId": "D123A116-B614-41CA-BCF1-7CE4AE7AC7CC",
        "groupId": null,
        "id": "89927563-94AC-401D-88CC-69461EFE592E",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "connectionId": null,
          "dynamicData": [],
          "eventName": "onNewAttachment",
          "frequency": {
            "repeat": {
              "every": 300
            },
            "schedule": "custom"
          },
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Invoice email",
          "serviceId": "gmail-service",
          "slaConditions": [],
          "staticData": {
            "query": "subject:invoice -in:sent"
          },
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New carrier invoice email",
        "nextElementIds": [
          "3E7EB9A9-2337-49B7-8DCB-91B588C5C7DB"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the ticket for AP Result"
          },
          "position": {
            "x": 477,
            "y": 389
          }
        },
        "flowElementId": "007C6E82-D232-42C7-88E2-80359E3EB4FD",
        "groupId": null,
        "id": "B3B02171-2399-450D-9277-0C3EF584DF63",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "check",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Rate con check",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "BDD9AEF1-E2A4-4BA8-85AA-82971B59DB83"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "758C5313-2E65-4066-8910-F992687FAD89"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "proNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "proNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "758C5313-2E65-4066-8910-F992687FAD89"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "carrier",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "carrier",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "758C5313-2E65-4066-8910-F992687FAD89"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "invoiceNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "invoiceNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "758C5313-2E65-4066-8910-F992687FAD89"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "invoiceTotal",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "invoiceTotal",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "758C5313-2E65-4066-8910-F992687FAD89"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "charges",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "charges",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "758C5313-2E65-4066-8910-F992687FAD89"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "carrierEmail",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Invoice email",
                    "subPathSegments": [
                      {
                        "key": "fromAddress",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "89927563-94AC-401D-88CC-69461EFE592E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Invoice email",
                    "subPathSegments": [
                      {
                        "key": "threadId",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "89927563-94AC-401D-88CC-69461EFE592E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "rateConThreadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Rate con emails",
                    "subPathSegments": [
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "threadId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "95D3C5BC-73D1-45E0-9EA9-2134568D2FD0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const c = check && typeof check === 'object' && Object.keys(check).length ? check : null;\nconst money = v => (v === '' || v === null || v === undefined || isNaN(Number(v))) ? 'not found' : '$' + Number(v).toFixed(2);\nconst load = loadNumber || '(no load number)';\nconst inv = invoiceNumber || '(no invoice number)';\nconst gmail = id => `https://mail.google.com/mail/u/0/#all/${id}`;\nlet subject;\nlet tags;\nconst lines = [];\nif (c) {\n  subject = `Carrier invoice ${inv} for load ${load} does not match the rate con`;\n  tags = ['carrier_invoice', 'rate_con_mismatch'];\n  lines.push(`The carrier invoice for load ${load} does not match the rate con we sent. AP decides what to pay.`, '');\n  lines.push(`Carrier invoice ${inv}: ${money(invoiceTotal)}`, `  ${charges || ''}`);\n  lines.push(`Rate con: ${money(c.rateConTotal)}`, `  ${c.rateConCharges || ''}`);\n  lines.push(`Difference: ${money(c.difference)}`);\n  lines.push(`What differs: ${c.differences || ''}`);\n} else {\n  subject = `Carrier invoice ${inv} for load ${load}: no rate con found`;\n  tags = ['carrier_invoice', 'no_rate_con'];\n  lines.push(loadNumber\n    ? `No rate con for load ${loadNumber} was found in the AP mailbox's sent mail, so the invoice could not be checked.`\n    : 'The carrier invoice has no load number on it, so it could not be matched to a rate con.', '');\n  lines.push(`Carrier invoice ${inv}: ${money(invoiceTotal)}`, `  ${charges || ''}`);\n}\nlines.push('', `Carrier: ${carrier || ''}`, `PRO: ${proNumber || 'not on the invoice'}`, `Open the invoice email: ${gmail(threadId)}`);\nif (c && rateConThreadId) lines.push(`Open the rate con email: ${gmail(rateConThreadId)}`);\nlines.push('', 'Write your decision in a comment before you solve this ticket.', '', `Carrier email: ${carrierEmail}`, `Gmail thread: ${threadId}`);\nreturn { subject, body: lines.join('\\n'), tags };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Ticket text",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the ticket for AP",
        "nextElementIds": [
          "3C74F5B9-5D89-4326-B899-6ABE0DFED94E"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Saves a Gmail attachment to FlowRunner Files and returns the file URL.",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::saveAttachment",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Save the carrier invoice Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::saveAttachment",
          "legacyElementId": "JS###v1###GmailService###saveAttachment",
          "methodName": "saveAttachment",
          "position": {
            "x": 864,
            "y": 40
          }
        },
        "flowElementId": "90775056-ABC9-41A2-A257-E4660385C421",
        "groupId": null,
        "id": "3E7EB9A9-2337-49B7-8DCB-91B588C5C7DB",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "messageId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Invoice email",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "89927563-94AC-401D-88CC-69461EFE592E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachmentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Invoice email",
                    "subPathSegments": [
                      {
                        "key": "attachments",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "89927563-94AC-401D-88CC-69461EFE592E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Invoice email",
                    "subPathSegments": [
                      {
                        "key": "attachments",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "filename",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "89927563-94AC-401D-88CC-69461EFE592E"
                  }
                ],
                "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": "saveAttachment",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Invoice file",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Save the carrier invoice",
        "nextElementIds": [
          "758C5313-2E65-4066-8910-F992687FAD89"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the carrier invoice Result"
          },
          "tools": {},
          "position": {
            "x": 1251,
            "y": 49
          }
        },
        "flowElementId": "84873B0E-FA8D-4C00-8261-0F65BC12B8C4",
        "groupId": null,
        "id": "758C5313-2E65-4066-8910-F992687FAD89",
        "metaInfo": {
          "aiApiKey": null,
          "aiModel": "claude-sonnet-5",
          "aiProvider": "ANTHROPIC",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "dynamicAiApiKey": {
            "expression": [
              {
                "id": "PLACEHOLDER_DATA",
                "label": "Anthropic key",
                "subPathSegments": null,
                "type": "EXECUTION_CONTEXT_STATIC_DATA",
                "value": "Anthropic key"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "files": [
            {
              "mimeType": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Invoice email",
                    "subPathSegments": [
                      {
                        "key": "attachments",
                        "optional": false
                      },
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "mimetype",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "89927563-94AC-401D-88CC-69461EFE592E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "STRING"
              },
              "url": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Invoice file",
                    "subPathSegments": [
                      {
                        "key": "fileUrl",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3E7EB9A9-2337-49B7-8DCB-91B588C5C7DB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "STRING"
              }
            }
          ],
          "forceParsedOutput": true,
          "langSmithSettings": {
            "enabled": false,
            "apiKey": null,
            "projectName": null,
            "label": "FlowRunner AI-Agent",
            "accountCluster": "US"
          },
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "messagesHistoryEnabled": false,
          "messagesHistoryLimit": 15,
          "onFailElemId": null,
          "resultAlias": "Invoice reading",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You read carrier invoices that trucking companies email to a freight broker's accounts payable team. From the attached invoice, reply with JSON only, with these fields:\nloadNumber: the broker's load number printed on the invoice, or empty text if there is none\nproNumber: the PRO number, or empty text\ncarrier: the carrier's name\ninvoiceNumber: the carrier's invoice number, or empty text\ninvoiceTotal: the invoice total as a number, no currency sign\ncharges: every charge on the invoice on one line, separated by semicolons, each as name and amount, for example: Linehaul 1800.00; Fuel surcharge 210.00; Detention 150.00"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Email from "
              },
              {
                "id": "RESULT",
                "label": "Invoice email",
                "subPathSegments": [
                  {
                    "key": "fromAddress",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "89927563-94AC-401D-88CC-69461EFE592E"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nSubject: "
              },
              {
                "id": "RESULT",
                "label": "Invoice email",
                "subPathSegments": [
                  {
                    "key": "subject",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "89927563-94AC-401D-88CC-69461EFE592E"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\n"
              },
              {
                "id": "RESULT",
                "label": "Invoice email",
                "subPathSegments": [
                  {
                    "key": "snippet",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "89927563-94AC-401D-88CC-69461EFE592E"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Read the carrier invoice",
        "nextElementIds": [
          "95D3C5BC-73D1-45E0-9EA9-2134568D2FD0"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 450,
            "y": 219
          }
        },
        "flowElementId": "1F3BCC48-5FE2-4FA0-88F1-05A1BEBB6FBA",
        "groupId": null,
        "id": "64B36525-D018-4DC9-9636-D32761DD6EA9",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "34cf1be2-79b6-424c-9600-3d38951e9301",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Rate con check",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "matches",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "BDD9AEF1-E2A4-4BA8-85AA-82971B59DB83"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "34cf1be2-79b6-424c-9600-3d38951e9301"
            ]
          },
          "elseComponent": {
            "componentId": "B3B02171-2399-450D-9277-0C3EF584DF63",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "match",
          "storeResult": false,
          "thenComponent": {
            "componentId": "397918AC-8F0B-4803-AC05-B0F70036F32D",
            "componentType": "ELEMENT"
          }
        },
        "name": "Invoice matches the rate con?",
        "nextElementIds": [
          "397918AC-8F0B-4803-AC05-B0F70036F32D",
          "B3B02171-2399-450D-9277-0C3EF584DF63"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Creates a new Zendesk ticket with a first comment. Supports setting priority, type, status, requester (by email, the user is created if it does not exist), assignee, group, tags, and custom fields. Returns the created ticket.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::createTicket",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Open the exception ticket for AP Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::createTicket",
          "legacyElementId": "JS###v1###Zendesk###createTicket",
          "methodName": "createTicket",
          "position": {
            "x": 834,
            "y": 380
          }
        },
        "flowElementId": "98947B35-A977-46E3-B37A-7E4A0FF92BC4",
        "groupId": null,
        "id": "3C74F5B9-5D89-4326-B899-6ABE0DFED94E",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket text",
                    "subPathSegments": [
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B3B02171-2399-450D-9277-0C3EF584DF63"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "commentBody",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket text",
                    "subPathSegments": [
                      {
                        "key": "body",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B3B02171-2399-450D-9277-0C3EF584DF63"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "htmlBody",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "publicComment",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "priority",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "normal"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "type",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "task"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "requesterEmail",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "requesterName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "assigneeId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "groupId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "tags",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket text",
                    "subPathSegments": [
                      {
                        "key": "tags",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B3B02171-2399-450D-9277-0C3EF584DF63"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customFields",
              "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": "createTicket",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "AP ticket",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Open the exception ticket for AP",
        "nextElementIds": [
          "0E078F30-AA0E-428E-8BA3-71F43F587A77"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Adds labels to a message.",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::addLabelToMessage",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Label the invoice held for AP Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::addLabelToMessage",
          "legacyElementId": "JS###v1###GmailService###addLabelToMessage",
          "methodName": "addLabelToMessage",
          "position": {
            "x": 1234,
            "y": 380
          }
        },
        "flowElementId": "12606501-3176-4785-AAA3-2EF1B50143D9",
        "groupId": null,
        "id": "0E078F30-AA0E-428E-8BA3-71F43F587A77",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "messageId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Invoice email",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "89927563-94AC-401D-88CC-69461EFE592E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "labels",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "JSON",
                    "label": null,
                    "parsedValue": [
                      "Invoice exception"
                    ],
                    "type": "INPUT",
                    "value": "[\"Invoice exception\"]"
                  }
                ],
                "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": "addLabelToMessage",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Held label",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Label the invoice held for AP",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "89927563-94AC-401D-88CC-69461EFE592E",
    "groups": [],
    "id": "574B9E84-9F13-49BB-91C9-49B56D2367E0",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": null,
        "valid": true
      },
      "errorMessage": null,
      "executionStaticData": [
        {
          "description": "Your Anthropic API key, used by the AI steps that read the invoice and the rate con.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        }
      ],
      "initialData": null,
      "initialDataDefaultValues": {},
      "ownerFlowVersionId": null,
      "schedule": null,
      "sharedMemory": {
        "anchor": {
          "missingAnchorPolicy": null,
          "path": null,
          "type": "FLOW_MEMORY"
        },
        "expirationInSec": null
      },
      "wasLive": false
    }
  },
  "slaCalendars": [],
  "slaGoals": [],
  "subFlows": [],
  "exportDate": "2026-11-19T06:35:01.260Z"
}
