Quick overview
This workflow connects Slack with Google Workspace, Cal.com, OpenWeather, and Google Gemini to act as a Slack-based assistant for Gmail, Calendar, Docs, Sheets, Drive, and Contacts, and to post an automated morning briefing with today’s schedule, unread emails, upcoming bookings, and local weather.
How it works
- Triggers when a Slack event is received, extracts the user’s message and context, and uses a Google Gemini-powered agent with conversation memory to interpret the request.
- Depending on the user’s intent, the agent searches or sends Gmail messages, reads or creates Google Calendar events, creates or fetches Google Docs, reads or appends/updates Google Sheets rows, searches Google Drive, and looks up Google Contacts.
- For scheduling requests, the agent queries Cal.com for available slots and can create a Cal.com booking using the provided attendee and event details.
- Posts the agent’s final response back to Slack in the same channel and thread.
- Runs every weekday and Saturday morning on a cron schedule to prepare a daily briefing for the current day in the Asia/Kolkata timezone.
- Collects today’s Google Calendar events, up to 15 recent unread Gmail messages, upcoming Cal.com bookings, and current weather in Ahmedabad from OpenWeather.
- Summarizes the collected data, asks Google Gemini to generate a prioritized morning briefing, and posts both a concise briefing and a detailed breakdown to a configured Slack channel.
Setup
- Connect Slack OAuth2 credentials, configure Slack Event Subscriptions for the Slack Trigger in your Slack app, and ensure the workflow can post messages to your target channel.
- Add Google Workspace OAuth2 credentials for Gmail, Google Calendar, Google Docs, Google Sheets, Google Drive, and Google Contacts used by the assistant tools.
- Add a Google Gemini credential (or Google AI Studio/Vertex AI configuration as required by your n8n Gemini node) for both the assistant agent and the briefing agent.
- Add a Cal.com API key (HTTP Header Auth credential) and provide the Cal.com event type ID and booking details when requesting availability or creating bookings.
- Set the OPENWEATHER_API_KEY environment variable in n8n and update the OpenWeather city query if you want a location other than Ahmedabad.
- Replace REPLACE_WITH_SLACK_CHANNEL_ID in both morning-briefing Slack nodes with the channel ID where the briefing and detailed breakdown should be posted.