gitflarePublicPartly agent-ready50
cf-workflows-pipeline
Durable content pipeline on Cloudflare Workflows: ingest, extract, summarise with Workers AI via AI Gateway, human approval, publish.
- LicenseApache-2.0
- LanguageTypeScript
- Last landed
629b2faOct 20, 2026
Fix pipeline runs failing at ingest (steps.attempt NOT NULL)
629b2faexport type StepName = "extract" | "summarise" | "publish";export type FailurePlan = Partial<Record<StepName, number>>;const NAMES: StepName[] = ["extract", "summarise", "publish"]; export function parsePlan(raw: unknown): FailurePlan { const plan: FailurePlan = {}; if (!raw || typeof raw !== "object") return plan; for (const n of NAMES) { const v = Number((raw as Record<string, unknown>)[n]); if (Number.isFinite(v) && v > 0) plan[n] = Math.min(Math.floor(v), 10); } return plan;} /** Fail while attempt number (1-based) <= configured count. */export function shouldFail(plan: FailurePlan, step: string, attempt: number): boolean { const n = (plan as Record<string, number | undefined>)[step] ?? 0; return attempt <= n;}