Back to selected work

Messaging Integration Case Study

LINE Workflow Bridge

A real-time LINE messaging integration for record-system-managed records — using GCP Cloud Functions for webhook handling and a deliberate Reply vs Push routing architecture.

This project connected source record events to LINE push notifications and built a two-way response loop through a GCP Functions webhook receiver. The architecture decision that mattered most was separating Reply API (cheap, session-scoped, expires in 30 s) from Push API (any-time, per-message cost) and enforcing that boundary as a hard rule — not a convention.

Architecture decision

Reply vs Push routing

Choosing the right LINE API call mode per trigger prevented unexpected messaging costs and ensured delivery semantics matched the use case for every notification type.

Webhook stack

GCP Cloud Functions

Serverless webhook receiver handles LINE postback events with HMAC-SHA256 signature verification before any business logic runs.

Notification format

Flex Message

Rich structured messages replace plain text for status notifications — size tokens (sm / md / lg) selected for consistent mobile rendering.

Source bridge

server-side proxy

Client-side browser customization uses server-side proxy to call LINE API — bypassing CORS restrictions without exposing tokens in the browser.

01

Problem

Operations staff needed real-time LINE notifications when source record statuses changed, and users needed a way to respond or acknowledge via LINE without accessing record system directly. The existing workflow relied on manual notifications with no audit trail for confirmations.

02

Constraints

The browser customization layer runs in the browser, which means direct LINE API calls would expose tokens to the client. GCP Cloud Functions provided the webhook receiver endpoint that LINE's platform required — the challenge was making the two-way flow reliable under cold start conditions and noisy record system webhook payloads.

  • LINE API tokens must not be exposed in browser-side browser customization code
  • GCP Functions cold start latency could cause LINE signature verification to time out
  • record webhooks fire on every field update — not just status changes that need notifications
  • Reply API tokens expire after 30 seconds — incorrect use silently wastes the token

03

Approach

The architecture split into two halves: browser customization scripts for outbound push notifications, and a GCP Cloud Functions endpoint for inbound LINE webhook handling. The key routing rule — Reply API only for immediate responses to user messages, Push API for all status change notifications — was enforced as a hard boundary in the codebase.

  • server-side proxy wraps all LINE API calls from the customization layer — no tokens reach the browser
  • Status change hooks filter at the source field level before triggering any API calls
  • GCP Functions validates HMAC-SHA256 signature before parsing the event payload
  • Flex Message templates use size tokens rather than raw px values for predictable mobile rendering

04

Reply vs Push Decision Rule

The most consequential architectural pattern was the Reply vs Push distinction. Reply API is cheaper and session-scoped — valid only for responding to a user's incoming message within 30 seconds. Push API is always-available but costs per message. Using Push for everything is expensive; using Reply for async status notifications causes silent failures.

  • Reply API: only for direct responses to user postback events — immediate, within-session use only
  • Push API: for all status change notifications and any outbound message not triggered by a user action
  • Postback handlers in GCP Functions always use Reply — the reply token from the event payload is consumed once
  • source status change hooks always use Push — they fire outside any user LINE session

05

Outcome

Staff received real-time LINE push notifications on source record status changes with no manual intervention. Users could acknowledge or respond via LINE buttons, triggering postback events that GCP Functions handled and wrote back to record system. The Reply vs Push boundary held — notification delivery was reliable and messaging costs stayed predictable.

Continue Exploring

KPI Monitoring Dashboard is also live.

Each case study covers a different part of the stack — see how the same engineering principles show up across different problem types.

Read KPI Monitoring Dashboard