{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "956413A7-5232-4B5B-B942-09C600279DCA",
    "name": "Denser AI: chatbot leads into HubSpot"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -70,
        "y": 0,
        "zoom": 1
      },
      "autoSave": false,
      "descriptions": {
        "flow": "Checks Denser AI on a schedule for new lead conversations, reads who the lead is and what they asked, creates or updates the HubSpot contact with the question, and tells the sales channel in Slack.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "Checks Denser AI on a schedule for new lead conversations, reads who the lead is and what they asked, creates or updates the HubSpot contact with the question, and tells the sales channel in Slack.",
    "elements": [
      {
        "clientMetadata": {
          "notes": "Updates an existing contact in HubSpot with new property values. Only the properties specified in the request will be updated, leaving all other contact data unchanged. Property updates include optional timestamps for historical tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::hubspot:::updateContact",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Update the contact Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::hubspot:::updateContact",
          "legacyElementId": "JS###v1###HubSpotService###updateContact",
          "methodName": "updateContact",
          "position": {
            "x": 778,
            "y": 340
          }
        },
        "flowElementId": "18A04AA9-0AC7-46BB-AB2A-67D17275B371",
        "groupId": null,
        "id": "59F838AA-9809-4418-82E6-7E6A0A1A87B1",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "vid",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Contact",
                    "subPathSegments": [
                      {
                        "key": "vid",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "BE24E075-164B-4A58-8F7F-A4EEEA0E921C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "properties",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "HubSpot fields",
                    "subPathSegments": [
                      {
                        "key": "update",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "5CCE27BC-6475-4FEE-AB75-16049893BAC3"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Update the contact', Error: OAuth Connection is required",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "updateContact",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Updated contact",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "hubspot",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Update the contact",
        "nextElementIds": [
          "2A4F2AC3-FAF8-4274-BEFC-0FFC56B66997"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Creates a new contact record in your HubSpot account with the specified properties. The contact will be assigned a unique visitor ID (vid) for future reference. At least one property must be provided to create the contact successfully.",
          "elementId": "EXTENSION:::SHARED:::default:::hubspot:::createContact",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Create the contact Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::hubspot:::createContact",
          "legacyElementId": "JS###v1###HubSpotService###createContact",
          "methodName": "createContact",
          "position": {
            "x": 449,
            "y": 470
          }
        },
        "flowElementId": "4D52B58C-CB9C-447A-9B4D-2135352A5A05",
        "groupId": null,
        "id": "27C314AA-F148-4B04-96DF-44F090C0431D",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "properties",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "HubSpot fields",
                    "subPathSegments": [
                      {
                        "key": "create",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "5CCE27BC-6475-4FEE-AB75-16049893BAC3"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Create the contact', Error: OAuth Connection is required",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "createContact",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "New contact",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "hubspot",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Create the contact",
        "nextElementIds": [
          "2A4F2AC3-FAF8-4274-BEFC-0FFC56B66997"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Tell sales in Slack Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 449,
            "y": 340
          }
        },
        "flowElementId": "04AFC0F6-CAB7-496B-A4F0-325468CD1E78",
        "groupId": null,
        "id": "2A4F2AC3-FAF8-4274-BEFC-0FFC56B66997",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "*New lead from the Denser AI chatbot*"
                  },
                  {
                    "id": "NEWLINE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "\n"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " <mailto:"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "email",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "|"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "email",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "> "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "company",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "phone",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  },
                  {
                    "id": "NEWLINE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "\n"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Asked: "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "question",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  },
                  {
                    "id": "NEWLINE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "\n"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "summary",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  },
                  {
                    "id": "NEWLINE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "\n"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "The contact is in HubSpot with the question in its Message field."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "Sales message",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Tell sales in Slack",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 778,
            "y": 179
          }
        },
        "flowElementId": "970BDD13-6972-4526-B034-107EC39543D5",
        "groupId": null,
        "id": "AC5C3162-6D29-497D-A428-4B2993AC8103",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "ecd83f19-e00c-4966-ac3f-0403c1538238",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Lead details",
                      "subPathSegments": [
                        {
                          "key": "output",
                          "optional": false
                        },
                        {
                          "key": "email",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "ecd83f19-e00c-4966-ac3f-0403c1538238"
            ]
          },
          "elseComponent": {
            "componentId": "9CDA5310-FB89-459F-B294-51B9DB7E72A3",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Has email",
          "storeResult": false,
          "thenComponent": {
            "componentId": "5CCE27BC-6475-4FEE-AB75-16049893BAC3",
            "componentType": "ELEMENT"
          }
        },
        "name": "Email given?",
        "nextElementIds": [
          "9CDA5310-FB89-459F-B294-51B9DB7E72A3",
          "5CCE27BC-6475-4FEE-AB75-16049893BAC3"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "error-handler",
          "isFirstElement": false,
          "blockDefinitionId": "error-handler",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Not in HubSpot yet Result"
          },
          "position": {
            "x": 778,
            "y": 479
          }
        },
        "flowElementId": "EB000F22-C01B-44CD-95CB-228C5DF7CADD",
        "groupId": null,
        "id": "265C4869-7D4C-4049-8372-FE93ABBD9A94",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Lookup error",
          "saveToVariable": null,
          "storeResult": true
        },
        "name": "Not in HubSpot yet",
        "nextElementIds": [
          "27C314AA-F148-4B04-96DF-44F090C0431D"
        ],
        "nextGroupIds": [],
        "type": "ERROR_HANDLER"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves detailed contact information by email address. This method searches for and returns a single contact record matching the provided email, including all property data, form submissions, and associated company details.",
          "elementId": "EXTENSION:::SHARED:::default:::hubspot:::getContactByEmail",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the contact in HubSpot Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::hubspot:::getContactByEmail",
          "legacyElementId": "JS###v1###HubSpotService###getContactByEmail",
          "methodName": "getContactByEmail",
          "position": {
            "x": 1085,
            "y": 340
          }
        },
        "flowElementId": "46558441-CDC7-42BE-B12F-485B8D5012B8",
        "groupId": null,
        "id": "BE24E075-164B-4A58-8F7F-A4EEEA0E921C",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "contact_email",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "email",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "property",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "propertyMode",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "value_only"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "formSubmissionMode",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "none"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "showListMemberships",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": "Block: 'Find the contact in HubSpot', Error: OAuth Connection is required",
            "valid": false
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "getContactByEmail",
          "onFailElemId": "265C4869-7D4C-4049-8372-FE93ABBD9A94",
          "packageId": "default",
          "resultAlias": "Contact",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "hubspot",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the contact in HubSpot",
        "nextElementIds": [
          "59F838AA-9809-4418-82E6-7E6A0A1A87B1"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends messages to Slack channels with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Post the lead without an email Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendMessageToChannel",
          "legacyElementId": "JS###v1###Slack###sendMessageToChannel",
          "methodName": "sendMessageToChannel",
          "position": {
            "x": 1078,
            "y": 40
          }
        },
        "flowElementId": "B883F8A4-D6C8-41BE-ABD1-9CDED9B68C46",
        "groupId": null,
        "id": "9CDA5310-FB89-459F-B294-51B9DB7E72A3",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "channelId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "*New lead from the Denser AI chatbot, no email in the conversation*"
                  },
                  {
                    "id": "NEWLINE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "\n"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "company",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "phone",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  },
                  {
                    "id": "NEWLINE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "\n"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Asked: "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "question",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  },
                  {
                    "id": "NEWLINE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "\n"
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "summary",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  },
                  {
                    "id": "NEWLINE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": "\n"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Nothing was added to HubSpot. Denser conversation ID: "
                  },
                  {
                    "id": "RESULT",
                    "label": "Lead",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "F9D4B24C-03AD-4BC8-ABB9-873617FF8305"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "Lead without email",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Post the lead without an email",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Build the HubSpot fields Result"
          },
          "position": {
            "x": 1098,
            "y": 179
          }
        },
        "flowElementId": "7C112E90-C869-4BEF-9A5E-0A8EECD9B595",
        "groupId": null,
        "id": "5CCE27BC-6475-4FEE-AB75-16049893BAC3",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "email",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "email",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "firstName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "firstName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "lastName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "lastName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "company",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "company",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "phone",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "phone",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "question",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "question",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "summary",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Lead details",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "summary",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "F49B8106-8FE0-42D4-8CBF-57304C64D922"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "createdAt",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Lead",
                    "subPathSegments": [
                      {
                        "key": "createdAt",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "F9D4B24C-03AD-4BC8-ABB9-873617FF8305"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const note = `Denser AI chat ${createdAt}: ${question} ${summary}`.trim();\nconst pairs = [\n  ['firstname', firstName],\n  ['lastname', lastName],\n  ['company', company],\n  ['phone', phone],\n  ['message', note],\n].filter(([, value]) => value && String(value).trim());\nconst toProps = (list) => list.map(([property, value]) => ({ property, value: String(value).trim() }));\nreturn {\n  create: toProps([['email', email], ['lifecyclestage', 'lead'], ...pairs]),\n  update: toProps(pairs),\n};"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "HubSpot fields",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Build the HubSpot fields",
        "nextElementIds": [
          "BE24E075-164B-4A58-8F7F-A4EEEA0E921C"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Fires once for each conversation whose client type is Lead, such as a visitor who filled in the chatbot's lead form, with its messages and metadata. Reads the 100 most recently updated lead conversations on each check.",
          "elementId": "EXTENSION:::SHARED:::default:::denser-ai:::onNewLeadConversation",
          "isFirstElement": true,
          "blockDefinitionId": "EXTENSION:::SHARED:::default:::denser-ai:::onNewLeadConversation",
          "newElementId": "EXTENSION:::SHARED:::default:::denser-ai:::onNewLeadConversation",
          "legacyElementId": null,
          "methodName": "onNewLeadConversation",
          "position": {
            "x": 110,
            "y": 170
          }
        },
        "flowElementId": "CED51C86-DD5D-4570-BC75-1089E8FFB374",
        "groupId": null,
        "id": "F9D4B24C-03AD-4BC8-ABB9-873617FF8305",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "connectionId": null,
          "dynamicData": [],
          "eventName": "onNewLeadConversation",
          "frequency": {
            "repeat": {
              "every": 300
            },
            "schedule": "custom"
          },
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Lead",
          "serviceId": "denser-ai",
          "slaConditions": [],
          "staticData": {},
          "storeResult": true,
          "subtype": "POLLING",
          "type": "CUSTOM"
        },
        "name": "New lead in Denser AI",
        "nextElementIds": [
          "F49B8106-8FE0-42D4-8CBF-57304C64D922"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the lead's conversation Result"
          },
          "tools": {},
          "position": {
            "x": 420,
            "y": 179
          }
        },
        "flowElementId": "0EACC23E-9FE8-4D9E-A061-6E8FD13F6868",
        "groupId": null,
        "id": "F49B8106-8FE0-42D4-8CBF-57304C64D922",
        "metaInfo": {
          "aiApiKey": null,
          "aiModel": "claude-sonnet-5",
          "aiProvider": "ANTHROPIC",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "dynamicAiApiKey": {
            "expression": [
              {
                "id": "PLACEHOLDER_DATA",
                "label": "Anthropic key",
                "subPathSegments": null,
                "type": "EXECUTION_CONTEXT_STATIC_DATA",
                "value": "Anthropic key"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "files": [],
          "forceParsedOutput": true,
          "langSmithSettings": {
            "enabled": false,
            "apiKey": null,
            "projectName": null,
            "label": "FlowRunner AI-Agent",
            "accountCluster": "US"
          },
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "messagesHistoryEnabled": false,
          "messagesHistoryLimit": 15,
          "onFailElemId": null,
          "resultAlias": "Lead details",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You read a conversation between a website visitor and a Denser AI support chatbot. The visitor filled in the chatbot's lead form, so the conversation is a sales lead. From the metadata and the messages, reply with JSON only, with these fields:\nemail: the visitor's email address, or empty text if none was given\nfirstName: their first name, or empty text\nlastName: their last name, or empty text\nname: their full name as given, or empty text\ncompany: their company, or empty text\nphone: their phone number, or empty text\nquestion: what they asked the chatbot about, in one sentence close to their own words\nsummary: two or three plain sentences a sales rep reads before calling: what they want, any size, timing or plan they mentioned, and what the chatbot told them"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Conversation "
              },
              {
                "id": "RESULT",
                "label": "Lead",
                "subPathSegments": [
                  {
                    "key": "id",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "F9D4B24C-03AD-4BC8-ABB9-873617FF8305"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ", started "
              },
              {
                "id": "RESULT",
                "label": "Lead",
                "subPathSegments": [
                  {
                    "key": "createdAt",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "F9D4B24C-03AD-4BC8-ABB9-873617FF8305"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ", client type "
              },
              {
                "id": "RESULT",
                "label": "Lead",
                "subPathSegments": [
                  {
                    "key": "clientType",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "F9D4B24C-03AD-4BC8-ABB9-873617FF8305"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\nMetadata:\n"
              },
              {
                "id": "RESULT",
                "label": "Lead",
                "subPathSegments": [
                  {
                    "key": "metadata",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "F9D4B24C-03AD-4BC8-ABB9-873617FF8305"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "\n\nMessages, oldest first:\n"
              },
              {
                "id": "RESULT",
                "label": "Lead",
                "subPathSegments": [
                  {
                    "key": "messages",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "F9D4B24C-03AD-4BC8-ABB9-873617FF8305"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Read the lead's conversation",
        "nextElementIds": [
          "AC5C3162-6D29-497D-A428-4B2993AC8103"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "F9D4B24C-03AD-4BC8-ABB9-873617FF8305",
    "groups": [],
    "id": "9753E069-F44C-453E-839F-40E27EBA3BA2",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": "Please fix problems before start. Blocks with issues have red badge in the top-right corner of a block, hover it to see what needs to be done.",
        "valid": false
      },
      "errorMessage": "Please fix problems before start. Blocks with issues have red badge in the top-right corner of a block, hover it to see what needs to be done.",
      "executionStaticData": [
        {
          "description": "The Anthropic key the AI step uses.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        }
      ],
      "initialData": null,
      "initialDataDefaultValues": {},
      "ownerFlowVersionId": null,
      "schedule": null,
      "sharedMemory": {
        "anchor": {
          "missingAnchorPolicy": null,
          "path": null,
          "type": "FLOW_MEMORY"
        },
        "expirationInSec": null
      },
      "wasLive": false
    }
  },
  "slaCalendars": [],
  "slaGoals": [],
  "subFlows": [],
  "exportDate": "2026-12-02T01:42:54.139Z"
}
