К основному содержанию
скилл CX Codex

migrating-to-workflow-sdk — скилл для Claude Code: перенос воркфлоу

Помогает перевести оркестрацию с Temporal, Inngest, Trigger.dev или AWS Step Functions на Workflow SDK и выдаёт готовый план миграции с кодом.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add vercel/workflow --skill migrating-to-workflow-sdk -a claude-code
Открыть на GitHub

Что делает migrating-to-workflow-sdk

Скилл включается, когда вы переносите существующую оркестрацию на Workflow SDK. Сначала он определяет исходную систему и целевой рантайм, потом вытаскивает из старого кода точки входа, ожидания и таймеры, внешние колбэки, ретраи, дочерние воркфлоу и побочные эффекты.

Дальше работа идёт по жёстким правилам: оркестрация живёт в функциях "use workflow", а вызовы SDK, базы, HTTP и работа со стримом — в "use step". Для сигналов и .waitForTaskToken выбирается ровно одна поверхность возобновления: createHook() + resumeHook() для серверного резюма по детерминированному токену либо createWebhook() для колбэк-URL. Пары вроде createWebhook() вместе с resumeHook() считаются ошибкой.

На выходе — фиксированная структура: план миграции, маппинг «источник → цель», перенесённый код, границы приложения, чек-лист проверки и открытые вопросы. Чек-лист валит черновик, если в коде остались примитивы исходного фреймворка, sleep() попал внутрь шага или дочерний воркфлоу зовёт start() прямо из контекста воркфлоу. Для self-hosted варианта скилл дополнительно читает references/runtime-targets.md: код шагов не меняется, но развёртыванию нужна реализация World и стартовый бутстрап.

Какие задачи решает

  • перенести Activities и Workers из Temporal на Workflow SDK
  • переписать step.run() и step.waitForEvent() из Inngest
  • заменить wait.forToken и triggerAndWait из Trigger.dev
  • разобрать ASL JSON и состояния Task, Choice, Wait, Parallel
  • вынести побочные эффекты из контекста воркфлоу в шаги

Примеры запросов агенту

  • Перенеси мой воркфлоу из Temporal на Workflow SDK, покажи план миграции и чек-лист проверки
  • У меня Inngest с step.waitForEvent(), нужен колбэк-URL с обычным ответом 202 — подбери поверхность возобновления
  • Переведи ASL-машину из AWS Step Functions, состояния Task и Choice, на "use workflow" и "use step"

Как установить migrating-to-workflow-sdk

1Через Skills CLI (Vercel)

npx skills add vercel/workflow --skill migrating-to-workflow-sdk -a claude-code

2Вручную: положить файлы

~/.claude/skills/migrating-to-workflow-sdk/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/migrating-to-workflow-sdk/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Из того же набора5

Похожие

workflow-automation sickn33 Скилл про долговечное выполнение шагов: если сеть отвалилась посередине, workflow продолжит с места обрыва, а не с начала. CX Codex +1 1 500установок agent-advisor aws Ведёт от идеи агента до исполняемого POC на AWS: подбирает рантайм по баллам и планирует миграцию существующих нагрузок. CX Codex +1 316установок inngest sickn33 Скилл для работы с Inngest: настраивай фоновые задачи, event-driven workflows и долгоживущие процессы без управления очередями и воркерами. Пригодится, если нужны отложенные операции, многошаговые workflow или обработка вебхуков. CX Codex +1 1 200установок temporal-developer официальный Temporal Помогает писать воркфлоу, отлаживать ошибки недетерминизма и управлять воркерами Temporal на разных языках. CX Codex GP ChatGPT 17установок inngest-agents inngest Скилл для сборки и отладки агентов на Inngest и AgentKit: вызовы моделей, инструменты, ожидание одобрения человека, прогресс в реальном времени. CX Codex +1 657установок migrating-ai-sdk-to-common-ai astronomer Переводит Airflow-проекты с airflow-ai-sdk на официальный провайдер apache-airflow-providers-common-ai 0.4.0+. Пригодится, когда LLM-декораторы и конфигурация моделей переезжают на соединения. CX Codex +1 348установок

Рядом в теме «Настройка агента: память, контекст, субагенты»

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →

Вопросы о migrating-to-workflow-sdk

Как установить migrating-to-workflow-sdk в Claude?

Выполните npx skills add vercel/workflow --skill migrating-to-workflow-sdk -a claude-code. Скилл появится в ~/.claude/skills/migrating-to-workflow-sdk/SKILL.md.

Что делает migrating-to-workflow-sdk?

