Skip to content

gitflarePublicPartly agent-ready50

cf-workflows-pipeline

Durable content pipeline on Cloudflare Workflows: ingest, extract, summarise with Workers AI via AI Gateway, human approval, publish.

Fix pipeline runs failing at ingest (steps.attempt NOT NULL)629b2fa
TypeScript18 lines736 B
import { describe, it, expect, vi } from "vitest";vi.mock("cloudflare:workers", () => ({ WorkflowEntrypoint: class {} }));import { setStep } from "../src/workflow";import type { Env } from "../src/env"; describe("setStep", () => {  it("always binds a non-null attempt on insert", async () => {    let args: unknown[] = [];    const env = { DB: { prepare: () => ({ bind: (...a: unknown[]) => { args = a; return { run: async () => ({}) }; } }) } } as unknown as Env;    await setStep(env, "r", "approval", "waiting", { start: true });    expect(args[4]).toBe(1);    expect(args[9]).toBeNull();    await setStep(env, "r", "ingest", "running", { attempt: 3 });    expect(args[4]).toBe(3);    expect(args[9]).toBe(3);  });});