What You’ll Learn
- Creating an automation flow with a webhook trigger and Google Sheets lookup
- Setting up a mid-call tool that connects to the automation platform
- Handling phone number format differences between the tool and Google Sheets
- Looking up order data by customer phone number during a live call
- Using the AI Prompt Editor to configure your assistant’s behavior
Prerequisites
- Google account with Google Sheets access
- AI assistant configured for calls
- Basic understanding of custom mid-call tools
- Access to the automation platform
How It Works
Before we start, here’s the big picture of what we’re building:/sync), the automation searches your spreadsheet, and returns the data back to the AI in real-time.
Step 1: Prepare Your Google Sheet
First, set up a Google Sheet with your order data. The AI will search this sheet by phone number during calls.- Create a new Google Sheet
- Set up your columns — for example:
| customer_phone | customer_name | order_number | order_status | product |
|---|---|---|---|---|
| 1234567890 | John Smith | ORD-1001 | Shipped | Smart Watch |
| 0987654321 | Jane Doe | ORD-1002 | Processing | Wireless Headphones |
- Add a test row with your own phone number so you can test later
- Rename the spreadsheet to something descriptive (e.g., “Orders AI”)
Step 2: Create the Automation Flow
Now we’ll build the automation that receives a phone number from the mid-call tool, searches Google Sheets, and returns the order data.- Navigate to the Automation Platform by clicking “Automate platform” in the sidebar
- Click New Flow and select From Scratch
- Search for Webhook and select Catch Webhook as your trigger
- A live URL will be generated — copy it
Don’t close this tab. We’ll come back to test the trigger after setting up the mid-call tool.
Step 3: Create the Mid-Call Tool
Open a new tab and navigate to Mid Call Tools to create the tool that will call our automation webhook.- Click New Mid Call Tool
- Fill in the tool details:
- Name:
get_order_status - Description:
Look up order information using the customer_phone variable from the call. Use this tool when a customer asks about their order status, delivery, or purchase history. - Endpoint: Paste the webhook URL from Step 2
- Timeout:
30seconds - Method: POST
- Name:
Headers
The defaultContent-Type: application/json header is already added. No additional headers are needed for the automation platform webhook.
Tool Parameters
-
Click Add parameter and configure:
- Name:
customer_phone - Type:
String - Description:
The customer_phone variable from the call
- Name:
- Click Create to save the tool
Step 4: Test the Tool and Send Data to the Automation
After saving, we need to send test data so the automation can capture the webhook payload structure.- Save the tool
- Go back to the automation tab and click Load Data to start listening
- Go back to the mid-call tool and click Test Tool
- Return to the automation tab — you should see the test data arrive with the
customer_phonefield in the body
/sync to the end of the webhook URL in the mid-call tool’s Endpoint field and save. With /sync, the tool will send the data and wait to receive the response back from the automation.
Step 5: Add Split Text Step
Phone numbers from the mid-call tool come with a+ prefix (e.g., +1234567890), but Google Sheets stores them without it. We need to strip the + before searching.
- Click + to add a step after the webhook trigger
- Search for Text and select Split Text
- Configure:
- Text: Select from Catch Webhook → Body →
customer_phone - Delimiter:
+
- Text: Select from Catch Webhook → Body →
+ character. The second part (index 1) will contain the number without the prefix.
Step 6: Add Google Sheets Lookup
Now we’ll add the Google Sheets step that searches for the order by phone number.- Click + to add another step
- Search for Google Sheets and select Find Row
- Create or select a Google Sheets connection
- Select your spreadsheet (e.g., “Orders AI”) and sheet name
- Configure the lookup:
- Column name:
customer_phone - Search value: Select the result from the Split Text step (index 1 — the number without
+) - Starting row:
1 - Number of rows:
1
- Column name:
Step 7: Return the Data
The final step is to return the order data back to the mid-call tool so the AI can use it.- Click + to add another step
- Search for Return Response (under Webhook actions)
- Set the response body type to JSON and configure:
- Map each field by selecting the values from the Find Row step data (Find Row → Row 0 → Values)
- Test this step to verify you receive the correct data
Step 8: Publish the Automation
- Verify all steps are correctly configured
- Click Publish to make the flow live
Step 9: Assign the Tool to Your Assistant
Now we need to connect the mid-call tool to your AI assistant so it can use it during calls.- Navigate to your AI assistant → Prompts and Tools tab
- In the Custom Tools section, select
get_order_statusfrom the dropdown - Save the assistant
Step 10: Configure the AI Prompt
Open the AI Prompt Editor to instruct the AI on when and how to use the tool. Click Launch AI Prompt Editor and describe what you need — for example, tell it to build a prompt that uses theget_order_status tool when a customer asks about their order.
The AI Prompt Editor will generate the appropriate system prompt rules. Review them, click Accept, then Save.
Step 11: Test with a Real Call
- Click Speak to Assistant to start a live voice test
- When connected, ask about your order status
- The assistant should call the
get_order_statustool, look up your phone number in the Google Sheet, and tell you the order details
Best Practices
Google Sheets Data
- Store phone numbers without
+— Google Sheets doesn’t support+as a number prefix, the automation handles stripping it - Avoid duplicate phone numbers — the lookup returns the first match
- Keep the sheet organized — remove empty rows between data entries
Tool Configuration
- Set a reasonable timeout (30 seconds) to account for automation processing time
- Write a clear tool description so the AI knows exactly when to use it
- Include fallback instructions in your prompt for when no data is found
System Prompt Tips
- Be specific about what data fields the AI will receive
- Provide examples of how to use the data naturally in conversation
- Handle edge cases — empty fields, no match found, etc.
Troubleshooting
Common Issues
Tool returns empty data:- Verify the phone number format matches between the Split Text output and Google Sheet
- Check Google Sheets connection authorization
- Test the automation manually with a known phone number
- Increase the timeout value in the mid-call tool settings
- Check that the automation is published and active
- Verify the
/syncsuffix is on the webhook URL
- Review the tool description — make it clear when to use it
- Check the system prompt has explicit instructions to use the tool
- Verify the tool is saved and associated with the correct assistant
- Confirm the webhook URL is correct (including
/sync) - Check that the automation is published
- Review automation runs for error messages
- Ensure the Split Text step is correctly stripping the
+prefix - Check that phone numbers in the Google Sheet are stored without
+ - Verify the Split Text delimiter is set to
+
Next Steps
Once your order lookup is working:- Add more data columns to your sheet (tracking number, shipping address, estimated delivery)
- Combine with post-call automation to update the sheet after each call
- Create multiple lookup tools for different data sources
- Add a “write” tool to let the AI update order notes during the call
- Connect to a CRM or e-commerce platform instead of Google Sheets for larger datasets

