Food Delivery Dispatch Agent
Accept orders over WhatsApp, coordinate with your POS and logistics provider, and send customers real-time delivery updates.
What you'll build
An agent that takes food orders over WhatsApp, forwards them to your POS, hands off to your logistics provider for driver dispatch, and keeps customers updated with order status and estimated delivery times.
Prerequisites
- BimpeAI account with an API key (
sk_…) - Read Anatomy of a workflow agent first — this recipe skips steps covered there
- POS, logistics, and Google Calendar integrations connected in the Console dashboard (see Step 4)
- WhatsApp Business number connected in the Console dashboard
Steps
1. Find the workflow
import { BimpeAI } from "@bimpeai/sdk";
const bimpe = new BimpeAI({ apiKey: process.env.BIMPEAI_API_KEY! });
const page = await bimpe.workflows.list({ scope: "public", search: "food delivery" });
const workflow = page.data[0];
console.log(workflow.id, workflow.name);import os
from bimpeai import BimpeAI
client = BimpeAI(api_key=os.environ["BIMPEAI_API_KEY"])
page = client.workflows.list(scope="public", search="food delivery")
workflow = page.data[0]
print(workflow.id, workflow.name)2. Create the agent
const agent = await bimpe.agents.create(
{
name: "Delivery dispatch agent",
system_prompt:
"You take food orders from customers, confirm the order details and delivery address, " +
"provide an estimated delivery time, and send status updates as the order progresses. " +
"Always confirm the order total before marking it as placed.",
agent_workflow_id: workflow.id,
},
{ idempotencyKey: "create-delivery-agent-v1" },
);
console.log(agent.id);agent = client.agents.create(
name="Delivery dispatch agent",
system_prompt=(
"You take food orders from customers, confirm the order details and delivery address, "
"provide an estimated delivery time, and send status updates as the order progresses. "
"Always confirm the order total before marking it as placed."
),
agent_workflow_id=workflow.id,
idempotency_key="create-delivery-agent-v1",
)
print(agent.id)3. Add knowledge bases
Provide the menu with pricing and a delivery zone map so the agent can quote costs and estimated times accurately.
// Menu and pricing
await bimpe.agents.knowledgeBases.create(agent.id, {
type: "text",
name: "Menu and pricing",
content:
"Burger meal — £9.50 (burger, fries, drink)\n" +
"Veggie wrap — £8.00\n" +
"Loaded nachos — £6.50\n" +
"Soft drinks — £2.00\n" +
"Minimum order: £12.00",
});
// Delivery zones
await bimpe.agents.knowledgeBases.create(agent.id, {
type: "text",
name: "Delivery zones",
content:
"Zone A (0–2 km): £1.50 delivery, 20–30 min estimated\n" +
"Zone B (2–5 km): £2.50 delivery, 30–45 min estimated\n" +
"Zone C (5–8 km): £3.50 delivery, 45–60 min estimated\n" +
"Outside 8 km: not available",
});# Menu and pricing
client.agents.knowledge_bases.create(agent.id, {
"type": "text",
"name": "Menu and pricing",
"content": (
"Burger meal — £9.50 (burger, fries, drink)\n"
"Veggie wrap — £8.00\n"
"Loaded nachos — £6.50\n"
"Soft drinks — £2.00\n"
"Minimum order: £12.00"
),
})
# Delivery zones
client.agents.knowledge_bases.create(agent.id, {
"type": "text",
"name": "Delivery zones",
"content": (
"Zone A (0–2 km): £1.50 delivery, 20–30 min estimated\n"
"Zone B (2–5 km): £2.50 delivery, 30–45 min estimated\n"
"Zone C (5–8 km): £3.50 delivery, 45–60 min estimated\n"
"Outside 8 km: not available"
),
})4. Connect channels and integrations (dashboard)
POS, logistics, and channels are configured in the dashboard
The API cannot create integrations or channel connections. POS sync, driver dispatch, and channel setup all happen in the Console dashboard. The SDK can list active integrations but cannot create or modify them.
- Open Console dashboard → Agents → select your agent.
- Under Channels, connect your WhatsApp Business number.
- Under Integrations, connect your POS system so orders flow through to the kitchen.
- Under Integrations, connect your logistics or delivery API for driver assignment and tracking.
- Under Integrations, connect Google Calendar if your delivery windows are managed there.
5. Verify and go live
const integrations = await bimpe.agents.integrations.list(agent.id);
console.log("Active integrations:", integrations.map((i) => i.name));integrations = client.agents.integrations.list(agent.id)
print("Active integrations:", [i.name for i in integrations])Full example
import { BimpeAI } from "@bimpeai/sdk";
const bimpe = new BimpeAI({ apiKey: process.env.BIMPEAI_API_KEY! });
// 1. Find workflow
const page = await bimpe.workflows.list({ scope: "public", search: "food delivery" });
const workflow = page.data[0];
// 2. Create agent
const agent = await bimpe.agents.create(
{
name: "Delivery dispatch agent",
system_prompt:
"You take food orders from customers, confirm order details and delivery address, " +
"provide an estimated delivery time, and send status updates as the order progresses.",
agent_workflow_id: workflow.id,
},
{ idempotencyKey: "create-delivery-agent-v1" },
);
// 3. Add knowledge bases
await bimpe.agents.knowledgeBases.create(agent.id, {
type: "text",
name: "Menu and pricing",
content:
"Burger meal — £9.50\n" +
"Veggie wrap — £8.00\n" +
"Minimum order: £12.00",
});
await bimpe.agents.knowledgeBases.create(agent.id, {
type: "text",
name: "Delivery zones",
content:
"Zone A (0–2 km): £1.50 delivery, 20–30 min\n" +
"Zone B (2–5 km): £2.50 delivery, 30–45 min",
});
// 4. Verify integrations (connected via dashboard)
const integrations = await bimpe.agents.integrations.list(agent.id);
console.log("Agent ID:", agent.id);
console.log("Integrations:", integrations.map((i) => i.name));
// 5. Stream incoming WhatsApp orders
const controller = new AbortController();
for await (const event of bimpe.conversations.messages.stream(
agent.id,
"<conversation_id>",
{ signal: controller.signal },
)) {
console.log(event.role, event.message);
}import os
from bimpeai import BimpeAI
client = BimpeAI(api_key=os.environ["BIMPEAI_API_KEY"])
# 1. Find workflow
page = client.workflows.list(scope="public", search="food delivery")
workflow = page.data[0]
# 2. Create agent
agent = client.agents.create(
name="Delivery dispatch agent",
system_prompt=(
"You take food orders from customers, confirm order details and delivery address, "
"provide an estimated delivery time, and send status updates as the order progresses."
),
agent_workflow_id=workflow.id,
idempotency_key="create-delivery-agent-v1",
)
# 3. Add knowledge bases
client.agents.knowledge_bases.create(agent.id, {
"type": "text",
"name": "Menu and pricing",
"content": "Burger meal — £9.50\nVeggie wrap — £8.00\nMinimum order: £12.00",
})
client.agents.knowledge_bases.create(agent.id, {
"type": "text",
"name": "Delivery zones",
"content": (
"Zone A (0–2 km): £1.50 delivery, 20–30 min\n"
"Zone B (2–5 km): £2.50 delivery, 30–45 min"
),
})
# 4. Verify integrations (connected via dashboard)
integrations = client.agents.integrations.list(agent.id)
print("Agent ID:", agent.id)
print("Integrations:", [i.name for i in integrations])
# 5. Stream incoming WhatsApp orders
for event in client.conversations.messages.stream(agent.id, "<conversation_id>"):
print(event.role, event.message)Deploy
Store your API key in BIMPEAI_API_KEY. Confirm all three integrations (POS, logistics, Google Calendar) are listed by integrations.list before directing live traffic to the agent. Update delivery zone pricing and menu KB entries whenever your rates change.
Variations
- Push a confirmation message server-side once the kitchen marks an order ready: use
conversations.messages.sendwith the confirmed ETA. - Add a knowledge base entry for peak-hour surcharges and update it automatically from a scheduled script.
- Extend to multiple locations by creating a separate agent per restaurant, each with its own delivery zone KB.
Flash Sale & Promo Notification Agent
Push time-limited deals to a contact list over WhatsApp or outbound voice, then handle the inbound spike of orders and questions.
Fraud Alert Verification Agent
Call customers automatically when a transaction is flagged, walk through a verification flow, and escalate to a human or block the card if verification fails.