A Logseq plugin that fetches events from your local Outlook calendar and inserts them into your journal pages. This plugin consists of two components: a Logseq plugin (JavaScript) and a local API service (Python) that reads from your Outlook OST file.
- 📅 Fetches events from your local Outlook calendar
- 📝 Inserts events directly into Logseq journal pages
- ⏰ Displays events in chronological order (earliest to latest)
- 👥 Shows attendees for each event (with configurable exclusions)
- ⏱️ Calculates and displays event duration
- 🏷️ Uses Logseq properties for structured data
- 🔃 Shows recurring event indicator
- 🔗 Automatically detects and creates meeting links
- ⚙️ Fully configurable through Logseq plugin settings
- 📋 Customizable output format templates
The main plugin that runs within Logseq and provides the /Get Events slash command.
A local Flask API service that connects to your Outlook installation and retrieves calendar events.
start_api_service.bat- Starts the API service in backgroundlaunch_api.vbs- VBScript for silent startup (used with Task Scheduler)
- Logseq installed and running
- Microsoft Outlook installed on Windows with access to your calendar
- Python 3.x installed
- Required Python packages:
flask,pywin32
-
Create the plugin directory:
- Open your Logseq graph/workspace folder (where your pages and journals are stored)
- Create a new folder named
logseq-get-outlook-eventsin the root of your Logseq directory - This keeps all plugin files organized together in your workspace
-
Copy all project files to the plugin directory:
main.js(Logseq plugin)outlook_events_api.py(API service)requirements.txt(Python dependencies)start_api_service.bat(Service management script)- Any other related files
Your folder structure should look like:
YourLogseqWorkspace/ ├── pages/ ├── journals/ ├── outlook-events-plugin/ │ ├── main.js │ ├── outlook_events_api.py │ ├── requirements.txt │ ├── start_api_service.bat │ └── (other plugin files) └── (other Logseq files)
-
Open the Command Prompt and navigate to the plugin directory:
cd YourLogseqWorkspace\logseq-get-outlook-events
-
(Optional but Recommended) Create a virtual environment:
A virtual environment isolates this project's Python dependencies from your system-wide Python installation. This prevents version conflicts with other Python projects and keeps your system clean.
# Create virtual environment in the plugin directory python -m venv .venv # Activate virtual environment .venv\Scripts\activate
When the virtual environment is active, you'll see
(.venv)in your command prompt. -
Install required Python packages:
pip install -r requirements.txt
-
Test the API service:
python outlook_events_api.py
The service will start on
http://localhost:5000. PressCtrl+Cto stop it for now.
Note: If you created a virtual environment, the start_api_service.bat script will automatically use it. For manual starts, remember to activate it (.venv\Scripts\activate) each time.
- Enable the plugin in Logseq:
- Open Logseq
- Go to Settings → Plugins
- Click "Load unpacked plugin"
- Navigate to and select your
logseq-get-outlook-eventsfolder - The plugin should now appear in your plugins list
For convenience, you can configure the API service to start automatically when you log into Windows using Task Scheduler.
-
Open Task Scheduler:
- Press
Win + R, typetaskschd.msc, and press Enter - Or search for "Task Scheduler" in the Start menu
- Press
-
Create a new task:
- In the right panel, click "Create Task..." (not "Create Basic Task")
-
General Tab:
- Name:
Outlook Events API Service - Description:
Automatically starts the Outlook Events API service for Logseq plugin - Check "Run only when user is logged on"
- Check "Run with highest privileges" (recommended for COM access)
- Name:
-
Triggers Tab:
- Click "New..."
- Begin the task: "At log on"
- Settings: "Specific user" (should show your username)
- Check "Delay task for: 30 seconds" (gives system time to fully load)
- Click "OK"
-
Actions Tab:
- Click "New..."
- Action: "Start a program"
- Program/script:
cmd.exe - Add arguments:
/c "C:\path\to\your\logseq\workspace\logseq-get-outlook-events\launch_api.vbs"(replace with actual path) - Click "OK"
-
Conditions Tab:
- Uncheck all boxes
-
Settings Tab:
- Check "Allow task to be run on demand"
- Check "If the task fails, restart every" and select 1 minute and 3 attempts in the dropdowns
- Check "If the running task does not end when requested, force it to stop"
- Set "If task is already running, then the following rule applies" to "Do not start a new instance"
- Click "OK"
-
Save the Task
- Click "OK"
-
Test the scheduled task:
- Right-click on your new task in the Task Scheduler Library
- Select "Run" to test it
- Check if the API service starts by visiting
http://localhost:5000/healthin your browser. You should get the following response:
{ "outlook_status": "running", "service": "Outlook Events API", "status": "healthy" }- You can then check that the service is also returning events from your calendar by visiting
http://localhost:5000/events/{date}, but replace "{date}" with a day you know you have an event on your calendar. The response should look something like this:
{ "date": "2025-08-21", "events": [ { "attendees": [ "Name, Your", "Simpson, Homer" ], "description": "Agenda: \n\r Review current safety procedures for plant shutdown.", "end": "2025-08-21 15:30:00+00:00", "isRecurring": true, "location": "Microsoft Teams Meeting", "meetingLinks": [], "start": "2025-08-21 15:00:00+00:00", "subject": "Homer Touchbase" } ], "success": true }
After setting up the scheduled task:
- Restart your computer to test automatic startup
- Wait about 1-2 minutes after logging in (allow time for the delayed start)
- Test the service by opening a web browser and going to
http://localhost:5000/health - You should see:
{
"outlook_status": "running",
"service": "Outlook Events API",
"status": "healthy"
}- To disable automatic startup: Open Task Scheduler, find your task, right-click and select "Disable"
- To modify the startup delay: Edit the task, go to Triggers tab, and change the delay time
- To stop the service manually: Use the provided
stop_api_service.batfile
If you set up automatic startup: The API service should start automatically when you log in. Just open Logseq and start using the plugin.
If you prefer manual startup:
-
Start the Python API service first:
# Option 1: Direct command python outlook_events_api.py # Option 2: Using the batch file (runs in background) start_api_service.bat
Keep this running while using the plugin.
-
Open Logseq and navigate to a journal page (daily note)
-
Use the slash command:
- Type
/Get Eventsin any block - The plugin will fetch events for that journal date
- Events will be inserted as blocks below your cursor
- Type
Each event is inserted as a block with the following default format:
Event Title 🔃 [Join Meeting](https://teams.microsoft.com/l/meetup-join/...)
event-time:: 9:00 AM
event-duration:: 01:00:00
attendees:: [Homer Simpson], [Diana Prince]
Where:
- 🔃 indicates a recurring event
- Meeting links are automatically detected and added as clickable links
- All fields are customizable through plugin settings
The plugin is fully configurable through Logseq's plugin settings. Access settings via: Settings → Plugins → Get Outlook Events
- Description: Enter your name as it is returned by Outlook to exclude it from attendees lists
- Default: Empty (no exclusion)
- Example:
"Simpson, Homer"or"Diana Prince"
- Description: URL of the Outlook Events API service
- Default:
http://localhost:5000 - Usage: Change if running the API on a different port or machine
-
Options:
all- Add brackets to all event titlesrecurring- Only add brackets to recurring eventsnone- No brackets (default)
-
Purpose: Creates Logseq page links for events
-
Add Double Brackets to Attendee Names: Choose whether to add [[double brackets]] around attendee names to create Logseq page links
all: Add brackets to all attendee names (default)none: No brackets
-
Purpose: Creates Logseq page links for event attendees
The plugin uses tokens to format dates and times. You can customize the format using the following tokens:
- Year
YYYY- Full year (2025)YY- Short year (25)
- Month
MMMM- Full month name (September)MMM- Short month name (Sep)MM- Two-digit month (09)M- Month number (9)
- Day
DD- Two-digit day (15)D- Day number (15)dddd- Full day name (Monday)ddd- Short day name (Mon)
- Hour
HH- Two-digit 24-hour (09)H- 24-hour (9)hh- Two-digit 12-hour (09)h- 12-hour (9)
- Minute
mm- Two-digit minutes (05)m- Minutes (5)
- Second
ss- Two-digit seconds (03)s- Seconds (3)
- AM/PM
A- Uppercase (AM)a- Lowercase (am)
h:mm a→ 9:30 amHH:mm→ 09:30ddd, MMM D, h:mm a→ Mon, Sep 15, 9:30 AMYYYY-MM-DD HH:mm→ 2025-09-15 09:30
- Description: Comma-separated list of base URLs to search for meeting links
- Default:
https://teams.microsoft.com,https://zoom.us,https://meet.google.com - Example:
https://teams.microsoft.com,https://zoom.us,https://webex.com - Note: The plugin will find any URLs in event descriptions that start with these base URLs
- Description: Customize how events are displayed using template variables
- Default:
{subject}\nevent-time:: {time}\nevent-duration:: {duration}\nattendees:: {attendees} - Available Variables:
{subject}- Event title (with brackets, emoji, and meeting links){time}- Start time in 12-hour or 24-hour format{duration}- Event duration in HH:MM:SS format{attendees}- Formatted attendee list{location}- Event location{description}- Event description (truncated if configured)
- Special Features:
- Use
\nfor line breaks - Use
---CHILD---to create child blocks
- Use
- Example Custom Template:
## {subject} **Time:** {time} ({duration}) **Location:** {location} ---CHILD--- **Attendees:** {attendees} ---CHILD--- **Notes:** {description}
- Description: Whether to show fields even when they're empty
- Default:
false - Example: When
true, showslocation::even if no location is set
- Description: Maximum characters to include from event descriptions
- Default:
200 - Usage: Set to
0for no limit
The plugin automatically scans event descriptions for meeting links and adds clickable "Join Meeting" links to event titles.
How it works:
- Configure the meeting base URLs in settings (e.g.,
https://teams.microsoft.com/l/meetup-join) - The plugin searches event descriptions for URLs starting with these base URLs
- Found links are added as
[Join Meeting](URL)next to the event title - Multiple links are numbered:
[Join Meeting 1](URL1) [Join Meeting 2](URL2)
The Python service provides several endpoints:
GET /health- Health checkGET /events/YYYY-MM-DD- Get events for specific dateGET /events/today- Get today's eventsGET /events?date=YYYY-MM-DD&meeting_urls=url1,url2- Get events with meeting URL detection
Examples:
http://localhost:5000/events/2025-08-19
http://localhost:5000/events/today
http://localhost:5000/events/2025-08-19?meeting_urls=https://teams.microsoft.com/l/meetup-join
You can create complex event layouts using the output format template. Here are some examples:
{subject}
{time}
{subject}
event-time:: {time}
event-duration:: {duration}
---CHILD---
location:: {location}
---CHILD---
description:: {description}
---CHILD---
attendees:: {attendees}
## {subject}
⏰ {time} | ⏱️ {duration}
📍 {location}
👥 {attendees}
Recurring events are automatically identified and marked with a 🔃 emoji. You can configure bracket settings to automatically create page links for recurring events only.
-
"No events found" message:
- Ensure the Python API service is running
- Check that you're on a journal page (daily note)
- Verify events exist in Outlook for that date
- Occasionaly the API service disconnects from the Outlook COM. Stopping and restarting the service should correct the issue
-
API connection errors:
- Confirm the Python service is running on localhost:5000
- Check the API URL setting in plugin configuration
- Ensure Windows Firewall isn't blocking the connection
-
Meeting links not appearing:
- Verify meeting base URLs are configured correctly
- Check that meeting links in Outlook match the configured base URLs
- Ensure the Python service is receiving the meeting URLs parameter
-
Plugin not loading:
- Verify the plugin folder structure
- Check Logseq's plugin settings
- Review browser console for JavaScript errors
-
Formatting issues:
- Check the output format template for syntax errors
- Ensure
\nis used for line breaks, not actual newlines - Verify template variable names are spelled correctly
-
Automatic startup not working:
- Check Task Scheduler to ensure the task is enabled and configured correctly
- Verify the path to
launch_api.vbsis correct in the scheduled task - Try running the scheduled task manually to test it
- Check Windows Event Viewer for any error messages related to the task
The plugin logs detailed information to Logseq's console. Open Developer Tools (CTRL + Shift + i) to view debug output.
- Events are fetched in Outlook's local timezone
- Times are displayed in either 12-hour format (9:00 AM) or 24-hour format (09:00) based on plugin settings
- Duration is always calculated and displayed as HH:MM:SS format
- User triggers
/Get Eventscommand on a journal page - Plugin extracts the journal date and configuration settings
- API request sent to Python service with meeting URL parameters
- Python service queries Outlook COM interface and extracts meeting links
- Events returned as JSON with meeting links included
- Plugin formats events using configured templates and inserts as Logseq blocks
The Python service uses regular expressions to find URLs in event descriptions that start with the configured base URLs. It handles:
- Multiple meeting links per event
- Various URL formats and parameters
- Cleaning up URLs (removing trailing punctuation)
The background service management system includes:
- Process detection and PID tracking for reliable service control
- Automatic cleanup of stale process files
- Log rotation to prevent log files from growing too large
- Silent background operation using VBScript for Task Scheduler integration
- The API service only runs locally (localhost)
- No external network connections required
- Calendar data never leaves your local machine
- Uses Windows COM interface for secure Outlook access
- Meeting links are passed as URL parameters but only between local services
This project is available under GNU General Public License version 3.
Feel free to submit issues, improvements, or feature requests. This is a personal project but contributions are welcome through a GitHub Issues submittion or Pull Request at https://github.com/DavidJayMartin/logseq-get-outlook-event.