
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@loopstack/google-oauth-calendar-example
Advanced tools
An example module demonstrating how to fetch Google Calendar events with OAuth authentication using the Loopstack automation framework. Shows the sub-workflow pattern for handling OAuth flows.
An example module for the Loopstack AI automation framework.
This module demonstrates how to build a workflow that fetches data from an OAuth-protected API (Google Calendar) and handles authentication automatically using the sub-workflow pattern with @loopstack/oauth-module.
The Google OAuth Calendar Example shows a real-world pattern: attempt an API call, and if the user is not authenticated, launch the OAuth workflow as an embedded sub-workflow. Once the user completes sign-in, the parent workflow automatically retries.
By using this example as a reference, you'll learn how to:
OAuthTokenStore to check for valid tokens before making API callsExecuteWorkflowAsyncLinkDocument with embed: true and expanded: trueMarkdownDocumentSee SETUP.md for installation and setup instructions.
start → fetch_events → calendar_fetched
├── (unauthorized) → auth_required → awaiting_auth
│ ↓
│ auth_completed → start (retry)
└── (success) → display_results → end
The GoogleCalendarFetchEventsTool checks for a valid Google OAuth token via OAuthTokenStore.getValidAccessToken(). If no token exists, it returns { error: "unauthorized" } instead of throwing, allowing the workflow to branch:
- tool: googleCalendarFetchEvents
args:
calendarId: ${{ args.calendarId }}
timeMin: ${{ now() }}
timeMax: ${{ endOfWeek() }}
assign:
requiresAuthentication: ${{ result.data.error == "unauthorized" }}
events: ${{ result.data.events }}
If authentication is required, the workflow uses ExecuteWorkflowAsync to launch the generic OAuth workflow as a child. A LinkDocument with embed: true and expanded: true renders the OAuth flow inline as an iframe so the user can authenticate without leaving the page:
- id: auth_required
from: calendar_fetched
to: awaiting_auth
if: ${{ state.requiresAuthentication }}
call:
- tool: executeWorkflowAsync
id: launchAuth
args:
workflow: oAuth
args:
provider: 'google'
scopes:
- 'https://www.googleapis.com/auth/calendar.readonly'
callback:
transition: auth_completed
- tool: createDocument
args:
id: authStatus
document: linkDocument
update:
content:
icon: 'LockKeyhole'
label: 'Google authentication required'
caption: 'Complete sign-in to continue'
href: '/pipelines/{{ runtime.tools.auth_required.launchAuth.data.task.pipelineId }}'
embed: true
expanded: true
When the OAuth sub-workflow completes, the event system triggers auth_completed on the parent, which transitions back to start — automatically re-fetching the calendar events with the now-valid token:
- id: auth_completed
from: awaiting_auth
to: start
trigger: manual
This example uses the following Loopstack modules:
@loopstack/core — Core framework functionality including ExecuteWorkflowAsync@loopstack/oauth-module — OAuth infrastructure (OAuthTokenStore, OAuthWorkflow)@loopstack/core-ui-module — Provides CreateDocument, LinkDocument, and MarkdownDocument@loopstack/create-chat-message-tool — Provides CreateChatMessageA Google OAuth provider module (implementing OAuthProviderInterface) is also required.
Author: Jakob Klippel
License: Apache-2.0
FAQs
An example module demonstrating how to fetch Google Calendar events with OAuth authentication using the Loopstack automation framework. Shows the sub-workflow pattern for handling OAuth flows.
We found that @loopstack/google-oauth-calendar-example demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.