Разбирает вашу оркестрацию и переносит её на Workflow SDK: определяет исходную систему, выбирает поверхность возобновления и отдаёт план миграции вместе с кодом и чек-листом.

С какими системами он работает?

С Temporal, Inngest, Trigger.dev и AWS Step Functions. Для каждого есть свой файл в references/.

Исходный текст

SKILL.md · Apache-2.0
---
name: migrating-to-workflow-sdk
description: Migrates Temporal, Inngest, Trigger.dev, and AWS Step Functions workflows to the Workflow SDK. Use when porting Activities, Workers, Signals, step.run(), step.waitForEvent(), Trigger.dev tasks / wait.forToken / triggerAndWait, ASL JSON state machines, Task/Choice/Wait/Parallel states, task tokens, or child workflows.
metadata:
  author: Vercel Inc.
  version: '0.3.0'
---

# Migrating to the Workflow SDK

Use this skill when converting an existing orchestration system to the Workflow SDK.

## Intake

1. Identify the source system:
   - Temporal
   - Inngest
   - Trigger.dev
   - AWS Step Functions
2. Identify the target runtime:
   - Managed hosting -> keep examples focused on `start()`, `getRun()`, hooks/webhooks, and route handlers.
   - Self-hosted -> also read `references/runtime-targets.md` and explicitly say the workflow/step code can stay the same, but deployment still needs a `World` implementation and startup bootstrap.
3. Extract the source constructs:
   - entrypoint
   - waits / timers
   - external callbacks / approvals
   - retries / failure handling
   - child workflows / fan-out
   - progress streaming
   - external side effects

## Default migration rules

- Put orchestration in `"use workflow"` functions.
- Put side effects, SDK calls, DB calls, HTTP calls, and stream I/O in `"use step"` functions.
- Use `sleep()` only in workflow context.
- For Signals, `step.waitForEvent()`, and `.waitForTaskToken`, choose exactly one resume surface:
  - `resume/internal` -> `createHook()` + `resumeHook()` when the app resumes from server-side code with a deterministic business token.
  - `resume/url/default` -> `createWebhook()` when the external system needs a generated callback URL and the default `202 Accepted` response is fine.
  - `resume/url/manual` -> `createWebhook({ respondWith: 'manual' })` only when the prompt explicitly requires a custom response body, status, or headers.
  - If a callback-URL prompt does not specify response semantics, default to `resume/url/default` and make the assumption explicit in `## Open Questions`.
- Never pair `createWebhook()` with `resumeHook()`, and never pass `token:` to `createWebhook()`.
- Wrap `start()` and `getRun()` inside `"use step"` functions for child runs.
- Use `getStepMetadata().stepId` as the idempotency key for external writes.
- Use `getWritable()` in workflow context to obtain the stream, but interact with it (write, close) only inside `"use step"` functions.
- Prefer rollback stacks for multi-step compensation.
- Choose app-boundary syntax in this order:
  1. If the prompt explicitly asks for framework-agnostic app-boundary code, use plain `Request` / `Response` even when a framework like Hono is named.
  2. Otherwise, if the target framework is named, shape app-boundary examples to that framework.
  3. Otherwise, keep examples framework-agnostic with `Request` / `Response`. Do not default to Next.js-only route signatures unless Next.js is explicitly named.

> Fast memory aid:
> - Callback URL + default ack -> `createWebhook()`
> - Callback URL + custom ack -> `createWebhook({ respondWith: 'manual' })`
> - Deterministic server-side resume -> `createHook()` + `resumeHook()`

## Fast-path router

Load `references/resume-routing.md` when the source pauses for Signals, `step.waitForEvent()`, or `.waitForTaskToken`.

Fast defaults:

- callback URL only -> `resume/url/default`
- callback URL + explicit custom response -> `resume/url/manual`
- deterministic server-side resume -> `resume/internal`
- self-hosted -> add `runtime/self-hosted`
- named framework -> add `boundary/named-framework`
- explicit framework-agnostic request -> add `boundary/framework-agnostic`

Before drafting `## Migrated Code`, write the selected route keys in `## Migration Plan`.

## Source references

- Temporal -> `references/temporal.md`
- Inngest -> `references/inngest.md`
- Trigger.dev -> `references/trigger-dev.md`
- AWS Step Functions -> `references/aws-step-functions.md`

## Shared references

