Lola Profile v2 icon

Lola Profile v2

Lola Profile Node v2

Lola Profile v2

AI-generated

Overview

The Lola Profile v2 node manages user profile data within the Lola system. It supports operations to get, set (create/update), delete, and flush cached profiles for a given user channel. This node is useful in workflows where you need to retrieve or update customer information, manage contact/payment method details, or handle profile metadata as part of automated processes.

Common scenarios:

  • Fetching a user's profile to personalize communication.
  • Creating or updating a user's profile with new contact or payment information.
  • Deleting a user's profile from both cache and database.
  • Flushing only the cached version of a profile to force a refresh.

Practical examples:

  • Onboarding a new customer by setting their profile details.
  • Retrieving a customer's profile before sending them a message.
  • Removing a user's profile when they unsubscribe.
  • Updating NLP-ready text representations of contacts/payment methods for downstream AI processing.

Properties

Name Meaning
ChatId User Channel Identifier. Used along with tokens data tenantId and channelId to identify the user channel. (Required)
Operation The action to perform on the profile:
- Get: Get a profile
- Set: Set a profile (create if not exists, update if exists)
- Delete: Delete profile from cache and database
- Flush Cache: Flush profile from cache
Customer Status Customer Status (e.g., sales, onboarding, support, etc). Only used when Operation is "Set".
Flow Status States related to the flow (e.g., scan_id, selfie, etc). Only used when Operation is "Set".
First Name Customer First Name. Only used when Operation is "Set".
Last Name Customer Last Name. Only used when Operation is "Set".
Phone Number A user's phone number to set in profile. Used in both "Get" and "Set" operations.
Country A user's country to set in profile. Only used when Operation is "Set".
Language A user's language to set in profile. Only used when Operation is "Set".
Email A user's email to set in profile. Only used when Operation is "Set".
Contacts Contacts object array to set in profile ({fullName, phone, country, relationship}). Only used when Operation is "Set".
Payment Methods Payment Methods object array to set in profile ({name}). Only used when Operation is "Set".
Hidden Payment Methods Hidden Payment Methods object array to set in profile ({name}). Only used when Operation is "Set".
Enable Text Representation Whether to enable text representation of contacts and payment methods for NLP purposes. (Required)
Contact Item Text Pattern Text pattern using {fullName}, {phone}, {country}, {relationship} to represent a contact. Only shown if "Enable Text Representation" is true.
Payment Method Item Text Pattern Text pattern using {name} to represent a payment method. Only shown if "Enable Text Representation" is true.
Metadata Key-value pairs to set as metadata in the profile. Only used when Operation is "Set".

Output

  • The node outputs an object with a json field containing a property named lola_profilev2.
  • The structure of lola_profilev2 depends on the operation:
    • Get: Contains the retrieved profile data. If the profile is new, it is routed to a separate output.
    • Set: Contains the result of the set operation (the updated/created profile).
    • Delete/Flush Cache: No specific output structure described; may return status or error.
  • If "Enable Text Representation" is enabled and a profile is present, additional fields are added to the profile:
    • nlp_contacts: An object with:
      • list: Array of string representations of each contact based on the provided pattern.
      • text: Concatenated string of all contact representations.
    • nlp_payment_methods: An object with:
      • list: Array of string representations of each payment method based on the provided pattern.
      • text: Concatenated string of all payment method representations.

Example output:

{
  "lola_profilev2": {
    "profile": {
      "firstName": "John",
      "lastName": "Doe",
      "contacts": [
        { "fullName": "Jane Smith", "phone": "+1234567890", "country": "US", "relationship": "friend" }
      ],
      "paymentMethods": [
        { "name": "Visa" }
      ],
      "nlp_contacts": {
        "list": ["Jane Smith (+1234567890, US, friend)"],
        "text": "Jane Smith (+1234567890, US, friend)\n"
      },
      "nlp_payment_methods": {
        "list": ["Visa"],
        "text": "Visa\n"
      }
    },
    "status": "exists"
  }
}
  • The node can output to three branches: existing profile, new profile, and errors.

Dependencies

  • May require a credential named lolaKeyApi (not always required).
  • Relies on external functions such as getProfileV2, setProfileV2, and utility adapters for formatting data.
  • No explicit environment variables mentioned, but API access may require configuration.

Troubleshooting

Common issues:

  • Missing or invalid ChatId: The node requires a valid ChatId; missing this will cause errors.
  • Invalid JSON in Contacts/Payment Methods: Supplying malformed JSON will likely result in errors during the "Set" operation.
  • Pattern placeholders mismatch: If the text patterns for contacts or payment methods use undefined placeholders, the output may be incorrect or default to "Unknown string pattern".
  • API errors: Errors from the underlying Lola API (e.g., network issues, authentication failures) will be returned in the lola_profilev2 field under the error output branch.

Error messages:

  • "Set Profile Error ...": Indicates failure during profile creation/updating. Check input data and API credentials.
  • "getProfileV2 chatId: ...": Debug log for fetching profile; if no profile is found, ensure the ChatId is correct.

Links and References

Discussion