{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "0CC2ACDE-1D81-433B-9700-036E6822536D",
    "name": "weclapp: quote reply to sales order"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": 166.34417503912016,
        "y": -79.94411425229504,
        "zoom": 0.5212328804205604
      },
      "autoSave": true,
      "descriptions": {
        "flow": "When a customer replies to a quotation by email, finds the open quotation in weclapp, matches what the customer asked for to its positions, checks stock, and asks the account owner in Slack before accepting it.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "When a customer replies to a quotation by email, finds the open quotation in weclapp, matches what the customer asked for to its positions, checks stock, and asks the account owner in Slack before accepting it.",
    "elements": [
      {
        "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": 35.17739869262934,
            "y": 296.5703023294463
          }
        },
        "flowElementId": "2D0A7213-2B4F-4547-9F53-5D738094C813",
        "groupId": null,
        "id": "EACF1341-E056-4165-9732-89790CB05306",
        "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": "Customer reply",
          "serviceId": "gmail-service",
          "slaConditions": [],
          "staticData": {
            "query": "subject:(quotation OR quote) -from:me",
            "includeSpamTrash": false
          },
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "Customer reply about a quotation",
        "nextElementIds": [
          "19B94D1E-3FC4-4197-862D-882A48789EAC"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "external-callback",
          "isFirstElement": false,
          "blockDefinitionId": "external-callback",
          "position": {
            "x": 751.8922631083265,
            "y": 670.8541360828747
          }
        },
        "flowElementId": "79DC0FCA-F01B-4141-9987-9EC131BC5D26",
        "groupId": null,
        "id": "4066E661-AC4B-44A3-85D8-E4967098B96E",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "resultAlias": "Owner decision",
          "slaConditions": [],
          "storeResult": true,
          "type": "CALLBACK"
        },
        "name": "Wait for the account owner's answer",
        "nextElementIds": [
          "9BCDE3C8-1F56-4D67-B45C-2C41152BA9F1"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves a single quotation by its weclapp identifier, including all quotation items, shipping cost items, addresses, status history, and calculated totals.",
          "elementId": "EXTENSION:::SHARED:::default:::weclapp:::getQuotation",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Load the quotation Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::weclapp:::getQuotation",
          "legacyElementId": "JS###v1###Weclapp###getQuotation",
          "methodName": "getQuotation",
          "position": {
            "x": 792.5887045397883,
            "y": 461.73455806996685
          }
        },
        "flowElementId": "02D69DD5-D4A9-48CD-860E-436B593BFE8D",
        "groupId": null,
        "id": "F08A46FC-DC17-46B9-AD50-6D169D8A0B76",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "quotationId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quotation search",
                    "subPathSegments": [
                      {
                        "index": 0,
                        "last": false
                      },
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "71592CFB-54AB-4B43-8602-3D70B7D89D8C"
                  }
                ],
                "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": "getQuotation",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Quotation",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "weclapp",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Load the quotation",
        "nextElementIds": [
          "7D986337-EA51-455E-B488-5053F34EBA13"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves a single party by its weclapp identifier, returning the complete record including addresses, bank accounts, contacts, role flags, and the version used for optimistic locking. Use this before updating a party so no unknown property is overwritten.",
          "elementId": "EXTENSION:::SHARED:::default:::weclapp:::getParty",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Load the customer Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::weclapp:::getParty",
          "legacyElementId": "JS###v1###Weclapp###getParty",
          "methodName": "getParty",
          "position": {
            "x": 464.8226116943175,
            "y": 465.5716145472679
          }
        },
        "flowElementId": "74D8D0D7-FF5C-4195-AE93-A3C88CBEE74C",
        "groupId": null,
        "id": "7D986337-EA51-455E-B488-5053F34EBA13",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "partyId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quotation",
                    "subPathSegments": [
                      {
                        "key": "customerId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F08A46FC-DC17-46B9-AD50-6D169D8A0B76"
                  }
                ],
                "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": "getParty",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Customer",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "weclapp",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Load the customer",
        "nextElementIds": [
          "22D893B1-E22C-4EEB-8C9B-23B80EBB77E6"
        ],
        "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 account owner Result"
          },
          "position": {
            "x": 26.08411697088613,
            "y": 678.5282490374767
          }
        },
        "flowElementId": "282658D4-5789-4071-9175-09E2DCB3E49B",
        "groupId": null,
        "id": "FEECE127-605E-4831-9A3E-D7CBC20D9CFA",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "quotationNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quotation",
                    "subPathSegments": [
                      {
                        "key": "quotationNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F08A46FC-DC17-46B9-AD50-6D169D8A0B76"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "netAmount",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quotation",
                    "subPathSegments": [
                      {
                        "key": "netAmount",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F08A46FC-DC17-46B9-AD50-6D169D8A0B76"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "company",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Customer",
                    "subPathSegments": [
                      {
                        "key": "company",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D986337-EA51-455E-B488-5053F34EBA13"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "firstName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Customer",
                    "subPathSegments": [
                      {
                        "key": "firstName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D986337-EA51-455E-B488-5053F34EBA13"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "lastName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Customer",
                    "subPathSegments": [
                      {
                        "key": "lastName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7D986337-EA51-455E-B488-5053F34EBA13"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "request",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Reply reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "request",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "19B94D1E-3FC4-4197-862D-882A48789EAC"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "acceptedItems",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request check",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "acceptedItems",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "22D893B1-E22C-4EEB-8C9B-23B80EBB77E6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "positions",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request check",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "positions",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "22D893B1-E22C-4EEB-8C9B-23B80EBB77E6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "stockShort",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request check",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "stockShort",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "22D893B1-E22C-4EEB-8C9B-23B80EBB77E6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customerNote",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request check",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "customerNote",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "22D893B1-E22C-4EEB-8C9B-23B80EBB77E6"
                  }
                ],
                "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 customerName = company || [firstName, lastName].filter(Boolean).join(' ') || 'The customer';\nconst items = (Array.isArray(acceptedItems) ? acceptedItems : [])\n  .filter((i) => i && i.quotationItemId && Number(i.quantity) > 0)\n  .map((i) => ({ quotationItemId: String(i.quotationItemId), quantity: String(i.quantity) }));\nconst lines = [\n  `*${customerName} answered quotation ${quotationNumber}*`,\n  `They asked for: ${request}`,\n  ...(Array.isArray(positions) ? positions : []).map((p) => `• ${p}`),\n  stockShort ? '*Stock on hand does not cover every position they want.*' : 'Stock on hand covers what they want.',\n  customerNote ? `Customer record: ${customerNote}` : null,\n  `Quoted net total: ${netAmount}`,\n].filter(Boolean);\nconst buttons = [];\nif (items.length) {\n  buttons.push({ type: 'button', style: 'primary', text: { type: 'plain_text', text: 'Accept what they asked for' }, url: link('asked') });\n}\nbuttons.push({ type: 'button', text: { type: 'plain_text', text: 'Accept the full quotation' }, url: link('full') });\nbuttons.push({ type: 'button', text: { type: 'plain_text', text: 'Leave it open' }, url: link('open') });\nreturn {\n  text: `${customerName} answered quotation ${quotationNumber}`,\n  blocks: [\n    { type: 'section', text: { type: 'mrkdwn', text: lines.join('\\n') } },\n    { type: 'actions', elements: buttons },\n  ],\n  acceptItems: items,\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 account owner",
        "nextElementIds": [
          "7FA88A11-BDBB-4F3C-82A1-2046B1A9F69C"
        ],
        "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": "Confirm the acceptance Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 829.5401005456573,
            "y": 1095.1905312577917
          }
        },
        "flowElementId": "13D636D3-5A17-4063-B2A8-C64BA2AE97DB",
        "groupId": null,
        "id": "3A4DEF4E-3AE4-4A4B-9A22-CD108811495A",
        "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": "Accepted. weclapp is creating the sales order for quotation "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quotation",
                    "subPathSegments": [
                      {
                        "key": "quotationNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F08A46FC-DC17-46B9-AD50-6D169D8A0B76"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to owner",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7FA88A11-BDBB-4F3C-82A1-2046B1A9F69C"
                  }
                ],
                "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": "Acceptance note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the acceptance",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 1152.9697774423178,
            "y": 467.3193155693435
          }
        },
        "flowElementId": "B0B9D72B-142A-4B20-A034-A7510CDB64B9",
        "groupId": null,
        "id": "5BAF29CD-4B75-498A-B405-F7481861A42F",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "88d8a7e2-d48e-4759-931d-e87612bf46b7",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Quotation search",
                      "subPathSegments": [
                        {
                          "index": 0,
                          "last": false
                        },
                        {
                          "key": "id",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "71592CFB-54AB-4B43-8602-3D70B7D89D8C"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "88d8a7e2-d48e-4759-931d-e87612bf46b7"
            ]
          },
          "elseComponent": {
            "componentId": "303892F0-3CBB-4C33-8135-E94657626F36",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Quotation open",
          "storeResult": false,
          "thenComponent": {
            "componentId": "F08A46FC-DC17-46B9-AD50-6D169D8A0B76",
            "componentType": "ELEMENT"
          }
        },
        "name": "Quotation still open?",
        "nextElementIds": [
          "303892F0-3CBB-4C33-8135-E94657626F36",
          "F08A46FC-DC17-46B9-AD50-6D169D8A0B76"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Match the request and check stock Result"
          },
          "tools": {
            "EXTENSION:::SHARED:::default:::weclapp:::listWarehouseStock": {
              "elementId": "EXTENSION:::SHARED:::default:::weclapp:::listWarehouseStock",
              "dynamicOptionsLabels": {}
            }
          },
          "position": {
            "x": 46.88569163227206,
            "y": 473.24572750187
          }
        },
        "flowElementId": "3A14CF3F-A76C-40F8-88B4-E48665D4A440",
        "groupId": null,
        "id": "22D893B1-E22C-4EEB-8C9B-23B80EBB77E6",
        "metaInfo": {
          "aiApiKey": null,
          "aiModel": "claude-sonnet-5",
          "aiProvider": "ANTHROPIC",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "dynamicAiApiKey": {
            "expression": [
              {
                "id": "PLACEHOLDER_DATA",
                "label": "Anthropic key",
                "subPathSegments": null,
                "type": "EXECUTION_CONTEXT_STATIC_DATA",
                "value": "Anthropic key"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "files": [],
          "forceParsedOutput": true,
          "langSmithSettings": {
            "enabled": false,
            "apiKey": null,
            "projectName": null,
            "label": "FlowRunner AI-Agent",
            "accountCluster": "US"
          },
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "messagesHistoryEnabled": false,
          "messagesHistoryLimit": 15,
          "onFailElemId": null,
          "resultAlias": "Request check",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You prepare a quotation acceptance in weclapp for an account owner to approve. You get the customer's email, the quotation positions and the customer record. For each position that has an articleId, call List Warehouse Stock with that articleId and add up the quantity of every record it returns; that sum is the stock on hand. Then reply with JSON only, with these fields:\nacceptedItems: one entry per position the customer accepts, each with quotationItemId (the position's id) and quantity (the quantity the customer asked for, or the quoted quantity if they did not change it). Leave out positions they decline. Use an empty list if you cannot tell which positions they mean.\npositions: a list with one line of text per quotation position: position number and title, quoted quantity, the quantity the customer wants or 'declined', and stock on hand\nstockShort: true if stock on hand is below the wanted quantity for any accepted position that is tracked in stock, otherwise false\ncustomerNote: one sentence on the payment terms and delivery address in the customer record, or empty text"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [
            {
              "connectionId": null,
              "definition": {},
              "enabled": true,
              "hostType": "SHARED",
              "methodName": "listWarehouseStock",
              "name": "List Warehouse Stock",
              "notes": "Lists warehouse stock records, each of which represents a quantity of one article on one storage place. Filter by article or warehouse to answer availability questions, and note that an article held on several storage places produces several records that have to be summed.",
              "packageId": "default",
              "params": [
                {
                  "name": "articleId",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "warehouseId",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "page",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "pageSize",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "sortBy",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                },
                {
                  "name": "sortDirection",
                  "type": "SIMPLE",
                  "value": {
                    "expression": [],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                }
              ],
              "serviceId": "weclapp",
              "type": "FR_FUNCTION"
            }
          ],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Customer email from "
              },
              {
                "id": "RESULT",
                "label": "Customer reply",
                "subPathSegments": [
                  {
                    "key": "fromAddress",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "EACF1341-E056-4165-9732-89790CB05306"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nSubject: "
              },
              {
                "id": "RESULT",
                "label": "Customer reply",
                "subPathSegments": [
                  {
                    "key": "subject",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "EACF1341-E056-4165-9732-89790CB05306"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\n"
              },
              {
                "id": "RESULT",
                "label": "Customer reply",
                "subPathSegments": [
                  {
                    "key": "message",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "EACF1341-E056-4165-9732-89790CB05306"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\nQuotation "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Quotation",
                "subPathSegments": [
                  {
                    "key": "quotationNumber",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "F08A46FC-DC17-46B9-AD50-6D169D8A0B76"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ", net total "
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Quotation",
                "subPathSegments": [
                  {
                    "key": "netAmount",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "F08A46FC-DC17-46B9-AD50-6D169D8A0B76"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ". Positions:\n"
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Quotation",
                "subPathSegments": [
                  {
                    "key": "quotationItems",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "F08A46FC-DC17-46B9-AD50-6D169D8A0B76"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\nCustomer record:\n"
              },
              {
                "id": "ELEMENT_RESULT",
                "label": "Customer",
                "subPathSegments": null,
                "type": "ELEMENT_LINK",
                "value": "7D986337-EA51-455E-B488-5053F34EBA13"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Match the request and check stock",
        "nextElementIds": [
          "FEECE127-605E-4831-9A3E-D7CBC20D9CFA"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Tell the account owner it's missing Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1114.901448633077,
            "y": 668.593953411074
          }
        },
        "flowElementId": "D171BBF9-66B7-4969-96CE-02603115DD54",
        "groupId": null,
        "id": "303892F0-3CBB-4C33-8135-E94657626F36",
        "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": "RESULT",
                    "label": "Customer reply",
                    "subPathSegments": [
                      {
                        "key": "fromAddress",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "EACF1341-E056-4165-9732-89790CB05306"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " replied about quotation "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Reply reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "quotationNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "19B94D1E-3FC4-4197-862D-882A48789EAC"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " and seems to accept it, but weclapp has no open quotation with that number. Their request: "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Reply reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "request",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "19B94D1E-3FC4-4197-862D-882A48789EAC"
                  }
                ],
                "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": "Missing quotation note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell the account owner it's missing",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "router",
          "isFirstElement": false,
          "blockDefinitionId": "router",
          "casesViewMode": {
            "cf9ba121-9cb9-4fc6-be19-a2dcf07af2a8": "SIMPLE",
            "c8aafe24-26c3-4e0f-a6b3-f22ca8a1eea1": "SIMPLE"
          },
          "position": {
            "x": 86.46520026036237,
            "y": 910.6701659141908
          }
        },
        "flowElementId": "CECD3E7A-C0E4-44C1-8785-9041523373B1",
        "groupId": null,
        "id": "9BCDE3C8-1F56-4D67-B45C-2C41152BA9F1",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Owner answer",
          "storeResult": true,
          "switchCases": [
            {
              "defaultCase": false,
              "id": "cf9ba121-9cb9-4fc6-be19-a2dcf07af2a8",
              "label": "Accept what they asked for",
              "nextComponents": [
                {
                  "componentId": "CE78D2F5-49D7-4CB0-B309-0FB72B796936",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "asked"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": false,
              "id": "c8aafe24-26c3-4e0f-a6b3-f22ca8a1eea1",
              "label": "Accept the full quotation",
              "nextComponents": [
                {
                  "componentId": "C093F68F-E216-426F-AE3F-9B945E4162B6",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "full"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": true,
              "id": "f017925e-661d-40c4-911c-c4cb5d222faf",
              "label": "Everything Else",
              "nextComponents": [
                {
                  "componentId": "EB91156F-9AB1-4A64-B857-5B78F8005F0B",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": null
            }
          ],
          "switchExpression": {
            "expression": [
              {
                "id": "RESULT",
                "label": "Owner decision",
                "subPathSegments": [
                  {
                    "key": "decision",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "4066E661-AC4B-44A3-85D8-E4967098B96E"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Which answer?",
        "nextElementIds": [
          "C093F68F-E216-426F-AE3F-9B945E4162B6",
          "EB91156F-9AB1-4A64-B857-5B78F8005F0B",
          "CE78D2F5-49D7-4CB0-B309-0FB72B796936"
        ],
        "nextGroupIds": [],
        "type": "VALUE_ROUTER"
      },
      {
        "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 account owner Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 450.3810936764233,
            "y": 667.0170796055736
          }
        },
        "flowElementId": "AA187DDB-1256-44EC-BE56-1DE84F44580D",
        "groupId": null,
        "id": "7FA88A11-BDBB-4F3C-82A1-2046B1A9F69C",
        "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": "FEECE127-605E-4831-9A3E-D7CBC20D9CFA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "blocks",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "FEECE127-605E-4831-9A3E-D7CBC20D9CFA"
                  }
                ],
                "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 owner",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask the account owner",
        "nextElementIds": [
          "4066E661-AC4B-44A3-85D8-E4967098B96E"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the customer's reply Result"
          },
          "tools": {},
          "position": {
            "x": 400,
            "y": 310
          }
        },
        "flowElementId": "C733E314-70B6-4DEA-9779-A1C65B75A3DE",
        "groupId": null,
        "id": "19B94D1E-3FC4-4197-862D-882A48789EAC",
        "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": "Reply reading",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You read emails that customers send in reply to a sales quotation. Reply with JSON only, with these fields:\nquotationNumber: the quotation number the email refers to, from the subject or the body, exactly as written, or empty text if there is none\naccepts: true if the customer accepts the quotation in full or in part, false if they decline it, only ask a question, or write about something else\nrequest: one sentence saying what the customer asks for, naming the positions and quantities as they wrote them"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "From "
              },
              {
                "id": "RESULT",
                "label": "Customer reply",
                "subPathSegments": [
                  {
                    "key": "fromAddress",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "EACF1341-E056-4165-9732-89790CB05306"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\nSubject: "
              },
              {
                "id": "RESULT",
                "label": "Customer reply",
                "subPathSegments": [
                  {
                    "key": "subject",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "EACF1341-E056-4165-9732-89790CB05306"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\n"
              },
              {
                "id": "RESULT",
                "label": "Customer reply",
                "subPathSegments": [
                  {
                    "key": "message",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "EACF1341-E056-4165-9732-89790CB05306"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Read the customer's reply",
        "nextElementIds": [
          "6E4F0453-8844-43FB-A3BE-44DEB4DAD69D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 789.7634684098275,
            "y": 313.837056477301
          }
        },
        "flowElementId": "9BDDEA5A-EEAE-422C-8C0F-91D933DC76F8",
        "groupId": null,
        "id": "6E4F0453-8844-43FB-A3BE-44DEB4DAD69D",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "e39c960c-9679-4d2b-a54d-7a702f3601e7",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Reply reading",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "accepts",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "19B94D1E-3FC4-4197-862D-882A48789EAC"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              },
              {
                "id": "c11cc6ad-6582-4c08-a92f-d74c65e740ac",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Reply reading",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "quotationNumber",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "19B94D1E-3FC4-4197-862D-882A48789EAC"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "e39c960c-9679-4d2b-a54d-7a702f3601e7",
              "AND",
              "c11cc6ad-6582-4c08-a92f-d74c65e740ac"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Accepts a quotation",
          "storeResult": false,
          "thenComponent": {
            "componentId": "71592CFB-54AB-4B43-8602-3D70B7D89D8C",
            "componentType": "ELEMENT"
          }
        },
        "name": "Accepts a quotation?",
        "nextElementIds": [
          "71592CFB-54AB-4B43-8602-3D70B7D89D8C"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Accepts a quotation on behalf of the customer and lets weclapp create the follow up record configured on the quotation, which is normally a sales order. Specify the accepted positions and quantities to accept only part of the quotation, or leave them empty to accept everything.",
          "elementId": "EXTENSION:::SHARED:::default:::weclapp:::acceptQuotation",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Accept the full quotation Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::weclapp:::acceptQuotation",
          "legacyElementId": "JS###v1###Weclapp###acceptQuotation",
          "methodName": "acceptQuotation",
          "position": {
            "x": 833.0749210591885,
            "y": 903.3377073927385
          }
        },
        "flowElementId": "90445AB9-175F-4450-984E-00E0274B6BDD",
        "groupId": null,
        "id": "C093F68F-E216-426F-AE3F-9B945E4162B6",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "quotationId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quotation",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F08A46FC-DC17-46B9-AD50-6D169D8A0B76"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "acceptQuotationItems",
              "type": "COMPLEX_LIST",
              "value": []
            },
            {
              "name": "startDate",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "endDate",
              "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": "acceptQuotation",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Full acceptance",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "weclapp",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Accept the full quotation",
        "nextElementIds": [
          "3A4DEF4E-3AE4-4A4B-9A22-CD108811495A"
        ],
        "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": "Confirm it stays open Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 65.66362559897647,
            "y": 1092.5886941528418
          }
        },
        "flowElementId": "B2DF1BF9-12DB-4983-8327-C59420A30D2E",
        "groupId": null,
        "id": "EB91156F-9AB1-4A64-B857-5B78F8005F0B",
        "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": "Left open. Quotation "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quotation",
                    "subPathSegments": [
                      {
                        "key": "quotationNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F08A46FC-DC17-46B9-AD50-6D169D8A0B76"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " stays as it is in weclapp."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question to owner",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "7FA88A11-BDBB-4F3C-82A1-2046B1A9F69C"
                  }
                ],
                "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": "Open note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm it stays open",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Lists sales quotations with their status, customer, validity dates, and calculated net and gross amounts. Filter by status, customer, or quotation date range to build pipeline reports or to find quotations awaiting a decision.",
          "elementId": "EXTENSION:::SHARED:::default:::weclapp:::listQuotations",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the quotation in weclapp Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::weclapp:::listQuotations",
          "legacyElementId": "JS###v1###Weclapp###listQuotations",
          "methodName": "listQuotations",
          "position": {
            "x": 1118.134033182838,
            "y": 302.3258870453979
          }
        },
        "flowElementId": "D49387C4-FA85-4005-8A6D-2586150CA41C",
        "groupId": null,
        "id": "71592CFB-54AB-4B43-8602-3D70B7D89D8C",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "OPEN"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customerId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "quotationNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Reply reading",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "quotationNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "19B94D1E-3FC4-4197-862D-882A48789EAC"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "quotationDateFrom",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "quotationDateTo",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "page",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "pageSize",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 1
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sortBy",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sortDirection",
              "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": "listQuotations",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Quotation search",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "weclapp",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the quotation in weclapp",
        "nextElementIds": [
          "5BAF29CD-4B75-498A-B405-F7481861A42F"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Accepts a quotation on behalf of the customer and lets weclapp create the follow up record configured on the quotation, which is normally a sales order. Specify the accepted positions and quantities to accept only part of the quotation, or leave them empty to accept everything.",
          "elementId": "EXTENSION:::SHARED:::default:::weclapp:::acceptQuotation",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Accept what the customer asked for Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::weclapp:::acceptQuotation",
          "legacyElementId": "JS###v1###Weclapp###acceptQuotation",
          "methodName": "acceptQuotation",
          "position": {
            "x": 407.161652078771,
            "y": 1091.0118203473407
          }
        },
        "flowElementId": "78024CE5-2ADC-44A0-98A3-886F05F22778",
        "groupId": null,
        "id": "CE78D2F5-49D7-4CB0-B309-0FB72B796936",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "quotationId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Quotation",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F08A46FC-DC17-46B9-AD50-6D169D8A0B76"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "acceptQuotationItems",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Question card",
                    "subPathSegments": [
                      {
                        "key": "acceptItems",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "FEECE127-605E-4831-9A3E-D7CBC20D9CFA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "startDate",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "endDate",
              "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": "acceptQuotation",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Partial acceptance",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "weclapp",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Accept what the customer asked for",
        "nextElementIds": [
          "3A4DEF4E-3AE4-4A4B-9A22-CD108811495A"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "EACF1341-E056-4165-9732-89790CB05306",
    "groups": [],
    "id": "9FD657DA-CEBB-4E18-98DF-7FEB4F695895",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": null,
        "valid": true
      },
      "errorMessage": null,
      "executionStaticData": [
        {
          "description": "Your Anthropic API key, used by the two AI steps.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        },
        {
          "description": "The URL of the block Wait for the account owner'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-17T05:55:53.958Z"
}
