What will you learn here?
This FAQ teaches, step by step, how to use Controlled Flows with Controlled Flow + External API to build a flow that:
-
Receives user input (e.g., ZIP code or order number)
-
Makes a request to an external API
-
Extracts and saves the returned data into variables
-
Returns a formatted response to Cláudia or directs the flow to N2
Step 1 – Create a new Controlled Flow
-
Access Controlled Flows and click on "Create a Typebot"
-
Start from scratch (blank bot)
Step 2 – Define the starting point (user input)
-
Create a text input block
-
Save user input (e.g., ZIP code) into a variable named
zip
Step 3 – Configure the API call
-
Add an HTTP Request block
-
In the URL field, paste the API endpoint (e.g., https://viacep.com.br/ws/{{zip}}/json)
-
Ensure the variable is within double curly braces ("{{}}"), as in
{{zip}}. -
Method: GET
Step 4 – Test the request
-
Click "Test Request"
-
Enter a real test value (e.g., 01025-020)
-
If the test fails, check if the link starts with https://
Step 5 – Map response fields
Once the request works, extract relevant data from the returned JSON. In the example, it returns:

Step 6 – Create the formatted response
Create a text block with the answer for the customer, using the extracted variables. Example:
"The ZIP code {{zip}} corresponds to the street {{street}}, in the neighborhood {{neighborhood}}, city {{city}}/{{state}}, DDD {{area_code}}."
Step 7 – Handling invalid ZIP codes
-
Use a conditional block
-
Check if the address variable exists:
-
If yes, proceed with the response
-
If no, send a message like "ZIP code not found" and return to Cláudia or redirect to N2
-
Step 8 – Returning to Cláudia
-
At the end of the flow, use the "Return to Cloud" block
-
If data was found, return a friendly response
-
If not, send a message indicating Cláudia should escalate to N2 (e.g., "Status not found. Please transfer.")
Step 9 – Publish and test with real tickets
-
Click "Publish" at the top of the screen
-
The flow will be available for real testing with tickets in Contents
Step 10 – Handle inputs with incorrect formatting
If the user enters ZIP code with dashes, spaces, or dots (e.g., 01.025-020), use intermediary blocks to sanitize the input (remove special characters).
Tip: use text transformation blocks or JavaScript scripts in Controlled Flows, if necessary.
Conclusion
With this Controlled Flow:
-
You automate external searches via API
-
Customize responses for the customer
-
Escalate only when necessary
-
You can replicate this model for order status inquiries, tracking, CPF verification, etc.