Updated August 26, 2024


Introduction: Workflow 2, known as "AI Response to Contact," is responsible for managing the responses generated by OpenAI and ensuring they are appropriately delivered to the contact through the correct communication channel. This workflow plays a crucial role in determining whether the AI-generated response should be sent to the contact in GoHighLevel (GHL) and whether the contact should be added to the Follow-up workflow.


Workflow Trigger:

The primary trigger for this workflow is the "response" tag. This tag is automatically added when ZappyChat returns the contact after OpenAI generates a response. The response itself is stored in the "response" custom field, which will contain the message generated by the AI bot.

image.png


Workflow Logic:

  1. Initial Conditions Check: Once triggered by the "response" tag, the workflow first checks several key conditions:

    image.png

    Important Note: Users may sometimes see successful execution logs in ZappyChat but notice that the response was not generated in GHL. This often occurs because one of these conditions (AI Status "OFF," "alert user" tag, or "stop bot" tag) was met, causing the workflow to stop before the response was sent.

  2. If-Else Condition: If the AI status is not "OFF" and neither the "alert user" nor "stop bot" tags are present, the workflow proceeds to an If-Else Condition that evaluates the communication channel where the conversation is happening.

    image.png


Follow-up Workflow Integration:

After the AI has successfully replied, Workflow 2 determines whether the contact should be added to the Follow-up Workflow. This decision is based on the following logic:

image.png


Error Prevention and Best Practices: