Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"interface": {
"displayName": "Zapier SDK",
"shortDescription": "Programmatic access to Zapier's 9,000+ apps via the TypeScript SDK.",
"longDescription": "Let your agent connect to anything. Zapier handles the keys. Ships the zapier-sdk skill, the zapier-sdk-explorer subagent, and a verified examples corpus so your code uses real action keys the first time.",
"longDescription": "Let your agent connect to anything. Zapier handles the keys. Ships the zapier-sdk skill, the zapier-workflows skill for deploying durable automations, the zapier-sdk-explorer subagent, and a verified examples corpus so your code uses real action keys the first time.",
"developerName": "Zapier",
"category": "Developer Tools",
"capabilities": [],
Expand All @@ -34,7 +34,8 @@
"defaultPrompt": [
"Connect Notion via Zapier and search my pages",
"Send an email through Gmail using the Zapier SDK",
"Look up a Google Sheets row with the Zapier SDK"
"Look up a Google Sheets row with the Zapier SDK",
"Build a Zapier workflow that posts new GitHub issues to Slack"
],
"brandColor": "#FF4F00",
"logo": "./assets/logo.svg",
Expand Down
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Each file below is authoritative for a slice of the repo. Read them; don't re-de
- **[`.github/scripts/README.md`](./.github/scripts/README.md)**: CI checks (structural + live-catalog audit).
- **[`skills/zapier-sdk/SKILL.md`](./skills/zapier-sdk/SKILL.md)**: installable skill manifest (cross-platform).
- **[`skills/zapier-sdk/references/cli-commands.md`](./skills/zapier-sdk/references/cli-commands.md)**: full inventory of `zapier-sdk` CLI commands, generated from `zapier-sdk --help`.
- **[`skills/zapier-workflows/SKILL.md`](./skills/zapier-workflows/SKILL.md)**: installable skill manifest for building, deploying, listing, and modifying durable workflows.
- **[`agents/README.md`](./agents/README.md)**: optional Claude Code subagents that pair with the skill.

## When to use this SDK vs. alternatives
Expand Down Expand Up @@ -51,7 +52,8 @@ No build, lint, or test step lives in this repo. `package.json` has no `scripts`
├── AGENTS.md ← you are here
├── CONTRIBUTING.md
├── skills/
│ └── zapier-sdk/ ← SKILL.md manifest for agent runtimes
│ ├── zapier-sdk/ ← SKILL.md manifest for agent runtimes
│ └── zapier-workflows/ ← SKILL.md manifest for durable workflows
└── examples/
├── by-app/ ← plain single-action SDK scripts
├── by-domain/ ← filesystem symlinks into by-pattern, grouped by audience
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ The [`examples/`](./examples) directory is the heart of this repo — indexed th
Drop every best practice for writing Zapier SDK code straight into your agent's context. Your agent picks up:

- **The `zapier-sdk` skill**: how to authenticate, discover apps and actions at runtime, run actions without inventing method names, and reach for the right escape hatch when there's no first-class action.
- **The `zapier-workflows` skill**: build, test, deploy, list, and modify durable workflows — code that runs on Zapier's infrastructure on a trigger, instead of in your own process.
- **The `zapier-sdk-explorer` subagent**: a read-only investigator that resolves exact app / action / field IDs against the live Zapier catalog before your agent writes a line of code.
- **The verified examples corpus**: every action key checked against `listActions` on the way in, so your agent has canonical, copy-paste-ready patterns to grep.

Expand Down Expand Up @@ -107,7 +108,7 @@ copilot plugin install sdk@zapier

### Cursor and other assistants

The [skill](./skills/zapier-sdk/) conforms to [agentskills.io](https://agentskills.io) so any conformant runtime can load it directly. For tools without native agentskills.io support, clone the repo and reference `skills/zapier-sdk/SKILL.md` from your assistant's rules or instructions file (`.cursorrules`, `AGENTS.md`, `.github/copilot-instructions.md`, etc.):
The [`zapier-sdk`](./skills/zapier-sdk/) and [`zapier-workflows`](./skills/zapier-workflows/) skills conform to [agentskills.io](https://agentskills.io) so any conformant runtime can load them directly. For tools without native agentskills.io support, clone the repo and reference the relevant `SKILL.md` from your assistant's rules or instructions file (`.cursorrules`, `AGENTS.md`, `.github/copilot-instructions.md`, etc.):

```
git clone https://github.com/zapier/sdk.git
Expand All @@ -120,6 +121,7 @@ git clone https://github.com/zapier/sdk.git
- **[docs.zapier.com/sdk/reference](https://docs.zapier.com/sdk/reference)** — full method reference.
- **[docs.zapier.com/sdk/cli-reference](https://docs.zapier.com/sdk/cli-reference)** — CLI reference for `zapier-sdk`.
- **[`skills/zapier-sdk/references/cli-commands.md`](./skills/zapier-sdk/references/cli-commands.md)** — full CLI command inventory in-repo, generated from `zapier-sdk --help`.
- **[`skills/zapier-workflows/`](./skills/zapier-workflows/)** — the durable workflows skill: build, test, deploy, list, and modify code that runs on Zapier's infrastructure.
- **[`@zapier/zapier-sdk`](https://www.npmjs.com/package/@zapier/zapier-sdk)** — runtime SDK on npm.
- **[`@zapier/zapier-sdk-cli`](https://www.npmjs.com/package/@zapier/zapier-sdk-cli)** — CLI companion on npm.
- **[Zapier MCP](https://github.com/zapier/zapier-mcp)** — the MCP-server alternative for tool-calling from Cursor, Claude Desktop, or Codex.
Expand Down
1 change: 1 addition & 0 deletions llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ For the broader Zapier developer docs index (MCP, embedding, integration builder

- [`skills/zapier-sdk/SKILL.md`](https://github.com/zapier/sdk/blob/main/skills/zapier-sdk/SKILL.md): the installable [agentskills.io](https://agentskills.io) manifest covering authentication, discovery, running actions, and escape hatches.
- [`skills/zapier-sdk/references/cli-commands.md`](https://github.com/zapier/sdk/blob/main/skills/zapier-sdk/references/cli-commands.md): full inventory of `zapier-sdk` CLI commands, generated from `zapier-sdk --help`.
- [`skills/zapier-workflows/SKILL.md`](https://github.com/zapier/sdk/blob/main/skills/zapier-workflows/SKILL.md): the installable manifest for building, testing, deploying, listing, and modifying durable Zapier workflows.
- [`agents/README.md`](https://github.com/zapier/sdk/blob/main/agents/README.md): optional Claude Code subagents that pair with the skill.
- [`agents/zapier-sdk-explorer.md`](https://github.com/zapier/sdk/blob/main/agents/zapier-sdk-explorer.md): read-only investigator that resolves exact app, action, and field IDs against the live Zapier catalog.

Expand Down
5 changes: 5 additions & 0 deletions skills.sh.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"title": "Zapier SDK",
"description": "Write Zapier SDK code that works the first time — authenticate, discover apps and actions, and run them without inventing method names.",
"skills": ["zapier-sdk"]
},
{
"title": "Zapier Workflows",
"description": "Build, test, deploy, list, and modify durable Zapier workflows — code that runs on Zapier's infrastructure on a trigger.",
"skills": ["zapier-workflows"]
}
]
}
4 changes: 2 additions & 2 deletions skills/zapier-sdk/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Pick the SDK when the deliverable is code. If the user wants ad-hoc tool calls i
**Two SDK shapes to distinguish:**

- **Plain SDK script** (this file): the user's own code calls the SDK. Runs wherever their code runs (Node script, Next.js route, Lambda, CLI).
- **Durable workflow** (`@zapier/zapier-durable`): the user *deploys* a workflow that Zapier's infrastructure runs on a trigger (webhook, poll, schedule). Retries stay idempotent via `ctx.step`. Read [`references/workflows.md`](references/workflows.md) when the user wants deployment on Zapier's infrastructure instead of running the code themselves.
- **Durable workflow** (`@zapier/zapier-durable`): the user *deploys* a workflow that Zapier's infrastructure runs on a trigger (webhook, poll, schedule). Retries stay idempotent via `ctx.step`. Use the `zapier-workflows` skill when the user wants deployment on Zapier's infrastructure instead of running the code themselves.

## Prerequisites

Expand Down Expand Up @@ -217,7 +217,7 @@ Same auth and audit trail as `runAction`. Use this when the app's Zapier action

## Examples

For fill-in-the-blank skeletons (plain script, Zapier Table, durable workflow), see [`references/examples.md`](references/examples.md). These are shape-only; the real, action-key-verified corpus is at https://github.com/zapier/sdk/tree/main/examples. Grep the corpus by app or pattern when you need a working reference.
For fill-in-the-blank skeletons (plain script, Zapier Table), see [`references/examples.md`](references/examples.md). These are shape-only; the real, action-key-verified corpus is at https://github.com/zapier/sdk/tree/main/examples. Grep the corpus by app or pattern when you need a working reference. For durable workflows, use the `zapier-workflows` skill instead.

## Full documentation

Expand Down
56 changes: 2 additions & 54 deletions skills/zapier-sdk/references/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,61 +84,9 @@ async function main() {
main().catch(console.error);
```

## 3. Durable workflow (notify-on-event shape)
## 3. Durable workflow (deploy to Zapier's infrastructure)

Deployable to Zapier's infrastructure. Runs on a trigger (webhook, poll, schedule). Every side-effect goes through `ctx.step` with the trigger's primary id in the step name so retries are idempotent.

Matches `examples/by-pattern/notify-on-event/<name>/workflow.ts`.

```typescript
// workflow.ts
import { defineDurable } from "@zapier/zapier-durable";
import { createZapierSdk } from "@zapier/zapier-sdk";
import { z } from "zod";

const sdk = createZapierSdk();

// Constants get pulled out and documented in the leaf directory's README.
const DESTINATION_CONNECTION = "<connection-alias>"; // e.g. "gmail_primary"
const DESTINATION_APP_KEY = "<AppCLIAPI>"; // e.g. "GoogleMailV2CLIAPI"

const InputSchema = z.object({
primaryId: z.string(), // whatever id the trigger emits (charge id, response id, ...)
// ...other fields the trigger provides
});
type Input = z.infer<typeof InputSchema>;

export default defineDurable<Input, { done: boolean }>(
"<workflow-name>",
async (ctx, rawInput) => {
const input = InputSchema.parse(rawInput);

// Step name MUST include `${input.primaryId}`. Without it, a retry
// would double-write. This is the whole reason `defineDurable` exists.
await ctx.step(`<action-name>-${input.primaryId}`, async () =>
sdk.runAction({
appKey: DESTINATION_APP_KEY,
actionType: "<write|search|read>",
actionKey: "<action-key>",
connection: DESTINATION_CONNECTION,
inputs: {
// ...
},
}),
);

return { done: true };
},
);
```

Deploy loop:

```bash
npm install
npx tsc --noEmit workflow.ts
npx zapier-sdk publish-workflow-version --file workflow.ts
```
Runs on a trigger (webhook, poll, schedule) instead of in your own process. This is a different skill, not a third skeleton here — see the `zapier-workflows` skill for the full build/test/deploy flow, the idempotency invariant, and the four workflow shapes.

## What these skeletons deliberately leave out

Expand Down
Loading
Loading