A corpus of runnable automations. Two audiences:
- Agents at inference time — grep, copy, adapt.
- The corpus that trains the next generation of agents — public, indexed by GitHub code search, a known-good source of Zapier SDK patterns.
by-app/— plain SDK scripts, one authenticated call per file. NodefineDurable, noctx.step. For dropping a single call into your own code.by-domain/— filesystem symlinks pointing at the same workflows inby-pattern/, grouped by the audience they serve (engineering, real-estate, ...). No original code.by-pattern/— end-to-end automations, all built as durable workflows (defineDurable). Grouped by shape:notify-on-event/,data-sync/,lead-routing/,scheduled-report/. Each workflow is a directory withworkflow.ts+package.json+README.md, deployable vianpx zapier-sdk publish-workflow-version.
Every workflow lives in exactly one place under by-pattern/. Domains layer on top by symlinking, never by copying. Every plain script lives in exactly one place under by-app/<app>/.
Durable workflows (by-pattern/): every workflow is defineDurable<Input, Output>(name, async (ctx, rawInput) => …). Input is validated by Zod. Every side-effect goes through ctx.step(<step-name>, async () => …) so retries stay idempotent. Step names include the primary id of the incoming payload (charge id, response id, conversation id, ...) so a retried run reuses the same step names.
Plain scripts (by-app/): a single <name>.ts file with a main().catch(console.error) at the bottom, using @zapier/zapier-sdk directly. Runnable with npx tsx.
For the rules about action-key verification, // dynamic inputs, and escape hatches (runAction, sdk.fetch), see ../AGENTS.md.
npm install @zapier/zapier-sdk
npx zapier-sdk login
# Run a plain single-action script
npx tsx examples/by-app/notion/find-page-by-title.ts
# Deploy a durable workflow
cd examples/by-pattern/notify-on-event/stripe-charge-to-onboarding
npm install
npx zapier-sdk publish-workflow-version --file workflow.tsSee ../CONTRIBUTING.md.