The Palos Publishing Company

Follow Us On The X Platform @PalosPublishing
Categories We Write About

Create a chatbot that schedules meetings

Here’s a complete example of a simple chatbot that schedules meetings using Node.js with Express and stores appointments in memory. You can easily expand it with a database and natural language processing later.


Features:

  • Accepts name, date, time, and purpose.

  • Validates inputs.

  • Displays scheduled meetings.


🛠 Requirements:

  • Node.js

  • Express


📁 Project Structure

pgsql
meeting-bot/ │ ├── index.js ├── package.json

Step 1: package.json

json
{ "name": "meeting-bot", "version": "1.0.0", "description": "A simple chatbot to schedule meetings", "main": "index.js", "scripts": { "start": "node index.js" }, "dependencies": { "body-parser": "^1.20.2", "express": "^4.18.2" } }

Step 2: index.js

javascript
const express = require('express'); const bodyParser = require('body-parser'); const app = express(); const port = 3000; let meetings = []; app.use(bodyParser.json()); // Home route app.get('/', (req, res) => { res.send('🤖 Meeting Scheduler Bot is running!'); }); // Get all meetings app.get('/meetings', (req, res) => { res.json(meetings); }); // Schedule a new meeting app.post('/schedule', (req, res) => { const { name, date, time, purpose } = req.body; if (!name || !date || !time || !purpose) { return res.status(400).json({ message: 'Missing required fields' }); } const meeting = { id: meetings.length + 1, name, date, time, purpose, }; meetings.push(meeting); res.status(201).json({ message: 'Meeting scheduled successfully', meeting, }); }); // Delete a meeting app.delete('/cancel/:id', (req, res) => { const id = parseInt(req.params.id); const index = meetings.findIndex(m => m.id === id); if (index === -1) { return res.status(404).json({ message: 'Meeting not found' }); } meetings.splice(index, 1); res.json({ message: 'Meeting cancelled' }); }); app.listen(port, () => { console.log(`📅 Scheduler Bot running at http://localhost:${port}`); });

🚀 Test With Curl or Postman

Schedule Meeting

bash
curl -X POST http://localhost:3000/schedule -H "Content-Type: application/json" -d '{"name": "Alice", "date": "2025-06-01", "time": "14:00", "purpose": "Project Update"}'

View Meetings

bash
curl http://localhost:3000/meetings

Cancel Meeting

bash
curl -X DELETE http://localhost:3000/cancel/1

💡 Optional Enhancements

  • Use a database like MongoDB or PostgreSQL

  • Add time conflict detection

  • Integrate with a calendar API (Google Calendar, Outlook)

  • Add front-end or chatbot UI (e.g., with Botpress, Dialogflow, or React)

Let me know if you’d like a web UI, integration with Google Calendar, or a chatbot interface using Telegram/Slack.

Share this Page your favorite way: Click any app below to share.

Enter your email below to join The Palos Publishing Company Email List

We respect your email privacy

Categories We Write About