Lesson 15easy10 min
Generating Mock Data for Google Calendar
Create representative mock calendar events to test agent reasoning without altering live calendars.
Learning Objectives
- Structure realistic meeting payloads with start/end times and attendee lists
- Incorporate edge cases like overlapping events and missing locations
- Load mock data into n8n Code nodes for offline testing
Generating Mock Data for Google Calendar
Before connecting production Google credentials, developing with mock data accelerates testing and eliminates unnecessary API roundtrips.
Mock Calendar Payload
Add a Code node named Mock Calendar Provider:
javascript
const today = new Date().toISOString().split('T')[0];
return [
{
json: {
items: [
{
id: "evt_1",
summary: "Q3 Product Architecture Review",
start: { dateTime: `${today}T09:00:00Z` },
end: { dateTime: `${today}T10:00:00Z` },
attendees: ["ceo@company.com", "cto@company.com"],
location: "Zoom Conference Room A",
urgent: true
},
{
id: "evt_2",
summary: "Lunch with Angel Investors",
start: { dateTime: `${today}T12:30:00Z` },
end: { dateTime: `${today}T13:30:00Z` },
attendees: ["partner@venturefirm.com"],
location: "Bistro Central (Outdoor Terrace)",
urgent: false
},
{
id: "evt_3",
summary: "Sprint Planning & Standup",
start: { dateTime: `${today}T15:00:00Z` },
end: { dateTime: `${today}T16:00:00Z` },
attendees: ["engineering-team@company.com"],
location: "Google Meet",
urgent: false
}
]
}
}
];
Notice the second meeting: an outdoor terrace lunch. When the agent checks weather later, it should cross-reference this outdoor location against storm forecasts!