Research Assistant for WhatsApp using Twilio, Perplexity and Claude
Build an AI Research Assistant for WhatsApp with Perplexity and Claude š”
Ever wished you could get a deep, multi-source research report on any topic, delivered directly to your WhatsApp chat in seconds? This workflow transforms your WhatsApp into a powerful, on-demand research assistant, perfect for students, professionals, and curious minds.
Leveraging the deep research capabilities of Perplexity, the nuanced formatting skills of Anthropic's Claude, and the messaging power of Twilio, this workflow automates the entire process from query to polished answer. Ask it anything, and receive a well-structured, easy-to-read summary moments later.
What This Workflow Does š
š² Listens for Incoming Queries: The workflow starts when a user sends a message to your configured Twilio WhatsApp number. š§ Performs Deep Research: It takes the user's query and feeds it to the Perplexity node, which uses the sonar-pro model to conduct a comprehensive, multi-source analysis on the topic. šØ Polishes the Content: The raw, detailed research report from Perplexity is then passed to an Anthropic Claude model. This crucial step refines the text, adds engaging emojis, ensures it's under the WhatsApp character limit, and formats it perfectly for mobile viewing. š¬ Sends an Instant Reply: The final, beautifully formatted summary is sent directly back to the user's WhatsApp chat via Twilio, completing the entire request.
Nodes Used š ļø
Webhook: To receive the initial message from Twilio and trigger the workflow. Perplexity: To perform the AI-powered deep research on the user's query. Anthropic (via LangChain): To connect to and use the Claude model for reformatting and polishing the content. Twilio: To send the final, formatted message back to the user on WhatsApp.
How to Set Up This Workflow āļø
This workflow requires careful setup between n8n and Twilio to function correctly. Follow these steps closely.
1. Prerequisites ā
You will need accounts for the following services:
n8n (Cloud or self-hosted) Twilio Perplexity AI (for an API key) Anthropic (for a Claude API key)
2. Configure Credentials š
In your n8n instance, add your API keys for Twilio, Perplexity, and Anthropic.
You can add credentials in n8n by going to the Credentials tab in the left-hand menu. Learn more about managing credentials in n8n.
3. Set Up Your Twilio WhatsApp Number š±
Log in to your Twilio account. Either purchase a phone number that is WhatsApp-enabled or use the free Twilio Sandbox for WhatsApp for testing. Follow Twilio's guide to connect your number or sandbox to the WhatsApp Business API. Read Twilio's Getting Started with WhatsApp Guide.
4. Expose Your n8n Webhook URL š
For Twilio to communicate with n8n, your n8n webhook URL must be publicly accessible.
Open the Fetch Whatsapp Request (Webhook) node in the workflow. You will see two URLs: Test and Production. For this guide, we will use the Test URL. If you are running n8n locally or on a private server, you must expose this URL to the public internet. You can do this easily using n8n's built-in tunnel feature. Start n8n from your computer's command line with the following command: n8n start --tunnel After starting, n8n will provide you with a public "tunnel URL". It will look something like https://[subdomain].hooks.n8n.cloud/. Copy this public tunnel URL. Learn more about tunneling in the n8n docs.
5. Connect Twilio to Your n8n Webhook š
In your Twilio Console, navigate to the settings for the phone number (or sandbox) you configured in Step 3. Scroll down to the Messaging section. Find the field labeled "A MESSAGE COMES IN". Paste your n8n Test URL (or your public tunnel URL from the previous step) into this field. Ensure the dropdown next to it is set to HTTP POST. Click Save.
6. Activate and Test Your Workflow ā¶ļø
Go back to your n8n canvas. Click "Test workflow" in the top right corner. This will put your webhook in a "listening" state. Now, send a message from your personal WhatsApp to your configured Twilio WhatsApp number. You should see the workflow execute successfully in n8n and receive a formatted reply on WhatsApp! Once you've confirmed it works, save and activate the workflow to have it run permanently.
Further Reading š
n8n Webhook Node Documentation n8n Twilio Node Documentation Perplexity API Documentation Anthropic API Documentation
Related Templates
USDT And TRC20 Wallet Tracker API Workflow for n8n
Overview This n8n workflow is specifically designed to monitor USDT TRC20 transactions within a specified wallet. It u...
Automate Daily Keyword Research with Google Sheets, Suggest API & Custom Search
Who's it for This workflow is perfect for SEO specialists, marketers, bloggers, and content creators who want to automa...
Bulk Automated Google Drive Files Sharing and Direct Download Link Generation
This N8N workflow automates the process of sharing files from Google Drive. It includes OAuth2 authentication, batch pro...
š Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments