• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
stevekrouse

stevekrouse

form-to-substack

Google Form → AI Blog Post → Substack Draft pipeline
Public
Like
form-to-substack
Home
Code
3
README.md
test-google-sheet.ts
test-substack.ts
Connections
Environment variables
Branches
1
Pull requests
Remixes
1
History
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
…
Viewing readonly version of main branch: v5
View latest version
README.md

Form to Substack

Automatically detects new Google Form submissions (via a linked Google Sheet), generates a blog post with AI, and pushes it to Substack as a draft.

Architecture

Rendering mermaid diagram...

How It Works

  1. Poll Google Sheet — An interval val runs on a schedule (e.g. every 15 min). It fetches all rows from the unlisted Google Sheet via the public CSV/JSON export URL (no API key needed for unlisted sheets).
  2. Deduplicate — Each row's timestamp (or row number) is tracked in SQLite so we never process the same submission twice.
  3. Generate Blog Post — New submissions are sent to OpenAI (via Val Town's std/openai) to generate a full blog post (title + HTML body).
  4. Push to Substack — The generated post is created as a draft on Substack via its internal API (POST /api/v1/post/), authenticated with your substack.sid cookie.
  5. Log & Review — You review and publish drafts in Substack's UI.

Environment Variables

KeyDescriptionHow to get it
GOOGLE_SHEET_IDThe ID from your Google Sheet URL (between /d/ and /edit)Copy from the sheet URL
SUBSTACK_SIDYour substack.sid cookie valueBrowser DevTools → Application → Cookies → substack.com → substack.sid
SUBSTACK_PUB_URLYour publication subdomain, e.g. yourname.substack.comYour Substack URL

Val Town's standard OpenAI is used for inference (no separate API key needed on Pro).

Files

  • README.md — This file
  • test-google-sheet.ts — Script to test Google Sheet connectivity
  • test-substack.ts — Script to test Substack API connectivity
  • main.ts — (TODO) The main interval cron that ties it all together

Status

  • Project plan
  • Test Google Sheet connection
  • Test Substack connection
  • AI blog post generation
  • Main pipeline cron
  • Dashboard (optional)
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
AboutAlternativesPricingBlogNewsletterCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.