Skip to main content
skill CX Codex

workflow-guide — Claude Code skill: what it does, how to install

Reference rules for writing durable, replay-safe Notion workflows with typed triggers and idempotent steps.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add makenotion/notion-cookbook --skill workflow-guide -a claude-code
Open on GitHub

What workflow-guide does

This skill guides agents when editing src/workflows/*.ts files that export createWorkflow(...). The file name defines the workflow key. It requires wrapping external effects into context.step, covering Notion API requests, network calls, random IDs, timestamps, and mutable state reads. Pure, deterministic logic stays outside steps.

Completed steps replay previously saved outputs on retries. Mutating in-memory variables inside a step breaks this execution model. Every step needs a stable display name and JSON-serializable return values. For looped operations, instead of interpolating an index into the name, it enforces composite keys like { key: ["process-page", page.id] }.

Network calls can succeed before the runner saves the step result. Because retries might repeat an effect, the skill instructs the agent to pass the step callback ID as an idempotency key or use upserts when external APIs lack native support.

What it helps with

  • Structure files in src/workflows/ using default-exported createWorkflow
  • Isolate Notion API interactions and non-deterministic operations inside context.step
  • Configure composite keys and idempotency identifiers for iterated steps
  • Prevent state corruption across workflow retries and step replaying

Example prompts for the agent

  • Create a workflow in src/workflows/sync-pages.ts that updates Notion database entries via context.step
  • Refactor this workflow loop to use composite keys and idempotency tokens for each step
  • Review src/workflows/notifications.ts for replay safety and non-deterministic logic outside steps

How to install workflow-guide

1Skills CLI (Vercel)

npx skills add makenotion/notion-cookbook --skill workflow-guide -a claude-code

2Manually: put the files in place

~/.claude/skills/workflow-guide/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/workflow-guide/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about workflow-guide

How to install workflow-guide in Claude Code?

Run npx skills add makenotion/notion-cookbook --skill workflow-guide -a claude-code. You can also place the file directly at ~/.claude/skills/workflow-guide/SKILL.md.

What does workflow-guide do?

It instructs coding agents on workflow development patterns, step isolation, and replay safety for Notion Cookbook projects.

How should repeated steps be configured in loops?

Do not interpolate IDs into the step label. Provide a fixed display name along with a composite key option, such as { key: ["process-page", page.id] }.

Source text

SKILL.md · MIT
---
name: workflow-guide
description: Reference for typed triggers, durable steps, replay-safe data flow, and idempotent Workflow effects.
user-invocable: false
---

# Workflow guide

Each direct `src/workflows/*.ts` file must default-export `createWorkflow(...)`.
The file name becomes its Workflow key.

Use a step for every result that can change and every external effect. This
includes network and Notion API calls, mutable state reads, timestamps, random
values, generated IDs, messages, creates, and updates. Keep deterministic
transforms of the event and completed step results outside a step.

Completed steps can replay saved results. Do not rely on in-memory mutations
inside a step. Return the values required by later code. Keep calls in a stable
order and give every step a stable display name. The name is also the replay
key by default. For a repeated step, do not interpolate an item ID or loop
index into the name; pass a stable composite key instead:

```ts
await context.step(
  "Process page",
  { key: ["process-page", page.id] },
  async ({ id }) => processPage(page, { idempotencyKey: id })
)
```

Keys must be stable across retries and unique within one workflow run.

Retries can repeat an external effect when it succeeds before its step result
is saved. Pass the callback `id` as an idempotency key. Use a stable external
ID, an upsert, or a duplicate check when the service lacks native support.

Return JSON-serializable values. Throw on failed requests and missing required
configuration. Do not log secrets or private payloads.

© makenotion · MIT · makenotion/notion-cookbook

Similar skills

All skills for Backend and APIs →

From the same set20

workflow-validate Walks through src/workflows/ and flags trigger typing mistakes and retry hazards. Useful before a workflow ships. CX Codex +1 ★ 220repo stars sync This skill guides the design of a new Notion Worker sync and writes the implementation. Use it when an API needs a clear mode, schema, and pagination state. CX Codex +1 ★ 220repo stars sync-validate This skill walks through your sync code and flags the usual failure points: a cursor that never moves, pagination that never ends, dropped deletes. CX Codex +1 ★ 220repo stars sync-guide Instructs coding assistants on building Notion Workers syncs, including replace mode, backfill-delta architectures, pagination, and cursor buffers. CX Codex +1 ★ 220repo stars sync-debug This skill traces failed or incorrect syncs through run logs and project code, then helps verify a fix. Use it when a run errors out or returns unexpected results. CX Codex +1 ★ 220repo stars custom-blocks Walks you through building an interactive UI inside Notion that reads and writes workspace data. CX Codex +1 ★ 220repo stars auth-guide Configures third-party authentication for Notion Workers using brokered credentials, OAuth, or environment secrets. Needed when connecting a worker to APIs like GitHub or Stripe. CX Codex +1 ★ 220repo stars workflow Build or review Notion App workflows with typed triggers, replay-safe steps, and idempotent effects. The skill requires reading the SDK guide before workflow code changes. CX Codex +1 ★ 220repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor