💡 Platform feature: script-interop-bus (lightweight cross-script event bridge for composable automation pipelines) #573
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
A shared, lightweight event bus mechanism (using ScriptProperties or a dedicated Sheet) that allows deployed scripts to chain together — for example, gmail-ai-classifier classifies an email, emits an event, and gmail-to-drive-by-labels automatically archives it. Transforms the script catalog from isolated tools into composable pipelines, positioning the project as a free, local-first alternative to Workspace Studio for multi-step automation.
Market Signal
Google Workspace Studio (rolling out through 2026) promotes composable, agentic workflows with visual chaining of automation steps. The market is decisively moving from single-purpose automations to orchestrated pipelines — Zapier, Make, and n8n all center on multi-step workflow composition as their core value proposition. However, Studio requires Business/Enterprise Workspace plans with limited automation runs per plan tier. A free, native-GAS interop bus fills the gap for personal and small-team users who can't or won't pay for Studio. The September 2026 Workspace Studio announcement adding Drive/Gmail/Chat automation steps confirms Google's all-in bet on composability.
User Signal
PR #530 (tag-based retention and 2-way rules sync engine, merged September 2, size XXL) proves the need already exists — it implements a form of cross-script communication between gmail-ai-classifier and gmail-retention-policy. This is the project's largest recent PR and its most architecturally significant: it bridges two scripts that previously ran in isolation. As the catalog grows (5 scripts shipping, 34 more proposed), the value of composability grows quadratically. Users deploying 3+ scripts currently manage 3+ independent hourly triggers with no coordination between them.
Technical Opportunity
GAS
PropertiesServiceprovides a natural key-value store for event passing between scripts within the same Google account. The existing schedule-in-config pattern (hourly trigger →shouldRunNow()check) can be extended to also check an event queue before/after the main processing loop. Each script remains independently deployable and fully functional — the event bus is opt-in. The sharedsrc/gas-utils.jsmodule is the natural home for bus helper functions (emitEvent(),consumeEvents(),peekEvents()). Events are fire-and-forget metadata, not blocking RPC calls — no execution time overhead beyond a singlePropertiesService.getScriptProperties().getProperty()call per trigger run.Assessment
Adversarial Review
Strongest objection: Adding inter-script coupling creates failure cascades and debugging complexity. Scripts currently have zero dependencies on each other, which is a feature, not a bug. Users may not deploy enough scripts to benefit from composition.
Rebuttal: The bus is strictly opt-in and fire-and-forget: scripts work standalone by default, and the event bus adds zero behavior changes unless explicitly configured. Events are lightweight metadata (JSON in ScriptProperties), not blocking RPC calls — a failed consumer doesn't affect the producer. PR #530's 2-way rules sync already implements cross-script state sharing, proving both the pattern and the demand. The bus formalizes what's already happening organically, replacing ad-hoc integration points with a single, inspectable event log. Debugging is simplified, not complicated, because event flow is visible in one place rather than scattered across script-specific properties.
Suggested Next Step
Design the event bus contract: event schema (
{type, source_script, timestamp, payload}), storage mechanism (ScriptProperties vs. shared Sheet — trade-offs around quota limits and inspectability), and discovery protocol. Implement a proof-of-concept with gmail-ai-classifier emittingemail-classifiedevents and gmail-to-drive-by-labels consuming them on its next hourly run. Add bus helper functions tosrc/gas-utils.jswith full Jest test coverage.All reactions