- `references/shared-patterns.md`: Reusable code templates for hooks, child workflows, idempotency, streaming, and rollback.
- `references/runtime-targets.md`: Managed vs. custom `World` guidance.
- `references/resume-routing.md`: Route-key selection, obligations, and exact `## Migration Plan` shape.
- `references/retries.md`: Canonical retry mechanics, including `stepFn.maxRetries`, `RetryableError({ retryAfter })`, and `FatalError`.

## Required output shape

Return the migration in this structure:

```md
## Migration Plan
## Source -> Target Mapping
## Migrated Code
## App Boundary / Resume Endpoints
## Verification Checklist
## Open Questions
```

## Verification checklist

Fail the draft if any of these are true:

- [ ] `## Migration Plan` omits `Route keys`
- [ ] `## Migration Plan` omits `Why these route keys`
- [ ] `## Migration Plan` lists route keys that do not match the prompt
- [ ] `## Migration Plan` lists required code obligations that do not match the selected route keys
- [ ] Source-framework primitives remain in the migrated code
- [ ] Side effects remain in workflow context
- [ ] `sleep()` appears inside a step
- [ ] Stream interaction (`getWriter()`, `write()`, `close()`) appears inside a workflow function
- [ ] Child workflows call `start()` / `getRun()` directly from workflow context
- [ ] External writes omit idempotency keys
- [ ] Hooks/webhooks are missing where the source used signals, waitForEvent, or task tokens
- [ ] A callback-URL flow uses `createHook()` + `resumeHook()` instead of `createWebhook()`
- [ ] A `resume/url/default` or `resume/url/manual` migration invents a user-authored callback route or `resumeWebhook()` wrapper when `webhook.url` should be the only resume surface
- [ ] `createWebhook()` is given a custom `token` or paired with `resumeHook()`

Validation note:

- Reading webhook request data in workflow context is allowed. Only `request.respondWith()` is step-only.

Additional fail conditions:

- `resume/internal` output omits `resumeHook()` in app-boundary code
- `resume/internal` output omits a deterministic business token
- `resume/internal` output emits `createWebhook()` or `webhook.url`
- `resume/url/default` output does not pass `webhook.url` to the external system
- `resume/url/default` output emits `resumeHook()`, `respondWith: 'manual'`, or `RequestWithResponse` without a custom-response requirement in the prompt
- `resume/url/default` output invents a user-authored callback route or `resumeWebhook()` wrapper when `webhook.url` is the intended resume surface
- `resume/url/manual` output does not pass `webhook.url` to the external system
- `resume/url/manual` output omits `RequestWithResponse` or `await request.respondWith(...)`
- `resume/url/manual` output calls `request.respondWith(...)` outside a `"use step"` function
- `resume/url/manual` output invents a user-authored callback route or `resumeWebhook()` wrapper when `webhook.url` is the intended resume surface
- `createWebhook()` is paired with `resumeHook()`
- self-hosted output omits `World extends Queue, Streamer, Storage`, `startWorkflowWorld()`, or the explicit note that the workflow and step code can stay the same while the app still needs a custom `World`
- named-framework output mixes framework syntax with plain `Request` / `Response` app-boundary code without a framework-agnostic override

For concrete passing code, load:

- `references/shared-patterns.md` -> `## Generated callback URL (default response)`
- `references/shared-patterns.md` -> `## Generated callback URL (manual response)`
- `references/runtime-targets.md` -> `## Self-hosted output block`
- `references/aws-step-functions.md` -> `## Combined recipe: callback URL on self-hosted Hono`

## Sample prompt

```text
Migrate this Inngest workflow to the Workflow SDK.
It uses step.waitForEvent() with a timeout and step.realtime.publish().
```

Expected response shape:

```md
## Migration Plan
## Source -> Target Mapping
## Migrated Code
## App Boundary / Resume Endpoints
## Verification Checklist
## Open Questions
```

## Example references

Load a worked example only when the prompt needs concrete code:

- `references/shared-patterns.md` -> `## Named-framework internal resume example (Hono)`
- `references/shared-patterns.md` -> `## Generated callback URL (default response)`
- `references/shared-patterns.md` -> `## Generated callback URL (manual response)`
- `references/runtime-targets.md` -> `## Self-hosted output block`
- `references/aws-step-functions.md` -> `## Combined recipe: callback URL on self-hosted Hono`

Reject these counterexamples:

- `resume/url/default` or `resume/url/manual` + user-authored callback route when `webhook.url` is the intended resume surface
- `createWebhook()` paired with `resumeHook()`
- named-framework app-boundary output mixed with plain `Request` / `Response` without a framework-agnostic override

© Vercel Inc. · Apache-2.0 · vercel/workflow

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой