{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "1D9E54EE-95AD-45F6-A43B-12474FDA07C7",
    "name": "Zendesk: carrier told when invoice ticket solved"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -55.00308451573103,
        "y": 5.453423812461445,
        "zoom": 0.86
      },
      "autoSave": false,
      "descriptions": {
        "flow": "When AP solves a carrier invoice exception ticket in Zendesk, reads AP's comments, emails the carrier the decision in the original invoice thread, posts the outcome to Slack, and tags the ticket carrier_told so the carrier hears once. A ticket with no carrier email or no decision comment goes to AP in Slack instead.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When AP solves a carrier invoice exception ticket in Zendesk, emails the carrier AP's decision in the original invoice thread, posts the outcome to Slack, and tags the ticket so the carrier is told once.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 523,
            "y": 219
          }
        },
        "flowElementId": "91068B10-6497-4572-8E9C-CB9F84C96A83",
        "groupId": null,
        "id": "50F3CD3B-A38B-4C62-B7E6-505B732D4864",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "189ec4eb-9c3f-4f2d-8614-53364cf53855",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Ticket facts",
                      "subPathSegments": [
                        {
                          "key": "carrierEmail",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "4FE97E51-E6D9-4FD3-90C3-B24BF92F8BB6"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              },
              {
                "id": "749d4081-2c99-477e-8bb5-835325f062e0",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Ticket facts",
                      "subPathSegments": [
                        {
                          "key": "decisions",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "4FE97E51-E6D9-4FD3-90C3-B24BF92F8BB6"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "189ec4eb-9c3f-4f2d-8614-53364cf53855",
              "AND",
              "749d4081-2c99-477e-8bb5-835325f062e0"
            ]
          },
          "elseComponent": {
            "componentId": "FCE31FFA-D283-458F-B2F4-EB5A2EA5348B",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "has",
          "storeResult": false,
          "thenComponent": {
            "componentId": "6F243E71-8F29-4623-9340-DBCE393C34C2",
            "componentType": "ELEMENT"
          }
        },
        "name": "Carrier email and a decision on the ticket?",
        "nextElementIds": [
          "FCE31FFA-D283-458F-B2F4-EB5A2EA5348B",
          "6F243E71-8F29-4623-9340-DBCE393C34C2"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves a single Zendesk ticket by ID, including subject, description, status, priority, requester, assignee, group, tags, and custom fields.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::getTicket",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Get the ticket Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::getTicket",
          "legacyElementId": "JS###v1###Zendesk###getTicket",
          "methodName": "getTicket",
          "position": {
            "x": 596,
            "y": 40
          }
        },
        "flowElementId": "ADC37B4E-E330-433A-AE56-AB46695D13AA",
        "groupId": null,
        "id": "B53AAFB1-8B8C-4BF8-B342-9A089E560C13",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "ticketId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Ticket event",
                    "subPathSegments": [
                      {
                        "key": "ticketId",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "7EF12D59-6735-4BE3-9AF2-97864193616B"
                  }
                ],
                "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": "getTicket",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Ticket",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Get the ticket",
        "nextElementIds": [
          "C3852157-355D-4DF1-92EF-D8544B8DECF7"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the carrier and AP's decision Result"
          },
          "position": {
            "x": 968,
            "y": 219
          }
        },
        "flowElementId": "7083C9A4-5486-4225-A77C-7353C546ED40",
        "groupId": null,
        "id": "4FE97E51-E6D9-4FD3-90C3-B24BF92F8BB6",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "comments",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket comments",
                    "subPathSegments": [
                      {
                        "key": "comments",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "D6EFC0C0-4C06-47CF-8230-C8AFDA61D8F9"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "tags",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket",
                    "subPathSegments": [
                      {
                        "key": "tags",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B53AAFB1-8B8C-4BF8-B342-9A089E560C13"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const list = Array.isArray(comments) ? comments : [];\nconst first = (list[0] && list[0].body) || '';\nconst pick = re => (first.match(re) || [])[1] || '';\nconst carrierEmail = pick(/Carrier email:\\s*(\\S+@\\S+)/);\nconst threadId = pick(/Gmail thread:\\s*([A-Za-z0-9]+)/);\nconst decisions = list.slice(1)\n  .map(c => `${c.public ? 'Reply' : 'Internal note'} (${c.created_at}): ${c.body}`)\n  .join('\\n\\n');\nconst newTags = [...(Array.isArray(tags) ? tags : []), 'carrier_told'];\nreturn { carrierEmail, threadId, details: first, decisions, tags: newTags };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Ticket facts",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Find the carrier and AP's decision",
        "nextElementIds": [
          "50F3CD3B-A38B-4C62-B7E6-505B732D4864"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Ask AP to tell the carrier Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 583,
            "y": 380
          }
        },
        "flowElementId": "0FCCA650-3B9A-4AD0-982F-244834BA7021",
        "groupId": null,
        "id": "FCE31FFA-D283-458F-B2F4-EB5A2EA5348B",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Carrier invoice ticket solved, but the carrier was not emailed: the ticket has no carrier email or no decision comment from AP. Please tell the carrier yourself. "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket",
                    "subPathSegments": [
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B53AAFB1-8B8C-4BF8-B342-9A089E560C13"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ": "
                  },
                  {
                    "id": "RESULT",
                    "label": "Ticket event",
                    "subPathSegments": [
                      {
                        "key": "ticketUrl",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "7EF12D59-6735-4BE3-9AF2-97864193616B"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "COMPLEX_LIST",
              "value": []
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Manual reply message",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask AP to tell the carrier",
        "nextElementIds": [
          "BFE47CBA-3B4B-4013-8E3A-6C55AD9ED04C"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Updates an existing ticket's subject, status, priority, type, assignee, group, or tags. Only the fields you provide are changed; tags, when provided, replace the ticket's existing tags. Returns the updated ticket.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::updateTicket",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Tag the ticket carrier told Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::updateTicket",
          "legacyElementId": "JS###v1###Zendesk###updateTicket",
          "methodName": "updateTicket",
          "position": {
            "x": 996,
            "y": 640
          }
        },
        "flowElementId": "03B35F4A-C3E6-4A95-BECC-DBFA0D4E1141",
        "groupId": null,
        "id": "BFE47CBA-3B4B-4013-8E3A-6C55AD9ED04C",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "ticketId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B53AAFB1-8B8C-4BF8-B342-9A089E560C13"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "priority",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "type",
              "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 facts",
                    "subPathSegments": [
                      {
                        "key": "tags",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4FE97E51-E6D9-4FD3-90C3-B24BF92F8BB6"
                  }
                ],
                "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": "updateTicket",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Tagged ticket",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tag the ticket carrier told",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Fires when a ticket is created or updated in Zendesk. Provisions a Zendesk webhook plus a business-rule trigger that posts the ticket's ID, subject, status, priority, type, requester, assignee, and URL to FlowRunner in real time.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::onTicketEvent",
          "isFirstElement": true,
          "blockDefinitionId": "api-service-trigger",
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::onTicketEvent",
          "legacyElementId": "JS###v1###Zendesk###onTicketEvent",
          "methodName": "onTicketEvent",
          "position": {
            "x": 146,
            "y": 40
          }
        },
        "flowElementId": "5548C60D-DDBC-4375-837A-1B4B567D222F",
        "groupId": null,
        "id": "7EF12D59-6735-4BE3-9AF2-97864193616B",
        "metaInfo": {
          "callbackUrl": null,
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "connectionId": null,
          "eventName": "onTicketEvent",
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Ticket event",
          "scope": "SINGLE_APP",
          "serviceId": "zendesk",
          "slaConditions": [],
          "staticData": {
            "event": "updated"
          },
          "storeResult": true,
          "subtype": "REALTIME",
          "type": "CUSTOM"
        },
        "name": "Ticket updated in Zendesk",
        "nextElementIds": [
          "B53AAFB1-8B8C-4BF8-B342-9A089E560C13"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Lists all comments on a ticket in chronological order, including each comment's author, plain-text and HTML bodies, public/private flag, and attachments.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::listTicketComments",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read AP's comments on the ticket Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::listTicketComments",
          "legacyElementId": "JS###v1###Zendesk###listTicketComments",
          "methodName": "listTicketComments",
          "position": {
            "x": 1357,
            "y": 210
          }
        },
        "flowElementId": "53393531-DCCC-4851-BB59-8A45F122AA75",
        "groupId": null,
        "id": "D6EFC0C0-4C06-47CF-8230-C8AFDA61D8F9",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "ticketId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B53AAFB1-8B8C-4BF8-B342-9A089E560C13"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "perPage",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "page",
              "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": "listTicketComments",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Ticket comments",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read AP's comments on the ticket",
        "nextElementIds": [
          "4FE97E51-E6D9-4FD3-90C3-B24BF92F8BB6"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the reply to the carrier Result"
          },
          "tools": {},
          "position": {
            "x": 140,
            "y": 219
          }
        },
        "flowElementId": "7FB462E7-EC45-40F3-B03A-B012CCF676C0",
        "groupId": null,
        "id": "6F243E71-8F29-4623-9340-DBCE393C34C2",
        "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": "Carrier reply",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You write the reply a freight broker's accounts payable team sends a carrier about a carrier invoice that did not match the rate con. You get the ticket the invoice was held in: first the exception details, then the AP team's comments. Use only what AP decided in their comments. Do not add charges, amounts, promises or payment dates AP did not write. Reply with JSON only, with these fields:\ndecision: one of paying in full, paying the rate con amount, paying part, not paying, or need more from the carrier\namountToPay: the amount AP said it will pay, as a number, or empty text if AP did not say\nsubject: the email subject, naming the carrier's invoice number and the load number\nbody: a short, polite plain-text email to the carrier: which invoice and load, what AP decided and why, and what the carrier should do next if anything (for example send a corrected invoice, or proof for detention or lumper). Sign it Accounts Payable.\nsummary: one sentence for the AP channel saying what was decided"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Ticket: "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Ticket",
                "subPathSegments": [
                  {
                    "key": "subject",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "B53AAFB1-8B8C-4BF8-B342-9A089E560C13"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\nException details:\n"
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Ticket facts",
                "subPathSegments": [
                  {
                    "key": "details",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "4FE97E51-E6D9-4FD3-90C3-B24BF92F8BB6"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\nAP's comments:\n"
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Ticket facts",
                "subPathSegments": [
                  {
                    "key": "decisions",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "4FE97E51-E6D9-4FD3-90C3-B24BF92F8BB6"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Write the reply to the carrier",
        "nextElementIds": [
          "032C4BF9-D1A2-4AB0-A544-9372D625464E"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1404,
            "y": 49
          }
        },
        "flowElementId": "2628B720-B1C8-420F-B63B-8EE9C8F0A164",
        "groupId": null,
        "id": "56E0BD50-6E7A-48B0-B7FA-9E7FBEF30C1C",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "7eebcf6c-894f-4c69-bec5-f823ea082ff4",
                "nestedOperation": null,
                "operation": "arrayContainsValue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Ticket",
                      "subPathSegments": [
                        {
                          "key": "tags",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "B53AAFB1-8B8C-4BF8-B342-9A089E560C13"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "ARRAY",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "carrier_told"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "7eebcf6c-894f-4c69-bec5-f823ea082ff4"
            ]
          },
          "elseComponent": {
            "componentId": "D6EFC0C0-4C06-47CF-8230-C8AFDA61D8F9",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "told",
          "storeResult": false,
          "thenComponent": null
        },
        "name": "Carrier already told?",
        "nextElementIds": [
          "D6EFC0C0-4C06-47CF-8230-C8AFDA61D8F9"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Sends emails through Gmail for AI agents to automate customer communication.",
          "elementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Email the carrier in the invoice thread Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::gmail-service:::sendMessage",
          "legacyElementId": "JS###v1###GmailService###sendMessage",
          "methodName": "sendMessage",
          "position": {
            "x": 110,
            "y": 640
          }
        },
        "flowElementId": "317CBFDA-B49E-4AC8-B8D3-7E0B79726494",
        "groupId": null,
        "id": "032C4BF9-D1A2-4AB0-A544-9372D625464E",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "to",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket facts",
                    "subPathSegments": [
                      {
                        "key": "carrierEmail",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4FE97E51-E6D9-4FD3-90C3-B24BF92F8BB6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Carrier reply",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6F243E71-8F29-4623-9340-DBCE393C34C2"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyType",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "plain"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bodyContent",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Carrier reply",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "body",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6F243E71-8F29-4623-9340-DBCE393C34C2"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "from",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "cc",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "bcc",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket facts",
                    "subPathSegments": [
                      {
                        "key": "threadId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4FE97E51-E6D9-4FD3-90C3-B24BF92F8BB6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachments",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessage",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Carrier email sent",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "gmail-service",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Email the carrier in the invoice thread",
        "nextElementIds": [
          "08EA691F-329C-4922-8F34-FD0C8B43D156"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Post the outcome to AP Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 585,
            "y": 640
          }
        },
        "flowElementId": "90F6759C-5DBB-4E30-8D79-0A7A4884DE3A",
        "groupId": null,
        "id": "08EA691F-329C-4922-8F34-FD0C8B43D156",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Carrier invoice exception solved: "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket",
                    "subPathSegments": [
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "B53AAFB1-8B8C-4BF8-B342-9A089E560C13"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "\n"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Carrier reply",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "summary",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "6F243E71-8F29-4623-9340-DBCE393C34C2"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "\nThe carrier was emailed at "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket facts",
                    "subPathSegments": [
                      {
                        "key": "carrierEmail",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "4FE97E51-E6D9-4FD3-90C3-B24BF92F8BB6"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ". Ticket: "
                  },
                  {
                    "id": "RESULT",
                    "label": "Ticket event",
                    "subPathSegments": [
                      {
                        "key": "ticketUrl",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "7EF12D59-6735-4BE3-9AF2-97864193616B"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "COMPLEX_LIST",
              "value": []
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Outcome message",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Post the outcome to AP",
        "nextElementIds": [
          "BFE47CBA-3B4B-4013-8E3A-6C55AD9ED04C"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 984,
            "y": 49
          }
        },
        "flowElementId": "E9BCE704-2285-4A2F-8867-065715D4F73B",
        "groupId": null,
        "id": "C3852157-355D-4DF1-92EF-D8544B8DECF7",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "91a1485e-1c6c-4b41-a802-56be90e09d03",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Ticket",
                      "subPathSegments": [
                        {
                          "key": "status",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "B53AAFB1-8B8C-4BF8-B342-9A089E560C13"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "solved"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              },
              {
                "id": "4f10bd13-59a0-40e5-94fe-8ebb7ff512c8",
                "nestedOperation": null,
                "operation": "arrayContainsValue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Ticket",
                      "subPathSegments": [
                        {
                          "key": "tags",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "B53AAFB1-8B8C-4BF8-B342-9A089E560C13"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "ARRAY",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "carrier_invoice"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "91a1485e-1c6c-4b41-a802-56be90e09d03",
              "AND",
              "4f10bd13-59a0-40e5-94fe-8ebb7ff512c8"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "cond",
          "storeResult": false,
          "thenComponent": {
            "componentId": "56E0BD50-6E7A-48B0-B7FA-9E7FBEF30C1C",
            "componentType": "ELEMENT"
          }
        },
        "name": "Solved carrier invoice ticket?",
        "nextElementIds": [
          "56E0BD50-6E7A-48B0-B7FA-9E7FBEF30C1C"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      }
    ],
    "firstElementId": "7EF12D59-6735-4BE3-9AF2-97864193616B",
    "groups": [],
    "id": "46D1712A-4CB7-4CD9-8573-6D3E1B85B4DA",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": null,
        "valid": true
      },
      "errorMessage": null,
      "executionStaticData": [
        {
          "description": "Your Anthropic API key, used by the AI step that writes the reply to the carrier.",
          "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:05.934Z"
}
