Planned, open source, design stage
Cap the spend. Never guess a side effect.
A planned open-source queue for AI jobs, where a retry reuses finished steps and an unknown outcome stays unknown.
02 The problem
A crash costs you twice.
A retry restarts from the top. The paid call and the post both run again.
Illustration with made-up numbers
03 The fix
One workflow. Every feature.
Scroll to see what each part does.
// Design sketch: names are proposalsq.workflow("report.weekly", async (ctx, input) => { const summary = await ctx.step("summary", input, { maxTokens: 4000, fallback: [ { provider: "anthropic" }, { provider: "openai" }, ], expect: (o) => o.sections.length > 0, }, async (i) => callModel(i)); const chart = await ctx.step.async("chart", { summary }, { submit: (i) => imageApi.create(i), poll: (jobId) => imageApi.status(jobId), download: (jobId, r) => imageApi.fetch(r.url), maxWait: "30m", }); const review = await ctx.submit("report.review", { id: input.id }, { dependency: true }); await ctx.step("publish", { page: input.page }, { effect: true, onUnknown: "pause", probe: (a) => wiki.hasPost(a.page), }, async (a) => wiki.publish(a.page, review, chart)); return chart;}); await q.submit("report.weekly", { id: "w42", page: "team-weekly" }, { key: "report-w42", budget: { usd: 2 } });Design sketch, not working code; names are proposals.
- 1
Name it once. Every ticket of this kind runs this function.
- 2
A retry reuses "summary" and never pays for it again.
- 3
Next provider in order, without using a retry.
- 4
An empty or wrong-shaped result fails the step.
- 5
The job id is saved, so a restart resumes and never resubmits.
- 6
The parent waits for the child and holds no worker.
- 7
A crash mid-publish pauses for a check or a person.
- 8
One key makes a repeat call safe. The cap stops at $2 and keeps finished steps.
Name it once. Every ticket of this kind runs this function.
q.workflow("report.weekly",
async (ctx, input) => {A retry reuses "summary" and never pays for it again.
const summary = await ctx.step(
"summary", input, {
maxTokens: 4000,Next provider in order, without using a retry.
fallback: [
{ provider: "anthropic" },
{ provider: "openai" },
],An empty or wrong-shaped result fails the step.
expect: (o) => o.sections.length > 0,
The job id is saved, so a restart resumes and never resubmits.
await ctx.step.async("chart",
{ summary }, {
submit: (i) => imageApi.create(i),
maxWait: "30m",The parent waits for the child and holds no worker.
await ctx.submit("report.review",
{ id: input.id },
{ dependency: true });A crash mid-publish pauses for a check or a person.
effect: true, onUnknown: "pause", probe: (a) => wiki.hasPost(a.page),
One key makes a repeat call safe. The cap stops at $2 and keeps finished steps.
await q.submit("report.weekly",
{ id: "w42", page: "team-weekly" },
{ key: "report-w42",
budget: { usd: 2 } });Design sketch, not working code; names are proposals.
04 The crash demo
Kill the worker. Nothing repeats.
A simulation on a fake model. No API key, nothing really posted.
05 Honest limits
What it will not do.
Where it stands: design only. No code, no alpha. Read every limit
06 Your turn
Is this your problem?
Tell me what breaks today. I am not selling anything.