一键导入
workflows
Create async background tasks (workflows) using SQS or Hatchet. Use when building queue jobs, background processing, or async tasks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create async background tasks (workflows) using SQS or Hatchet. Use when building queue jobs, background processing, or async tasks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Write integration tests for Autumn billing. Covers initScenario setup, billing/attach/track/check endpoints, subscription updates, assertion utilities, and common billing test patterns. Use when creating tests, writing test scenarios, debugging test failures, or when the user asks about testing.
Build and manage percentage-based rolling rollouts with cache staleness detection. Use when adding new rollout features, debugging rollout bucket routing, working with the rollout edge config, or handling cache staleness during forward/rollback migrations.
Understand and create S3-backed edge configs with poll-based caching. Use when adding new runtime configs (feature rollouts, request blocking, operational toggles), debugging edge config polling, or working with the EdgeConfigStore factory.
Build a billing page and manage subscriptions with Autumn. Use this skill when the user wants to: - Display active plans or subscription status - Show usage balances to customers - Build a pricing page with upgrade/downgrade buttons - Implement plan switching (upgrades/downgrades) - Add cancel/uncancel subscription functionality - Open the Stripe billing portal - Display usage history charts - Add prepaid top-ups or credit purchases
Add usage tracking and feature gating with the Autumn SDK. Use this skill when asked to: - Add usage tracking or metering - Implement feature limits or gating - Check feature access or entitlements - Track API calls, messages, or other usage - Implement credit systems - Add paywalls or upgrade prompts - Enforce usage limits server-side
Helps design pricing models for Autumn using the autumn.config.ts configuration file. Use this skill when: - Designing pricing tiers, plans, or features for Autumn - Creating autumn.config.ts configuration - Setting up usage-based, subscription, or credit-based pricing - Configuring features like API calls, seats, storage, or credits - Understanding Autumn feature types (metered, boolean, credit_system) - Working with plan items, metered billing, or tiered pricing
| name | workflows |
| description | Create async background tasks (workflows) using SQS or Hatchet. Use when building queue jobs, background processing, or async tasks. |
Workflows are async tasks processed by background workers. Two runners:
| Runner | Use Case | Features |
|---|---|---|
| SQS | Simple fire-and-forget tasks | Fast, no dependencies, max 15min delay |
| Hatchet | Complex workflows needing retries, multi-step, or long delays | Typed outputs, configurable timeouts, observability |
// server/src/queue/JobName.ts
export enum JobName {
// ... existing
MyNewWorkflow = "my-new-workflow",
}
// server/src/queue/workflows.ts
// Add payload type
export type MyNewWorkflowPayload = {
orgId: string;
env: AppEnv;
customerId: string;
// ... your fields
};
// Add to registry
const workflowRegistry = {
// ... existing
myNewWorkflow: {
jobName: JobName.MyNewWorkflow,
runner: "sqs", // or "hatchet"
} as WorkflowConfig<MyNewWorkflowPayload>,
};
// Add trigger function
export const workflows = {
// ... existing
triggerMyNewWorkflow: (payload: MyNewWorkflowPayload, options?: TriggerOptions) =>
triggerWorkflow({ name: "myNewWorkflow", payload, options }),
};
For SQS: See references/SQS.md
For Hatchet: See references/HATCHET.md
import { workflows } from "@/queue/workflows.js";
await workflows.triggerMyNewWorkflow({
orgId: ctx.org.id,
env: ctx.env,
customerId,
});
// With delay
await workflows.triggerMyNewWorkflow(payload, { delayMs: 5000 });
server/src/
├── queue/
│ ├── JobName.ts # Job name enum
│ ├── workflows.ts # Registry + triggers
│ └── initWorkers.ts # SQS message routing
└── internal/.../workflows/
└── myNewWorkflow/
├── myNewWorkflow.ts # Handler
└── triggerMyNewWorkflow.ts # (optional) trigger helper
All workflows must include:
{
orgId: string;
env: AppEnv;
customerId?: string; // optional but common
}