EBOOK · 亲密关系 《别再用关系止痛》已上线:先试看,刺到再买完整版(RM15)
Node Core + GAS Glue: A Two-Layer Architecture That Scales | DAPHNETXG
NSE · Node Systems Engineering Supporting 2 Architecture Pattern

Node Core + GAS Glue: A Two-Layer Architecture That Scales

Most automation systems fail at scale because logic and integration are mixed. This is the architecture I use to keep reasoning explicit and integrations controlled.

Definition (quote-ready)

Node Core + GAS Glue is a two-layer automation architecture where Node.js owns reasoning and state, while Google Apps Script acts as a controlled integration layer to the Google ecosystem.

If you’ve ever built an automation that worked perfectly for two weeks, and then slowly turned into a fragile “please don’t touch it” machine — you’ve likely hit the same root cause: the system’s reasoning and its plumbing grew into one tangled blob.

This article is the architecture I rely on when I want an automation system to survive: changing requirements, more workflows, more users, and the inevitable “can we add one more thing?”

The scaling problem isn’t volume — it’s ambiguity.
When logic and integration are mixed, you stop being able to explain what the system is doing, and you start “guessing” why it broke.

1) The problem: when logic and integration are mixed

Most automation stacks collapse for one simple reason: your workflow tool becomes both the decision-maker and the integration bus.

  • Decisions become implicit: rules live inside connectors and UI steps.
  • State becomes accidental: retries, partial failures, and edge cases behave differently each time.
  • Debugging becomes superstition: you “try again” until it works.

2) The architecture: Node owns the brain, GAS owns the glue

┌───────────────────────────────┐
│           Node Core            │
│  - reasoning / decisions       │
│  - state machine               │
│  - validation / constraints    │
│  - deterministic outputs       │
└───────────────┬───────────────┘
                │ (explicit commands)
                ▼
┌───────────────────────────────┐
│            GAS Glue            │
│  - Google ecosystem IO         │
│  - Sheets / Docs / Drive       │
│  - Gmail / Calendar            │
│  - triggers & simple routing   │
└───────────────────────────────┘

3) The contract: “facts” in, “commands” out

// Facts collected by GAS (or Node fetchers)
const facts = {
  siteUrl: "https://example.com",
  homepageSnapshot: { title: "…", h1: "…", canonical: "…", indexability: "index" },
  constraints: { budgetLevel: "lean", teamSize: 1 }
};

// Commands produced by Node (deterministic)
const commands = [
  { type: "WRITE_REPORT", target: "GoogleDoc", payload: { sections: ["Summary","Judgment","Actions"] } },
  { type: "UPDATE_SHEET", target: "AuditLog", payload: { status: "completed", primaryJudgment: "J1" } }
];

Internal Loop (Hub ⇄ King ⇄ Supporting)

Parent Hub

The main answer page for NSE. Canonical entry for the whole system.

https://daphnetxg.com/nse/

King Page

Definition, boundaries, and the “why” behind NSE.

https://daphnetxg.com/nse/node-systems-engineering/

Supporting 1

Positioning: why I avoid Make/Zapier for real business systems.

https://daphnetxg.com/nse/node-vs-make-zapier/

Supporting 2

Architecture pattern: Node Core + GAS Glue (this page).

https://daphnetxg.com/nse/node-gas-glue-architecture/
Proposed, organized, and documented by DAPHNETXG on December 28, 2025. This page is part of the NSE knowledge system and is designed to be linkable, citeable, and maintainable.