{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "3CB0C7F7-5C7C-4305-A5BF-89BB01FA836A",
    "name": "Freshdesk: disputed accessorial and TONU charges"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -61.78453403833443,
        "y": 2.987442167878392,
        "zoom": 0.93
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When a customer emails billing to dispute a detention, lumper, layover or TONU charge, opens a Freshdesk ticket with links to the load's paperwork in the mailbox, asks the billing lead in Slack whether to credit it, and answers the customer or notes the decision.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When a customer emails billing to dispute a detention, lumper, layover or TONU charge, opens a Freshdesk ticket with links to the load's paperwork in the mailbox, asks the billing lead in Slack whether to credit it, and answers the customer or notes the decision.",
    "elements": [
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Ask the billing lead Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 152,
            "y": 210
          }
        },
        "flowElementId": "042E4CBC-C2AC-4655-8024-3F48474320E9",
        "groupId": null,
        "id": "3898ECD2-60FA-4D46-98CB-075AF062B379",
        "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": "227B2B26-BBB5-4781-A925-8B200DE02746"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "blocks",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "227B2B26-BBB5-4781-A925-8B200DE02746"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Question to billing lead",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask the billing lead",
        "nextElementIds": [
          "33437E82-DBB1-4711-9031-0D18645B6AEC"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 549,
            "y": 389
          }
        },
        "flowElementId": "59B36791-9D41-4E77-BE66-0A7BF5A4C53A",
        "groupId": null,
        "id": "0FEC3779-9434-4176-92BA-A8FE90610E9B",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "efc1f1ed-1f0f-4914-affc-e36c189ac4f9",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "RESULT",
                      "label": "Billing decision",
                      "subPathSegments": [
                        {
                          "key": "decision",
                          "optional": false
                        }
                      ],
                      "type": "TRIGGER_DATA",
                      "value": "33437E82-DBB1-4711-9031-0D18645B6AEC"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "credit"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "efc1f1ed-1f0f-4914-affc-e36c189ac4f9"
            ]
          },
          "elseComponent": {
            "componentId": "434B0C07-1770-4B77-BF03-FDC903C48680",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Credit it",
          "storeResult": false,
          "thenComponent": {
            "componentId": "9961F9F1-A7CD-46EC-BCCF-E62F0EDD18D8",
            "componentType": "ELEMENT"
          }
        },
        "name": "Credit the charge?",
        "nextElementIds": [
          "9961F9F1-A7CD-46EC-BCCF-E62F0EDD18D8",
          "434B0C07-1770-4B77-BF03-FDC903C48680"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the ticket Result"
          },
          "position": {
            "x": 1324,
            "y": 219
          }
        },
        "flowElementId": "198063D3-A70F-4BE1-9AA5-412DB6525D5A",
        "groupId": null,
        "id": "A1BECD4F-6E50-4A54-A97C-5086E05F2B05",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "sender",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Dispute email",
                    "subPathSegments": [
                      {
                        "key": "fromAddress",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "B11D010F-30BB-4E92-BE6B-75346B199CD7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "emailId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Dispute email",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "B11D010F-30BB-4E92-BE6B-75346B199CD7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "loadNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "loadNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "invoiceNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "invoiceNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "proNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "proNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "reference",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "searchReference",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "chargeType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "chargeType",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "amount",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "amount",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "reason",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "reason",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customerName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "customerName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "paperwork",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Paperwork",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "1AF5D2D9-2F52-4CEE-9220-532900676E3A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const esc = (s) => String(s ?? '').replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\nconst mailLink = (id) => `https://mail.google.com/mail/u/0/#all/${id}`;\nconst docs = (Array.isArray(paperwork) ? paperwork : []).filter((m) => m && m.id && m.id !== emailId);\nconst docLines = docs.map((m) => {\n  const files = (m.attachments || []).map((a) => esc(a.filename)).join(', ');\n  return `<li><a href=\"${mailLink(m.id)}\">${esc(m.subject || '(no subject)')}</a> from ${esc(m.fromAddress)}${files ? ': ' + files : ''}</li>`;\n});\nconst charge = chargeType || 'charge';\nconst amt = Number(amount) > 0 ? ` of $${Number(amount).toFixed(2)}` : '';\nconst load = loadNumber || reference;\nconst who = customerName || sender;\nreturn {\n  subject: `Disputed ${charge}${amt} on load ${load}`,\n  description: [\n    `<p><b>${esc(who)}</b> disputes the ${esc(charge)} charge${amt} on load ${esc(load)}.</p>`,\n    `<p>Load: ${esc(loadNumber || 'not given')}<br>Invoice: ${esc(invoiceNumber || 'not given')}<br>PRO: ${esc(proNumber || 'not given')}</p>`,\n    `<p>Their reason: ${esc(reason)}</p>`,\n    `<p><a href=\"${mailLink(emailId)}\">Open the customer's email</a></p>`,\n    docLines.length\n      ? `<p>Paperwork in the billing mailbox for ${esc(reference)}:</p><ul>${docLines.join('')}</ul>`\n      : `<p>No email with attachments mentions ${esc(reference)} in the billing mailbox. Pull the rate con, BOL, POD and receipts by hand.</p>`,\n  ].join(''),\n  tags: ['billing-dispute', String(charge).toLowerCase()],\n  paperworkCount: docs.length,\n  load,\n  who,\n};"
              }
            ],
            "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",
        "nextElementIds": [
          "E1850BD0-0A60-4F37-B76F-A0BF2E756FBE"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Adds a public reply to a ticket. The reply is sent to the requester by email and appears in the ticket's conversation thread. The body supports HTML markup.",
          "elementId": "EXTENSION:::SHARED:::default:::freshdesk:::addReply",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Tell the customer it will be credited Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::freshdesk:::addReply",
          "legacyElementId": "JS###v1###FreshdeskService###addReply",
          "methodName": "addReply",
          "position": {
            "x": 905,
            "y": 380
          }
        },
        "flowElementId": "0410D0A2-67CA-4B4D-8BF5-CABC726C725E",
        "groupId": null,
        "id": "9961F9F1-A7CD-46EC-BCCF-E62F0EDD18D8",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "ticketId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute ticket",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E1850BD0-0A60-4F37-B76F-A0BF2E756FBE"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "body",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "<p>Hello,</p><p>We reviewed the "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "chargeType",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " charge on load "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket text",
                    "subPathSegments": [
                      {
                        "key": "load",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A1BECD4F-6E50-4A54-A97C-5086E05F2B05"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " that you questioned, and we will credit it. A corrected invoice will follow from our billing team.</p><p>Thank you for flagging it.</p>"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "ccEmails",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bccEmails",
              "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": "addReply",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Credit reply",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "freshdesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell the customer it will be credited",
        "nextElementIds": [
          "C3AA71E4-B929-44E7-BE83-8F5573E3C191"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the dispute Result"
          },
          "tools": {},
          "position": {
            "x": 549,
            "y": 49
          }
        },
        "flowElementId": "2D6635CE-E734-4F96-AD5A-89898EC2F59C",
        "groupId": null,
        "id": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8",
        "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": "Dispute",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You read emails that customers send to the billing team of a freight broker or carrier. Decide whether the customer is disputing or short-paying a charge we billed them, such as detention, lumper, layover, TONU, linehaul or fuel. Payment remittances, rate requests, load tenders and emails from carriers are not disputes. Reply with JSON only, with these fields:\nisDispute: true if the customer disputes or refuses a charge on our invoice, otherwise false\nloadNumber: the load number in the email, or empty text\ninvoiceNumber: our invoice number they refer to, or empty text\nproNumber: the PRO number, or empty text\nsearchReference: the load number if there is one, otherwise the invoice number, otherwise the PRO number, otherwise empty text\nchargeType: one of detention, lumper, layover, TONU, linehaul, fuel, other\namount: the disputed amount as a number, or 0 if they do not say\nreason: the customer's reason in one plain sentence\ncustomerName: the customer's company name, or the sender's name if no company is given"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "From: "
              },
              {
                "id": "RESULT",
                "label": "Dispute email",
                "subPathSegments": [
                  {
                    "key": "fromName",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "B11D010F-30BB-4E92-BE6B-75346B199CD7"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": " <"
              },
              {
                "id": "RESULT",
                "label": "Dispute email",
                "subPathSegments": [
                  {
                    "key": "fromAddress",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "B11D010F-30BB-4E92-BE6B-75346B199CD7"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ">\nSubject: "
              },
              {
                "id": "RESULT",
                "label": "Dispute email",
                "subPathSegments": [
                  {
                    "key": "subject",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "B11D010F-30BB-4E92-BE6B-75346B199CD7"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\n"
              },
              {
                "id": "RESULT",
                "label": "Dispute email",
                "subPathSegments": [
                  {
                    "key": "message",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "B11D010F-30BB-4E92-BE6B-75346B199CD7"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Read the dispute",
        "nextElementIds": [
          "23C64BC2-3D97-4E7A-A046-12A241B6E69F"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 936,
            "y": 49
          }
        },
        "flowElementId": "9A21C40A-130F-4CF6-B0D9-DE4BA274386B",
        "groupId": null,
        "id": "23C64BC2-3D97-4E7A-A046-12A241B6E69F",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "6aa2d787-3e1f-42bf-80a4-015cd5fb3b1f",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Dispute",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "isDispute",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              },
              {
                "id": "d1d1cd3e-1f42-47dd-931a-977986263174",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Dispute",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "searchReference",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "6aa2d787-3e1f-42bf-80a4-015cd5fb3b1f",
              "AND",
              "d1d1cd3e-1f42-47dd-931a-977986263174"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Is dispute",
          "storeResult": false,
          "thenComponent": {
            "componentId": "1AF5D2D9-2F52-4CEE-9220-532900676E3A",
            "componentType": "ELEMENT"
          }
        },
        "name": "Charge dispute on a load?",
        "nextElementIds": [
          "1AF5D2D9-2F52-4CEE-9220-532900676E3A"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "external-callback",
          "isFirstElement": false,
          "blockDefinitionId": "external-callback",
          "position": {
            "x": 110,
            "y": 389
          }
        },
        "flowElementId": "341892DF-EDCD-461E-B0D1-C299E3648D42",
        "groupId": null,
        "id": "33437E82-DBB1-4711-9031-0D18645B6AEC",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "resultAlias": "Billing decision",
          "slaConditions": [],
          "storeResult": true,
          "type": "CALLBACK"
        },
        "name": "Wait for the billing lead's answer",
        "nextElementIds": [
          "0FEC3779-9434-4176-92BA-A8FE90610E9B"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Adds a note to a ticket's conversation thread. Notes are private (visible only to agents) by default; set Private to false to create a public note visible to the requester. The body supports HTML markup.",
          "elementId": "EXTENSION:::SHARED:::default:::freshdesk:::addNote",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Note the credit to issue Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::freshdesk:::addNote",
          "legacyElementId": "JS###v1###FreshdeskService###addNote",
          "methodName": "addNote",
          "position": {
            "x": 1314,
            "y": 380
          }
        },
        "flowElementId": "F55825E2-41C6-4D41-8A65-BD57CDC1D6B2",
        "groupId": null,
        "id": "C3AA71E4-B929-44E7-BE83-8F5573E3C191",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "ticketId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute ticket",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E1850BD0-0A60-4F37-B76F-A0BF2E756FBE"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "body",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "<p>The billing lead approved a credit for the "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "chargeType",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " charge on load "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket text",
                    "subPathSegments": [
                      {
                        "key": "load",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A1BECD4F-6E50-4A54-A97C-5086E05F2B05"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " (amount the customer disputed: "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "amount",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "). The customer has been told. Issue the credit and send the corrected invoice, then resolve this ticket.</p>"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "private",
              "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": "addNote",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Credit note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "freshdesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Note the credit to issue",
        "nextElementIds": [],
        "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": 152,
            "y": 40
          }
        },
        "flowElementId": "AE787684-4FBE-41BB-9BDB-4B18C8935D14",
        "groupId": null,
        "id": "B11D010F-30BB-4E92-BE6B-75346B199CD7",
        "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": "Dispute email",
          "serviceId": "gmail-service",
          "slaConditions": [],
          "staticData": {
            "query": "(dispute OR disputing OR disputed OR \"short pay\" OR \"short paid\" OR detention OR lumper OR layover OR TONU) -from:me",
            "includeSpamTrash": false
          },
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New dispute email",
        "nextElementIds": [
          "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Adds a note to a ticket's conversation thread. Notes are private (visible only to agents) by default; set Private to false to create a public note visible to the requester. The body supports HTML markup.",
          "elementId": "EXTENSION:::SHARED:::default:::freshdesk:::addNote",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Note that the charge stands Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::freshdesk:::addNote",
          "legacyElementId": "JS###v1###FreshdeskService###addNote",
          "methodName": "addNote",
          "position": {
            "x": 930,
            "y": 510
          }
        },
        "flowElementId": "8AF93E38-9DC6-4A4C-8A52-D8A213C4AE82",
        "groupId": null,
        "id": "434B0C07-1770-4B77-BF03-FDC903C48680",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "ticketId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute ticket",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E1850BD0-0A60-4F37-B76F-A0BF2E756FBE"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "body",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "<p>The billing lead says the "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "chargeType",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " charge on load "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket text",
                    "subPathSegments": [
                      {
                        "key": "load",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A1BECD4F-6E50-4A54-A97C-5086E05F2B05"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " stands. Reply to the customer with the backup from the paperwork linked above (signed BOL or POD with in and out times, lumper receipt, or the TONU notice) and keep the invoice open.</p>"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "private",
              "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": "addNote",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Upheld note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "freshdesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Note that the charge stands",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the question for the billing lead Result"
          },
          "position": {
            "x": 493,
            "y": 219
          }
        },
        "flowElementId": "623DD3EF-36EE-4C66-90BD-A5BC5A4F6F69",
        "groupId": null,
        "id": "227B2B26-BBB5-4781-A925-8B200DE02746",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "who",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket text",
                    "subPathSegments": [
                      {
                        "key": "who",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A1BECD4F-6E50-4A54-A97C-5086E05F2B05"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "load",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket text",
                    "subPathSegments": [
                      {
                        "key": "load",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A1BECD4F-6E50-4A54-A97C-5086E05F2B05"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "chargeType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "chargeType",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "amount",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "amount",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "reason",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "reason",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "ticketId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute ticket",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E1850BD0-0A60-4F37-B76F-A0BF2E756FBE"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "paperworkCount",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket text",
                    "subPathSegments": [
                      {
                        "key": "paperworkCount",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A1BECD4F-6E50-4A54-A97C-5086E05F2B05"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "answerLink",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "PLACEHOLDER_DATA",
                    "label": "Answer link",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_STATIC_DATA",
                    "value": "Answer link"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "executionId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_ID",
                    "label": null,
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.executionId",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "executionId",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const link = (decision) => `${answerLink}?execution=${encodeURIComponent(executionId)}&decision=${decision}`;\nconst amt = Number(amount) > 0 ? ` of $${Number(amount).toFixed(2)}` : '';\nconst lines = [\n  `*${who} disputes the ${chargeType || 'charge'}${amt} on load ${load}*`,\n  `Their reason: ${reason}`,\n  `Freshdesk ticket #${ticketId} has the customer's email and ${paperworkCount} paperwork email${paperworkCount === 1 ? '' : 's'} for the load linked.`,\n  'Credit it, or let it stand?',\n];\nreturn {\n  text: `${who} disputes the ${chargeType || 'charge'} on load ${load}`,\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: 'Credit the charge' }, url: link('credit') },\n      { type: 'button', text: { type: 'plain_text', text: 'The charge stands' }, url: link('uphold') },\n    ] },\n  ],\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Question card",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the question for the billing lead",
        "nextElementIds": [
          "3898ECD2-60FA-4D46-98CB-075AF062B379"
        ],
        "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 load's paperwork Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::getMessagesList",
          "legacyElementId": "JS###v1###GmailService###getMessagesList",
          "methodName": "getMessagesList",
          "position": {
            "x": 1305,
            "y": 40
          }
        },
        "flowElementId": "554E52C2-65B0-4D65-88D1-0E4F9128B6DE",
        "groupId": null,
        "id": "1AF5D2D9-2F52-4CEE-9220-532900676E3A",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "query",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "\""
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Dispute",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "searchReference",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DA7D229D-47DB-4EC3-A1EF-CA9F8F5326B8"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "\" has:attachment"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "loadUnread",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "maxResults",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 10
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "labels",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EMPTY_LIST",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "arrays.create()"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "includeSpamTrash",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "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": "Paperwork",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the load's paperwork",
        "nextElementIds": [
          "A1BECD4F-6E50-4A54-A97C-5086E05F2B05"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Creates a new support ticket in Freshdesk. Provide either the requester Email or an existing Requester ID. The description supports HTML markup. Priority, status, and source take Freshdesk's numeric codes; group and agent can be selected from your Freshdesk account. Account-specific fields can be set via Custom Fields (keys must match the field names from List Ticket Fields, e.g. cf_order_id).",
          "elementId": "EXTENSION:::SHARED:::default:::freshdesk:::createTicket",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Open the dispute ticket Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::freshdesk:::createTicket",
          "legacyElementId": "JS###v1###FreshdeskService###createTicket",
          "methodName": "createTicket",
          "position": {
            "x": 945,
            "y": 210
          }
        },
        "flowElementId": "2BFA7BE9-4F0F-4EF3-B87D-37AD0DA43EFF",
        "groupId": null,
        "id": "E1850BD0-0A60-4F37-B76F-A0BF2E756FBE",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket text",
                    "subPathSegments": [
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A1BECD4F-6E50-4A54-A97C-5086E05F2B05"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "description",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket text",
                    "subPathSegments": [
                      {
                        "key": "description",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A1BECD4F-6E50-4A54-A97C-5086E05F2B05"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "email",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Dispute email",
                    "subPathSegments": [
                      {
                        "key": "fromAddress",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "B11D010F-30BB-4E92-BE6B-75346B199CD7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "requesterId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "priority",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "2"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "2"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "source",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "1"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "type",
              "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": "A1BECD4F-6E50-4A54-A97C-5086E05F2B05"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "ccEmails",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "groupId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "responderId",
              "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": "createTicket",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Dispute ticket",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "freshdesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Open the dispute ticket",
        "nextElementIds": [
          "227B2B26-BBB5-4781-A925-8B200DE02746"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "B11D010F-30BB-4E92-BE6B-75346B199CD7",
    "groups": [],
    "id": "19E9A008-571F-4CBB-99D9-16E9B2CD2344",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": null,
        "valid": true
      },
      "errorMessage": null,
      "executionStaticData": [
        {
          "description": "Anthropic API key the AI step uses.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "URL of the block Wait for the billing lead's answer. The Slack buttons open it.",
          "error": null,
          "name": "Answer link",
          "type": "STRING",
          "value": ""
        }
      ],
      "initialData": null,
      "initialDataDefaultValues": {},
      "ownerFlowVersionId": null,
      "schedule": null,
      "sharedMemory": {
        "anchor": {
          "missingAnchorPolicy": null,
          "path": null,
          "type": "FLOW_MEMORY"
        },
        "expirationInSec": null
      },
      "wasLive": false
    }
  },
  "slaCalendars": [],
  "slaGoals": [],
  "subFlows": [],
  "exportDate": "2026-11-19T06:35:37.481Z"
}
