Skip to main content
The OpenAI Success/Failed built-in condition allows you to create robust flows that can handle AI errors gracefully. Instead of the bot getting stuck if an API call fails (due to timeouts, token limits, or outages), you can automatically route the user to a fallback path.

How it Works

When an OpenAI action executes, the system monitors the result:

Success Path (Green)

Trigger: Content was generated and saved to the Custom Field. Action: Continue the conversation normally, displaying the AI response.

Failed Path (Red)

Trigger: The request failed due to API errors, timeouts, or content filtering. Action: Trigger a fallback, such as “Sorry, I’m having trouble thinking right now. Let me connect you to a human.”

Configuration Guide

To implement this logic, you typically place a Condition block immediately after your OpenAI Action.
1

Add OpenAI Action

Set up your OpenAI: Generate Text action as usual in the Flow Builder.
2

Add Condition Block

Immediately after the action, add a Condition block.
3

Select Rule

In the condition settings, look for the built-in rule: OpenAI Success/Failed (or check the status of the Last Action).Note: In some versions of the builder, this logic is built directly into the Action node itself as “True/False” output ports.
4

Define Paths

  • If Success: Connect to a Text Block displaying the {{ai_response}}.
  • If Failed: Connect to a Text Block with a pre-written fallback message or a “Notify Admin” action.

Use Cases

1. Robust Error Handling

Prevent the “silent failure” where a user waits indefinitely for a response that never comes.
  • Failed Path: “I’m experiencing high traffic. Please try asking again in a moment.”

2. Monitoring & Analytics

Use the failed path to tag users or notify developers.
  • Failed Path: Add Action -> Add Tag “AI_Error” -> Notify Admin. This helps you identify if your prompt is causing issues or if you’ve hit your OpenAI quota.

3. Automatic Retry

You can loop the Failed path back to the OpenAI action (with a counter condition to prevent infinite loops) to try generating the answer one more time before giving up.