Quick overview
This workflow handles inbound WhatsApp Business messages with an OpenAI-powered sales agent that uses Pinecone RAG for product answers and Google Calendar tools for scheduling, then either replies on WhatsApp or hands the conversation to Slack, with Slack-based error alerts.
How it works
- Triggers on every inbound WhatsApp Business message and checks whether the payload contains a text body.
- Drops non-text messages (such as images or voice notes) and continues only with text conversations.
- Uses an OpenAI chat model with per-customer session memory to generate a concise sales reply and decide whether a human handoff is needed.
- Lets the agent query a Pinecone-backed product catalog via OpenAI embeddings to answer pricing, specs, and availability questions.
- Lets the agent check availability and book appointments in Google Calendar when the customer requests scheduling.
- Parses the agent’s HANDOFF flag and either posts the customer message plus draft reply to a Slack channel or sends the reply back to the customer on WhatsApp.
- Sends a Slack alert to an ops channel if any step in the workflow fails.
Setup
- Connect WhatsApp Business Cloud credentials and set the WhatsApp Phone Number ID used to send replies.
- Add OpenAI API credentials for both the chat model and embeddings.
- Configure Pinecone credentials and replace the Pinecone index name used by the product catalog tool.
- Connect Google Calendar credentials and replace the target calendar ID used for availability checks and bookings.
- Connect Slack credentials and set the channel IDs for both the handoff channel and the ops/alerts channel.