{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "F7AC7ED1-0C32-4E68-B015-947B146AEA00",
    "name": "Product Docs - Slack Approvals"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -560.5,
        "y": -593.25,
        "zoom": 1
      },
      "autoSave": true,
      "descriptions": {
        "flow": "",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "",
    "elements": [
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Slack: approval failed Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 3361,
            "y": 732
          }
        },
        "flowElementId": "A5F085B0-BEB8-4E84-88CB-C14F3FD04CDB",
        "groupId": null,
        "id": "6F948BAF-CC32-4D67-BA4D-1D54F08B0363",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "click",
                    "subPathSegments": [
                      {
                        "key": "channel_id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "F7C3E53B-97C4-4C1E-A9F1-D1E724EE8E25"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ":rotating_light: *Approval step failed* for review `"
                  },
                  {
                    "id": "RESULT",
                    "label": "click",
                    "subPathSegments": [
                      {
                        "key": "action_value",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "F7C3E53B-97C4-4C1E-A9F1-D1E724EE8E25"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "` ("
                  },
                  {
                    "id": "RESULT",
                    "label": "click",
                    "subPathSegments": [
                      {
                        "key": "action_id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "F7C3E53B-97C4-4C1E-A9F1-D1E724EE8E25"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ", clicked by "
                  },
                  {
                    "id": "RESULT",
                    "label": "click",
                    "subPathSegments": [
                      {
                        "key": "user_name",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "F7C3E53B-97C4-4C1E-A9F1-D1E724EE8E25"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "). Writes are not retried automatically to avoid duplicate rows - check the flow run log and Staging, then click the button again."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "click",
                    "subPathSegments": [
                      {
                        "key": "message_ts",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "F7C3E53B-97C4-4C1E-A9F1-D1E724EE8E25"
                  }
                ],
                "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_TRUE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": true
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "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": "sendMessageToChannel",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "slackErrB",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Slack: approval failed",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "error-handler",
          "isFirstElement": false,
          "blockDefinitionId": "error-handler",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Add to Products failed Result"
          },
          "position": {
            "x": 3046,
            "y": 88
          }
        },
        "flowElementId": "0D872477-8E8D-4A04-A597-FA1E20CCC6B4",
        "groupId": null,
        "id": "E6FF38F4-5774-4030-9883-77D648E2552E",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "eh_addProduct",
          "saveToVariable": null,
          "storeResult": true
        },
        "name": "Add to Products failed",
        "nextElementIds": [
          "6F948BAF-CC32-4D67-BA4D-1D54F08B0363"
        ],
        "nextGroupIds": [],
        "type": "ERROR_HANDLER"
      },
      {
        "clientMetadata": {
          "elementId": "error-handler",
          "isFirstElement": false,
          "blockDefinitionId": "error-handler",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Update Staging failed Result"
          },
          "position": {
            "x": 3046,
            "y": 576
          }
        },
        "flowElementId": "82A3EDC6-1E28-43DB-AF09-7DC45C88FBC4",
        "groupId": null,
        "id": "63DFE958-89A5-4BF3-BBF9-645084B7BFA7",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "eh_updStaging",
          "saveToVariable": null,
          "storeResult": true
        },
        "name": "Update Staging failed",
        "nextElementIds": [
          "6F948BAF-CC32-4D67-BA4D-1D54F08B0363"
        ],
        "nextGroupIds": [],
        "type": "ERROR_HANDLER"
      },
      {
        "clientMetadata": {
          "notes": "Adds new data rows to Google Sheets for AI agents to store processed results, log user interactions, or collect data from automated workflows. Perfect for building databases, tracking metrics, saving form submissions, or creating data collection pipelines.",
          "elementId": "EXTENSION:::SHARED:::default:::google-sheets:::addRow",
          "isFirstElement": false,
          "dynamicOptionLabels": {
            "documentId": {},
            "sheetId": {
              "1944998269": "Audit log"
            }
          },
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Add row to Audit log Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-sheets:::addRow",
          "legacyElementId": "JS###v1###GoogleSheets###addRow",
          "methodName": "addRow",
          "position": {
            "x": 2733,
            "y": 337
          }
        },
        "flowElementId": "F46E9259-151D-4EDC-BE11-87BAB9815535",
        "groupId": null,
        "id": "7A7BA01B-D9E6-48AF-AE5B-329BF7949E5E",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sheetId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 1944998269
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "row",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "decide",
                    "subPathSegments": [
                      {
                        "key": "audit",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F1133171-E1F1-4C15-9AFE-9073E3FE61DA"
                  }
                ],
                "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": "addRow",
          "onFailElemId": "29D7669B-A6B4-4E5F-B717-46FC5EFC4170",
          "packageId": "default",
          "resultAlias": "addAuditB",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-sheets",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Add row to Audit log",
        "nextElementIds": [
          "A8362569-9667-4703-8682-BB5588CDC9C4"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "error-handler",
          "isFirstElement": false,
          "blockDefinitionId": "error-handler",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Decision step failed Result"
          },
          "position": {
            "x": 3046,
            "y": 1127
          }
        },
        "flowElementId": "94FF7B62-F67A-4767-B74B-2BEC52D3E1AA",
        "groupId": null,
        "id": "B3E25550-7CF8-4987-876E-460CA93A19BE",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "eh_decide",
          "saveToVariable": null,
          "storeResult": true
        },
        "name": "Decision step failed",
        "nextElementIds": [
          "6F948BAF-CC32-4D67-BA4D-1D54F08B0363"
        ],
        "nextGroupIds": [],
        "type": "ERROR_HANDLER"
      },
      {
        "clientMetadata": {
          "elementId": "error-handler",
          "isFirstElement": false,
          "blockDefinitionId": "error-handler",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Audit log write failed Result"
          },
          "position": {
            "x": 3046,
            "y": 420
          }
        },
        "flowElementId": "0F905195-B9BA-4595-A327-B08EFC9EC7C9",
        "groupId": null,
        "id": "29D7669B-A6B4-4E5F-B717-46FC5EFC4170",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "eh_addAuditB",
          "saveToVariable": null,
          "storeResult": true
        },
        "name": "Audit log write failed",
        "nextElementIds": [
          "6F948BAF-CC32-4D67-BA4D-1D54F08B0363"
        ],
        "nextGroupIds": [],
        "type": "ERROR_HANDLER"
      },
      {
        "clientMetadata": {
          "notes": "Updates existing data in Google Sheets for AI agents to modify records, correct information, or maintain data accuracy in automated workflows. Perfect for updating user profiles, adjusting scores, or maintaining dynamic data that changes over time.",
          "elementId": "EXTENSION:::SHARED:::default:::google-sheets:::updateRow",
          "isFirstElement": false,
          "dynamicOptionLabels": {
            "documentId": {},
            "sheetId": {
              "979899611": "Staging"
            }
          },
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Mark Staging row approved / rejected Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-sheets:::updateRow",
          "legacyElementId": "JS###v1###GoogleSheets###updateRow",
          "methodName": "updateRow",
          "position": {
            "x": 2408,
            "y": 415
          }
        },
        "flowElementId": "C07C320C-FA69-498D-A287-8000EAED9DC3",
        "groupId": null,
        "id": "65718469-B685-4BEB-BAFA-63811E2B029D",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sheetId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 979899611
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "rowNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "decide",
                    "subPathSegments": [
                      {
                        "key": "stagingRow",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F1133171-E1F1-4C15-9AFE-9073E3FE61DA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "rowData",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "decide",
                    "subPathSegments": [
                      {
                        "key": "stagingUpdate",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F1133171-E1F1-4C15-9AFE-9073E3FE61DA"
                  }
                ],
                "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": "updateRow",
          "onFailElemId": "63DFE958-89A5-4BF3-BBF9-645084B7BFA7",
          "packageId": "default",
          "resultAlias": "updStaging",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-sheets",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Mark Staging row approved / rejected",
        "nextElementIds": [
          "7A7BA01B-D9E6-48AF-AE5B-329BF7949E5E"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Triggered when a user clicks a button or interacts with a Block Kit element in a Slack message. Use this to build approval flows, interactive forms, or any workflow that requires human input via Slack buttons. Outputs include the action ID, value, clicking user, channel, and original message timestamp.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::onBlockAction",
          "isFirstElement": true,
          "blockDefinitionId": "api-service-trigger",
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::onBlockAction",
          "legacyElementId": "JS###v1###slack###onBlockAction",
          "methodName": "onBlockAction",
          "position": {
            "x": 136.5,
            "y": 856
          }
        },
        "flowElementId": "D81FC991-DA84-4C08-AE74-C2DB2F1ECF94",
        "groupId": null,
        "id": "F7C3E53B-97C4-4C1E-A9F1-D1E724EE8E25",
        "metaInfo": {
          "callbackUrl": null,
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "connectionId": null,
          "eventName": "onBlockAction",
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "click",
          "scope": "ALL_APPS",
          "serviceId": "slack",
          "slaConditions": [],
          "staticData": {},
          "storeResult": true,
          "subtype": "REALTIME",
          "type": "CUSTOM"
        },
        "name": "Button clicked in #product-data",
        "nextElementIds": [
          "CC5137B6-66CA-4718-9865-C331749619F7"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "router",
          "isFirstElement": false,
          "blockDefinitionId": "router",
          "casesViewMode": {
            "f2282605-28a5-4962-9bb1-6a34a27babc4": "SIMPLE",
            "f3c7ef99-fbd9-4465-90cb-45dfbe1e4513": "SIMPLE",
            "6a764751-3319-4811-afa0-fbbf5c62a60d": "SIMPLE",
            "aae952ca-a6cd-451f-aef1-f1ed0fbe2c6c": "SIMPLE",
            "3b0befa8-3744-46c7-8780-f9bdc4204650": "SIMPLE"
          },
          "position": {
            "x": 1704,
            "y": 562
          }
        },
        "flowElementId": "D5AC98A6-5B21-446B-BE4B-2ED2DD14CCA0",
        "groupId": null,
        "id": "0BB79A96-099D-4508-87CB-9AEDB94E0E7D",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "r1",
          "storeResult": true,
          "switchCases": [
            {
              "defaultCase": false,
              "id": "f2282605-28a5-4962-9bb1-6a34a27babc4",
              "label": "New product",
              "nextComponents": [
                {
                  "componentId": "B24806ED-95DF-49D9-B84F-F9912F8E5475",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "add"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": false,
              "id": "f3c7ef99-fbd9-4465-90cb-45dfbe1e4513",
              "label": "Existing product",
              "nextComponents": [
                {
                  "componentId": "EB532D80-07B9-4F9B-98C0-C25525B8412C",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "update"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": false,
              "id": "6a764751-3319-4811-afa0-fbbf5c62a60d",
              "label": "Rejected",
              "nextComponents": [
                {
                  "componentId": "65718469-B685-4BEB-BAFA-63811E2B029D",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "reject"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": false,
              "id": "aae952ca-a6cd-451f-aef1-f1ed0fbe2c6c",
              "label": "Already decided / not found",
              "nextComponents": [
                {
                  "componentId": "7240519A-0471-4A98-A741-0DC187BAFD8F",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "noop"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": false,
              "id": "3b0befa8-3744-46c7-8780-f9bdc4204650",
              "label": "Correction typed in Slack",
              "nextComponents": [
                {
                  "componentId": "36A8DE3A-9C16-4977-9E52-26ECA76D6E34",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "edit"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": true,
              "id": "55f14c47-5516-43fc-b48b-8af1194eddae",
              "label": "Everything Else",
              "nextComponents": [],
              "type": "SIMPLE",
              "value": null
            }
          ],
          "switchExpression": {
            "expression": [
              {
                "id": "ELEMENT_RESULT",
                "label": "decide",
                "subPathSegments": [
                  {
                    "key": "op",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "F1133171-E1F1-4C15-9AFE-9073E3FE61DA"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Add, update, reject, or nothing to do",
        "nextElementIds": [
          "B24806ED-95DF-49D9-B84F-F9912F8E5475",
          "EB532D80-07B9-4F9B-98C0-C25525B8412C",
          "7240519A-0471-4A98-A741-0DC187BAFD8F",
          "65718469-B685-4BEB-BAFA-63811E2B029D",
          "36A8DE3A-9C16-4977-9E52-26ECA76D6E34"
        ],
        "nextGroupIds": [],
        "type": "VALUE_ROUTER"
      },
      {
        "clientMetadata": {
          "notes": "Adds new data rows to Google Sheets for AI agents to store processed results, log user interactions, or collect data from automated workflows. Perfect for building databases, tracking metrics, saving form submissions, or creating data collection pipelines.",
          "elementId": "EXTENSION:::SHARED:::default:::google-sheets:::addRow",
          "isFirstElement": false,
          "dynamicOptionLabels": {
            "documentId": {},
            "sheetId": {
              "649813233": "Products"
            }
          },
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Add product to Products Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-sheets:::addRow",
          "legacyElementId": "JS###v1###GoogleSheets###addRow",
          "methodName": "addRow",
          "position": {
            "x": 2054,
            "y": 38
          }
        },
        "flowElementId": "9177DEEC-E8E7-4036-8BD1-1A8766B233F8",
        "groupId": null,
        "id": "B24806ED-95DF-49D9-B84F-F9912F8E5475",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sheetId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 649813233
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "row",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "decide",
                    "subPathSegments": [
                      {
                        "key": "productRow",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F1133171-E1F1-4C15-9AFE-9073E3FE61DA"
                  }
                ],
                "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": "addRow",
          "onFailElemId": "E6FF38F4-5774-4030-9883-77D648E2552E",
          "packageId": "default",
          "resultAlias": "addProduct",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-sheets",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Add product to Products",
        "nextElementIds": [
          "65718469-B685-4BEB-BAFA-63811E2B029D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Updates existing data in Google Sheets for AI agents to modify records, correct information, or maintain data accuracy in automated workflows. Perfect for updating user profiles, adjusting scores, or maintaining dynamic data that changes over time.",
          "elementId": "EXTENSION:::SHARED:::default:::google-sheets:::updateRow",
          "isFirstElement": false,
          "dynamicOptionLabels": {
            "documentId": {},
            "sheetId": {
              "649813233": "Products"
            }
          },
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Update product in Products Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-sheets:::updateRow",
          "legacyElementId": "JS###v1###GoogleSheets###updateRow",
          "methodName": "updateRow",
          "position": {
            "x": 2054,
            "y": 493
          }
        },
        "flowElementId": "3DAB08CD-9B88-44DD-B0BC-4C056FEDD279",
        "groupId": null,
        "id": "EB532D80-07B9-4F9B-98C0-C25525B8412C",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sheetId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 649813233
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "rowNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "decide",
                    "subPathSegments": [
                      {
                        "key": "productsRowNumber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F1133171-E1F1-4C15-9AFE-9073E3FE61DA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "rowData",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "decide",
                    "subPathSegments": [
                      {
                        "key": "productRow",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F1133171-E1F1-4C15-9AFE-9073E3FE61DA"
                  }
                ],
                "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": "updateRow",
          "onFailElemId": "493F6892-546D-4442-B308-C31017AE0966",
          "packageId": "default",
          "resultAlias": "updProduct",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-sheets",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Update product in Products",
        "nextElementIds": [
          "65718469-B685-4BEB-BAFA-63811E2B029D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Updates a specific message in a Slack channel. Supports plain text updates or replacing the entire message content with Block Kit JSON. Commonly used after a button click to swap interactive buttons with a confirmation message.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::updateMessageInChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Replace buttons with the decision Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::updateMessageInChannel",
          "legacyElementId": "JS###v1###slack###updateMessageInChannel",
          "methodName": "updateMessageInChannel",
          "position": {
            "x": 3046,
            "y": 254
          }
        },
        "flowElementId": "67C2A6ED-75B5-41FD-BCD5-8F33BEEC1305",
        "groupId": null,
        "id": "A8362569-9667-4703-8682-BB5588CDC9C4",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "click",
                    "subPathSegments": [
                      {
                        "key": "channel_id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "F7C3E53B-97C4-4C1E-A9F1-D1E724EE8E25"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "click",
                    "subPathSegments": [
                      {
                        "key": "message_ts",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "F7C3E53B-97C4-4C1E-A9F1-D1E724EE8E25"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "decide",
                    "subPathSegments": [
                      {
                        "key": "message",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F1133171-E1F1-4C15-9AFE-9073E3FE61DA"
                  }
                ],
                "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": [],
                "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": "updateMessageInChannel",
          "onFailElemId": "C2447791-07D9-41A7-A7E9-AC67B36B0785",
          "packageId": "default",
          "resultAlias": "updMsg",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Replace buttons with the decision",
        "nextElementIds": [],
        "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": "Reply in thread: nothing to do Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 2054,
            "y": 989
          }
        },
        "flowElementId": "3AA8AC64-BF8C-4735-9A5F-222AB1CB7F51",
        "groupId": null,
        "id": "7240519A-0471-4A98-A741-0DC187BAFD8F",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "click",
                    "subPathSegments": [
                      {
                        "key": "channel_id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "F7C3E53B-97C4-4C1E-A9F1-D1E724EE8E25"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "decide",
                    "subPathSegments": [
                      {
                        "key": "message",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F1133171-E1F1-4C15-9AFE-9073E3FE61DA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "click",
                    "subPathSegments": [
                      {
                        "key": "message_ts",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "F7C3E53B-97C4-4C1E-A9F1-D1E724EE8E25"
                  }
                ],
                "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": [],
                "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": "noopReply",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Reply in thread: nothing to do",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Work out the decision and changes Result"
          },
          "position": {
            "x": 1335.5,
            "y": 700
          }
        },
        "flowElementId": "BF9700A9-A00B-4C7C-8C26-DC3F87D5E39A",
        "groupId": null,
        "id": "F1133171-E1F1-4C15-9AFE-9073E3FE61DA",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "click",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "click",
                    "subPathSegments": null,
                    "type": "TRIGGER_DATA",
                    "value": "F7C3E53B-97C4-4C1E-A9F1-D1E724EE8E25"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "stagingHit",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "findStaging",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "94CD1456-1501-4D1C-A69B-373ED44E3825"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "productHit",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "findProduct",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "FD6D4DA8-2512-4BA7-BE9A-B1D0584D3B2A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "// Inputs: click (Slack block action), stagingHit / productHit (Find Row results: { rowData, rowNumber } or \"\" when no match).\n// Only single rows come in, so the request stays small no matter how big the sheets grow.\nconst FIELDS = ['Product Name', 'Specifications', 'Price', 'Availability', 'Packaging', 'Application Notes', 'Safety Data', 'Compliance'];\nconst COLS = ['Product Code'];\nfor (const l of FIELDS) { COLS.push(l + ' (as written)'); COLS.push(l === 'Price' ? 'Price (USD)' : l + ' (normalized)'); }\nconst now = new Date().toISOString();\n\nconst hit = (h) => {\n  if (typeof h === 'string') { if (!h.trim()) return null; try { h = JSON.parse(h); } catch (e) { return null; } }\n  return (h && h.rowData && typeof h.rowData === 'object') ? Object.assign({}, h.rowData, { rowNumber: h.rowNumber }) : null;\n};\nconst rowNum = (r) => {\n  if (!r) return null;\n  for (const k of Object.keys(r)) if (/^_*row_?number$/i.test(k.replace(/\\s+/g, '_'))) return Number(r[k]);\n  return null;\n};\nconst clean = (v) => String(v === null || v === undefined ? '' : v).replace(/\\s+/g, ' ').trim();\n\nlet c = click;\nif (typeof c === 'string') c = JSON.parse(c);\nconst actionId = c.action_id;\nconst isEdit = actionId === 'product_edit';\n// For an edit, the review ID and field come from block_id (\"edit|<reviewId>|<field>\") and action_value is the typed text.\nconst editParts = isEdit ? String(c.block_id || '').split('|') : [];\nconst reviewId = isEdit ? clean(editParts[1]) : clean(c.action_value);\nconst editField = isEdit ? clean(editParts[2]) : '';\nconst who = c.user_display_name || c.user_name || c.user_id || 'unknown';\nconst base = { reviewId, who, channelId: c.channel_id, messageTs: c.message_ts, now };\n\nif (actionId !== 'product_approve' && actionId !== 'product_reject' && !isEdit) return Object.assign(base, { op: 'ignore' });\n\nconst s0 = hit(stagingHit);\nconst s = s0 && clean(s0['Review ID']) === reviewId ? s0 : null;\nif (!s) return Object.assign(base, { op: 'noop', message: ':grey_question: Review `' + reviewId + '` was not found in Staging. Nothing was changed.' });\nconst stagingRow = rowNum(s);\nif (!stagingRow) throw new Error('Get Rows did not return row numbers for Staging');\n\nconst status = clean(s['Status']).toLowerCase();\nif (status !== 'pending_review') {\n  return Object.assign(base, { op: 'noop', message: ':information_source: Review `' + reviewId + '` was already ' + (status || 'processed') + (s['Decided By'] ? ' by ' + s['Decided By'] : '') + '. Nothing was changed.' });\n}\n\nif (isEdit) {\n  const LABELS = { product_code: 'Product Code' };\n  for (const l of FIELDS) LABELS[l.toLowerCase().replace(/ /g, '_')] = l;\n  const label = LABELS[editField];\n  if (!label) return Object.assign(base, { op: 'noop', message: ':warning: Unknown field `' + editField + '` in this edit box. Nothing was changed.' });\n  const col = label === 'Product Code' ? 'Product Code' : (label === 'Price' ? 'Price (USD)' : label + ' (normalized)');\n  const raw = c.action_value === undefined || c.action_value === null ? '' : String(c.action_value);\n  if (clean(raw) === '') {\n    return Object.assign(base, { op: 'noop', message: ':warning: The edit for *' + label + '* arrived with no text (action_value was empty), so nothing was changed. If you did type a value, the Slack trigger is not passing input text through.' });\n  }\n  const value = raw.trim();\n  const stagingUpdate = {};\n  stagingUpdate[col] = value;\n  return Object.assign(base, {\n    op: 'edit', stagingRow, stagingUpdate,\n    message: ':white_check_mark: ' + who + ' set *' + col + '* to `' + value.slice(0, 500) + '` in Staging row ' + stagingRow + '. Click Approve when all corrections are in.',\n  });\n}\n\nconst code = clean(s['Product Code']);\nconst docName = s['Document Name'] || '';\nconst docModified = s['Document Modified'] || '';\n\nif (actionId === 'product_reject') {\n  return Object.assign(base, {\n    op: 'reject', stagingRow, code,\n    stagingUpdate: { 'Status': 'rejected', 'Decided By': who, 'Decided At': now },\n    audit: { 'Timestamp': now, 'Document Name': docName, 'Document Modified': docModified, 'Product Code': code, 'Review ID': reviewId, 'Change': 'rejected - Products not changed', 'Human Reviewed': 'yes', 'Approved By': '', 'Decided At': now },\n    message: ':x: *Rejected* by ' + who + ' - `' + code + '` (review `' + reviewId + '`). Products was not changed.',\n  });\n}\n\n// Approve: the Staging row (possibly edited by the reviewer) is the source of truth.\nif (!code) return Object.assign(base, { op: 'noop', message: ':pencil2: Can\\'t approve review `' + reviewId + '` yet: its Staging row (row ' + stagingRow + ') has no Product Code. Type the code into that row, then click Approve again.' });\nlet proposed = {};\ntry { proposed = JSON.parse(s['Proposed (JSON)'] || '{}'); } catch (e) { proposed = {}; }\n\nconst productRow = {};\nconst corrections = [];\nfor (const col of COLS) {\n  const val = s[col] === undefined || s[col] === null ? '' : s[col];\n  // Only write columns that have a value, so a field the document did not state never blanks out Products.\n  if (clean(val) !== '') productRow[col] = val;\n  const orig = proposed[col] === undefined || proposed[col] === null ? '' : proposed[col];\n  if (clean(val) !== clean(orig)) corrections.push(col + ': \"' + clean(orig) + '\" -> \"' + clean(val) + '\"');\n}\nproductRow['Source Document'] = docName;\nproductRow['Source Link'] = s['Document Link'] || '';\nproductRow['Last Approved By'] = who;\nproductRow['Last Updated'] = now;\n\nconst p0 = hit(productHit);\nconst existing = p0 && clean(p0['Product Code']).toUpperCase() === code.toUpperCase() ? p0 : null;\nconst existingRow = existing ? rowNum(existing) : null;\nif (existing && !existingRow) throw new Error('Get Rows did not return row numbers for Products');\n\nconst changed = [];\nif (existing) {\n  delete productRow['Product Code']; // keep the code exactly as it is in Products\n  for (const col of COLS) if (productRow[col] !== undefined && clean(productRow[col]) !== clean(existing[col])) changed.push(col);\n} else {\n  for (const col of COLS) if (productRow[col] !== undefined) changed.push(col);\n}\n\nconst corrected = corrections.length > 0;\nconst verb = corrected ? 'approved with corrections' : 'approved';\nconst changeText = verb + ' - ' + (existing ? 'updated Products row ' + existingRow : 'added to Products') +\n  (changed.length ? ' (' + changed.join(', ') + ')' : ' (no column changed)') +\n  (corrected ? ' - corrections: ' + corrections.join('; ') : '');\n\nreturn Object.assign(base, {\n  op: existing ? 'update' : 'add',\n  stagingRow, code, productRow, productsRowNumber: existingRow,\n  stagingUpdate: { 'Status': 'approved', 'Decided By': who, 'Decided At': now },\n  audit: { 'Timestamp': now, 'Document Name': docName, 'Document Modified': docModified, 'Product Code': code, 'Review ID': reviewId, 'Change': changeText.slice(0, 45000), 'Human Reviewed': 'yes', 'Approved By': who, 'Decided At': now },\n  message: ':white_check_mark: *' + (corrected ? 'Approved with corrections' : 'Approved') + '* by ' + who + ' - `' + code + '` ' + (existing ? 'updated in' : 'added to') + ' Products' + (corrected ? '\\nCorrections: ' + corrections.join('; ').slice(0, 2500) : ''),\n});\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": "B3E25550-7CF8-4987-876E-460CA93A19BE",
          "resultAlias": "decide",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Work out the decision and changes",
        "nextElementIds": [
          "0BB79A96-099D-4508-87CB-9AEDB94E0E7D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "error-handler",
          "isFirstElement": false,
          "blockDefinitionId": "error-handler",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Update Products failed Result"
          },
          "position": {
            "x": 3046,
            "y": 732
          }
        },
        "flowElementId": "3220A80A-8C5A-40FC-A461-E23ED7F9AF9B",
        "groupId": null,
        "id": "493F6892-546D-4442-B308-C31017AE0966",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "eh_updProduct",
          "saveToVariable": null,
          "storeResult": true
        },
        "name": "Update Products failed",
        "nextElementIds": [
          "6F948BAF-CC32-4D67-BA4D-1D54F08B0363"
        ],
        "nextGroupIds": [],
        "type": "ERROR_HANDLER"
      },
      {
        "clientMetadata": {
          "elementId": "error-handler",
          "isFirstElement": false,
          "blockDefinitionId": "error-handler",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Apply correction failed Result"
          },
          "position": {
            "x": 3911,
            "y": 218
          }
        },
        "flowElementId": "37373365-9431-4DEA-A2D8-1655EF382304",
        "groupId": null,
        "id": "C934AF40-A08E-4457-9121-1458ED7097A1",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "ehEdit",
          "saveToVariable": null,
          "storeResult": true
        },
        "name": "Apply correction failed",
        "nextElementIds": [
          "6F948BAF-CC32-4D67-BA4D-1D54F08B0363"
        ],
        "nextGroupIds": [],
        "type": "ERROR_HANDLER"
      },
      {
        "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": "Reply in thread: correction saved Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 3911,
            "y": 38
          }
        },
        "flowElementId": "C5E9E62D-6CB6-4DF8-8345-643087832053",
        "groupId": null,
        "id": "B68EE591-643B-4A4B-A4C4-6E90B6B79B08",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "click",
                    "subPathSegments": [
                      {
                        "key": "channel_id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "F7C3E53B-97C4-4C1E-A9F1-D1E724EE8E25"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "decide",
                    "subPathSegments": [
                      {
                        "key": "message",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F1133171-E1F1-4C15-9AFE-9073E3FE61DA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "click",
                    "subPathSegments": [
                      {
                        "key": "message_ts",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "F7C3E53B-97C4-4C1E-A9F1-D1E724EE8E25"
                  }
                ],
                "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": [],
                "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": "editReply",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Reply in thread: correction saved",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Updates existing data in Google Sheets for AI agents to modify records, correct information, or maintain data accuracy in automated workflows. Perfect for updating user profiles, adjusting scores, or maintaining dynamic data that changes over time.",
          "elementId": "EXTENSION:::SHARED:::default:::google-sheets:::updateRow",
          "isFirstElement": false,
          "dynamicOptionLabels": {
            "documentId": {},
            "sheetId": {
              "979899611": "Staging"
            }
          },
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Apply correction to Staging row Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-sheets:::updateRow",
          "legacyElementId": "JS###v1###GoogleSheets###updateRow",
          "methodName": "updateRow",
          "position": {
            "x": 3621,
            "y": 128
          }
        },
        "flowElementId": "38C340BA-96E4-4C63-9AB6-FFBDEBCB2DD0",
        "groupId": null,
        "id": "36A8DE3A-9C16-4977-9E52-26ECA76D6E34",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sheetId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 979899611
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "rowNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "decide",
                    "subPathSegments": [
                      {
                        "key": "stagingRow",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F1133171-E1F1-4C15-9AFE-9073E3FE61DA"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "rowData",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "decide",
                    "subPathSegments": [
                      {
                        "key": "stagingUpdate",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F1133171-E1F1-4C15-9AFE-9073E3FE61DA"
                  }
                ],
                "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": "updateRow",
          "onFailElemId": "C934AF40-A08E-4457-9121-1458ED7097A1",
          "packageId": "default",
          "resultAlias": "applyEdit",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-sheets",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Apply correction to Staging row",
        "nextElementIds": [
          "B68EE591-643B-4A4B-A4C4-6E90B6B79B08"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Which review is this click about? Result"
          },
          "position": {
            "x": 4171,
            "y": 308
          }
        },
        "flowElementId": "E4CD64CA-2002-42E0-A104-F11F71D13B5C",
        "groupId": null,
        "id": "1FD61660-5C58-46FB-8F3A-6FC40B961474",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "click",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "click",
                    "subPathSegments": null,
                    "type": "TRIGGER_DATA",
                    "value": "F7C3E53B-97C4-4C1E-A9F1-D1E724EE8E25"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "// Small first step: work out which review this click is about, so only that Staging row is fetched.\nlet c = click;\nif (typeof c === 'string') c = JSON.parse(c);\nconst rid = c.action_id === 'product_edit' ? String(c.block_id || '').split('|')[1] : c.action_value;\nconst reviewId = String(rid || '').trim();\nreturn { reviewId: reviewId || '__no_review_id__' };\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": "ADF39DE7-3650-4E04-BB6F-2BA6A026382A",
          "resultAlias": "pre",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Which review is this click about?",
        "nextElementIds": [
          "94CD1456-1501-4D1C-A69B-373ED44E3825"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "error-handler",
          "isFirstElement": false,
          "blockDefinitionId": "error-handler",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find in Products failed Result"
          },
          "position": {
            "x": 5331,
            "y": 108
          }
        },
        "flowElementId": "DAB113BF-C8EF-4DA3-9D93-365C520BC155",
        "groupId": null,
        "id": "896AF165-ACFA-4195-900A-B995FE0A8105",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "eh_findProduct",
          "saveToVariable": null,
          "storeResult": true
        },
        "name": "Find in Products failed",
        "nextElementIds": [
          "6F948BAF-CC32-4D67-BA4D-1D54F08B0363"
        ],
        "nextGroupIds": [],
        "type": "ERROR_HANDLER"
      },
      {
        "clientMetadata": {
          "notes": "Finds a specific row in a specified sheet within a spreadsheet based on a column and value.",
          "elementId": "EXTENSION:::SHARED:::default:::google-sheets:::findSheetRow",
          "isFirstElement": false,
          "dynamicOptionLabels": {
            "column": {
              "Review ID": "Review ID"
            },
            "documentId": {},
            "sheetId": {
              "979899611": "Staging"
            }
          },
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find this review in Staging Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-sheets:::findSheetRow",
          "legacyElementId": "JS###v1###GoogleSheets###findSheetRow",
          "methodName": "findSheetRow",
          "position": {
            "x": 4461,
            "y": 218
          }
        },
        "flowElementId": "D7142D95-CC91-413A-BE42-E576A21A721B",
        "groupId": null,
        "id": "94CD1456-1501-4D1C-A69B-373ED44E3825",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sheetId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 979899611
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "column",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Review ID"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "value",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "pre",
                    "subPathSegments": [
                      {
                        "key": "reviewId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "1FD61660-5C58-46FB-8F3A-6FC40B961474"
                  }
                ],
                "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": "findSheetRow",
          "onFailElemId": "45637CDD-28E8-4311-80B2-9D4E90DB0851",
          "packageId": "default",
          "resultAlias": "findStaging",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-sheets",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find this review in Staging",
        "nextElementIds": [
          "94E7FC27-C496-4074-AD57-14A6600A04C8"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "error-handler",
          "isFirstElement": false,
          "blockDefinitionId": "error-handler",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Picking the product code failed Result"
          },
          "position": {
            "x": 5331,
            "y": 288
          }
        },
        "flowElementId": "C9B5D5D7-375A-49E7-BACA-2918CDE30152",
        "groupId": null,
        "id": "074D1E8C-C509-465F-87DD-FB777370A7CF",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "eh_pick",
          "saveToVariable": null,
          "storeResult": true
        },
        "name": "Picking the product code failed",
        "nextElementIds": [
          "6F948BAF-CC32-4D67-BA4D-1D54F08B0363"
        ],
        "nextGroupIds": [],
        "type": "ERROR_HANDLER"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Product code to look up Result"
          },
          "position": {
            "x": 4751,
            "y": 128
          }
        },
        "flowElementId": "F7B24C5D-6DE5-4676-9944-3AF3D6951CC7",
        "groupId": null,
        "id": "94E7FC27-C496-4074-AD57-14A6600A04C8",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "stagingHit",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "findStaging",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "94CD1456-1501-4D1C-A69B-373ED44E3825"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "// The product code to look up in Products, taken from the single Staging row that was found.\nlet h = stagingHit;\nif (typeof h === 'string' && h.trim()) { try { h = JSON.parse(h); } catch (e) { h = null; } }\nconst code = h && h.rowData ? String(h.rowData['Product Code'] || '').trim() : '';\nreturn { code: code || '__no_code__' };\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": "074D1E8C-C509-465F-87DD-FB777370A7CF",
          "resultAlias": "pick",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Product code to look up",
        "nextElementIds": [
          "FD6D4DA8-2512-4BA7-BE9A-B1D0584D3B2A"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "error-handler",
          "isFirstElement": false,
          "blockDefinitionId": "error-handler",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find in Staging failed Result"
          },
          "position": {
            "x": 5331,
            "y": 468
          }
        },
        "flowElementId": "51799653-AC80-4D39-A6CA-73C2DB709801",
        "groupId": null,
        "id": "45637CDD-28E8-4311-80B2-9D4E90DB0851",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "eh_findStaging",
          "saveToVariable": null,
          "storeResult": true
        },
        "name": "Find in Staging failed",
        "nextElementIds": [
          "6F948BAF-CC32-4D67-BA4D-1D54F08B0363"
        ],
        "nextGroupIds": [],
        "type": "ERROR_HANDLER"
      },
      {
        "clientMetadata": {
          "elementId": "error-handler",
          "isFirstElement": false,
          "blockDefinitionId": "error-handler",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Reading the click failed Result"
          },
          "position": {
            "x": 5331,
            "y": 648
          }
        },
        "flowElementId": "3E105866-011D-4A90-ADFA-B00800153FC8",
        "groupId": null,
        "id": "ADF39DE7-3650-4E04-BB6F-2BA6A026382A",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "eh_pre",
          "saveToVariable": null,
          "storeResult": true
        },
        "name": "Reading the click failed",
        "nextElementIds": [
          "6F948BAF-CC32-4D67-BA4D-1D54F08B0363"
        ],
        "nextGroupIds": [],
        "type": "ERROR_HANDLER"
      },
      {
        "clientMetadata": {
          "notes": "Finds a specific row in a specified sheet within a spreadsheet based on a column and value.",
          "elementId": "EXTENSION:::SHARED:::default:::google-sheets:::findSheetRow",
          "isFirstElement": false,
          "dynamicOptionLabels": {
            "column": {
              "Product Code": "Product Code"
            },
            "documentId": {},
            "sheetId": {
              "649813233": "Products"
            }
          },
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find this product in Products Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-sheets:::findSheetRow",
          "legacyElementId": "JS###v1###GoogleSheets###findSheetRow",
          "methodName": "findSheetRow",
          "position": {
            "x": 5041,
            "y": 38
          }
        },
        "flowElementId": "CA525307-5D15-4A67-896A-8BCA0906507B",
        "groupId": null,
        "id": "FD6D4DA8-2512-4BA7-BE9A-B1D0584D3B2A",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sheetId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 649813233
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "column",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Product Code"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "value",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "pick",
                    "subPathSegments": [
                      {
                        "key": "code",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "94E7FC27-C496-4074-AD57-14A6600A04C8"
                  }
                ],
                "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": "findSheetRow",
          "onFailElemId": "896AF165-ACFA-4195-900A-B995FE0A8105",
          "packageId": "default",
          "resultAlias": "findProduct",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-sheets",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find this product in Products",
        "nextElementIds": [
          "F1133171-E1F1-4C15-9AFE-9073E3FE61DA"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "router",
          "isFirstElement": false,
          "blockDefinitionId": "router",
          "casesViewMode": {
            "cf3b9efd-eab7-48b2-ad9e-0b773f3acef9": "ENUM_LIST"
          },
          "position": {
            "x": 5591,
            "y": 38
          }
        },
        "flowElementId": "18134BC0-882B-4E5F-8D92-F4375A034753",
        "groupId": null,
        "id": "CC5137B6-66CA-4718-9865-C331749619F7",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "r0b",
          "storeResult": true,
          "switchCases": [
            {
              "defaultCase": false,
              "id": "cf3b9efd-eab7-48b2-ad9e-0b773f3acef9",
              "label": "Approve / Reject / Edit box",
              "nextComponents": [
                {
                  "componentId": "1FD61660-5C58-46FB-8F3A-6FC40B961474",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "ENUM",
              "values": {
                "type": "LIST",
                "value": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "product_approve"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  },
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "product_reject"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  },
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "product_edit"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            },
            {
              "defaultCase": true,
              "id": "892fec3e-f242-41ea-8d48-5fde762c81fb",
              "label": "Everything Else",
              "nextComponents": [],
              "type": "SIMPLE",
              "value": null
            }
          ],
          "switchExpression": {
            "expression": [
              {
                "id": "RESULT",
                "label": "click",
                "subPathSegments": [
                  {
                    "key": "action_id",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "F7C3E53B-97C4-4C1E-A9F1-D1E724EE8E25"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Which button or box?",
        "nextElementIds": [
          "1FD61660-5C58-46FB-8F3A-6FC40B961474"
        ],
        "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": "Reply in thread with the decision Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 6141,
            "y": 38
          }
        },
        "flowElementId": "872DCE85-C97F-4574-A173-2295420150B7",
        "groupId": null,
        "id": "861425DB-887A-4DE2-B14F-E7F360F74A11",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "click",
                    "subPathSegments": [
                      {
                        "key": "channel_id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "F7C3E53B-97C4-4C1E-A9F1-D1E724EE8E25"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "decide",
                    "subPathSegments": [
                      {
                        "key": "message",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F1133171-E1F1-4C15-9AFE-9073E3FE61DA"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "\n_(The buttons above could not be removed; clicking them again changes nothing.)_"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "click",
                    "subPathSegments": [
                      {
                        "key": "message_ts",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "F7C3E53B-97C4-4C1E-A9F1-D1E724EE8E25"
                  }
                ],
                "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": [],
                "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": "decisionReply",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Reply in thread with the decision",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "error-handler",
          "isFirstElement": false,
          "blockDefinitionId": "error-handler",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Could not edit the card (e.g. edit window closed) Result"
          },
          "position": {
            "x": 5851,
            "y": 38
          }
        },
        "flowElementId": "E65D4DBB-313E-4708-893F-EB5715F271A6",
        "groupId": null,
        "id": "C2447791-07D9-41A7-A7E9-AC67B36B0785",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "ehUpd",
          "saveToVariable": null,
          "storeResult": true
        },
        "name": "Could not edit the card (e.g. edit window closed)",
        "nextElementIds": [
          "861425DB-887A-4DE2-B14F-E7F360F74A11"
        ],
        "nextGroupIds": [],
        "type": "ERROR_HANDLER"
      }
    ],
    "firstElementId": "F7C3E53B-97C4-4C1E-A9F1-D1E724EE8E25",
    "groups": [],
    "id": "57AA8D06-000A-4918-85D2-0CB203050511",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": null,
        "valid": true
      },
      "errorMessage": null,
      "executionStaticData": [],
      "initialData": null,
      "initialDataDefaultValues": {},
      "ownerFlowVersionId": null,
      "schedule": null,
      "sharedMemory": {
        "anchor": {
          "missingAnchorPolicy": null,
          "path": null,
          "type": "FLOW_MEMORY"
        },
        "expirationInSec": null
      },
      "wasLive": true
    }
  },
  "slaCalendars": [],
  "slaGoals": [],
  "subFlows": [],
  "exportDate": "2026-10-13T08:29:17.548Z"
}