Runtime Automation
Local automation scripts for sharing Adapt Action Explorer feedback and usage signals into Slack.
Runtime scripts live in this project folder and are exposed through repository-root npm commands.
Current script layout:
projects/adapt-action-explorer/scripts/env/check-env.tsprojects/adapt-action-explorer/scripts/posthog/index.tsprojects/adapt-action-explorer/scripts/typeform/fetch-typeform-feedback.ts
Setup
# From the cdp-index repository root:
cp .env.example .envFill in the root .env with real tokens. Do not commit .env or other secret-bearing env files.
Environment loading now comes from the root CDP Index runtime helper in src/runtime/env.ts. It loads .env, .env.local, environment-specific .env.* files, and .env.pets from the repository root first, then this app folder for optional local overrides.
Secret Managers
Doppler and Infisical can inject secrets at runtime instead of storing them in plaintext .env files. The repo still supports .env as a fallback.
The root Doppler manifest is ../doppler.yaml. It names Doppler project/config bindings for apps in this repo plus required secret keys. It intentionally does not contain secret values.
Install status can be checked with:
doppler --version
infisical --versionConfigure Doppler for this app from the repository root:
npm run env:doppler:login
npm run env:doppler:check -- cdp-worldwideConfigure Infisical for this app if that project is available:
infisical login
infisical initDefine these secrets in either provider:
SLACK_BOT_TOKENTYPEFORM_ACCESS_TOKENPOSTHOG_PERSONAL_API_KEY
Set them in Doppler:
doppler secrets set --project cdp-worldwide --config dev SLACK_BOT_TOKEN
doppler secrets set --project cdp-worldwide --config dev TYPEFORM_ACCESS_TOKEN
doppler secrets set --project cdp-worldwide --config dev POSTHOG_PERSONAL_API_KEYDefault scripts run through Doppler:
npm run feedback:fetch -- --date 2026-06-08
npm run feedback:share-slack -- --date 2026-06-08Infisical wrappers remain available if that project is configured:
npm run feedback:fetch:infisical -- --date 2026-06-08
npm run feedback:share-slack:infisical -- --date 2026-06-08Required Access
- Slack bot token with
chat:write. - Slack bot invited to each target channel.
- Typeform access token for feedback sharing.
- PostHog personal API key with
query:read.
Commands
npm run check
npm run env:check
npm run trigger:devFetch Typeform feedback submitted today as JSON:
npm run feedback:fetch -- --date 2026-06-08Preview Typeform feedback as Slack messages without posting:
npm run feedback:share-slack:dry-run -- --date 2026-06-08Post Typeform feedback submitted today to Slack:
npm run feedback:share-slack -- --date 2026-06-08Fetch one Typeform response:
npm run feedback:fetch -- --response-id RESPONSE_IDShare one Typeform response:
npm run feedback:share-slack -- --response-id RESPONSE_IDPreview the PostHog Slack message without posting:
npm run posthog:share-slack:dry-runFetch the default PostHog summary as JSON:
npm run posthog:fetch -- --days 7 --limit 10Post the default PostHog summary:
npm run posthog:share-slack -- --days 7 --limit 10Post a custom HogQL query:
npm run posthog:share-slack -- --title "Adapt Action Explorer signups" --query "SELECT count() AS signups FROM events WHERE event = 'signup' AND timestamp >= now() - INTERVAL {days} DAY"Trigger.dev Schedules
Trigger.dev is initialized for project proj_josluemttxuyxlckpgpf.
Registered tasks:
posthog-summary-to-slack: publishesprojects/adapt-action-explorer/scripts/posthog/index.ts.typeform-feedback-to-slack: publishesprojects/adapt-action-explorer/scripts/typeform/fetch-typeform-feedback.ts.
Both tasks call the same project-local Node scripts used by the root npm commands. Direct Typeform runs fetch JSON unless Slack publishing is explicitly requested through the automation wrapper.
Kennel owns the Trigger.dev schedules in the root raggle.json publish config:
posthog-summary-to-slack: runs daily at 09:00 and 17:00 Europe/London.typeform-feedback-to-slack: runs hourly in Europe/London.
Deploy Trigger.dev tasks manually while developing:
npm run trigger:dev
npm run trigger:deploynpm run trigger:dev verifies the tasks locally. npm run trigger:deploy deploys the task definitions for project proj_josluemttxuyxlckpgpf.
On production docs deploy, kennel deploy runs the configured Trigger.dev deploy command and creates or updates the schedules with stable deduplication keys. Kennel loads TRIGGER_SECRET_KEY from Doppler project cdp-worldwide, config prd.
Set production secrets in Trigger.dev before deploying:
SLACK_BOT_TOKENTYPEFORM_ACCESS_TOKENPOSTHOG_PERSONAL_API_KEY
Optional Trigger.dev schedule overrides:
POSTHOG_SUMMARY_DAYSPOSTHOG_SUMMARY_LIMITPOSTHOG_SUMMARY_TITLETYPEFORM_FEEDBACK_DATEfor one-off backfills only.
Environment Variables
SLACK_BOT_TOKEN
: Slack bot token used by both scripts.
TYPEFORM_ACCESS_TOKEN
: Typeform API access token.
Typeform feedback publishing routes are defined in code:
- Typeform form
h0Og6Gmeposts to Slack channelC0B6FN8KHRC.
POSTHOG_PERSONAL_API_KEY
: PostHog personal API key for private query endpoints.
PostHog summary routing is defined in code:
- PostHog project
141282onhttps://eu.posthog.composts to Slack channelC0B9VA48737.