Scan your whole stack
From OX Research Newsroom
Are you using @backendkit-labs/agent-flow-queue?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.1.10
@backendkit-labs/agent-flow-queue was last scanned on 29 Nov 2026 at version 0.1.10. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.1.10 LATEST | 29 Nov 2026 | No rules fired |
| 0.1.9 | 29 Nov 2026 | No rules fired |
| 0.1.8 | 28 Nov 2026 | No rules fired |
| 0.1.7 | 23 Nov 2026 | Not shown |
| 0.1.6 | 22 Nov 2026 | Not shown |
Findings for v0.1.10. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.1.10; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Run agent-core flows across processes: a BullMQ StepExecutor (each step runs on a worker, maybe on another machine) and a Redis RunJournal (a run survives the process and any process can resume it).
npm install @backendkit-labs/agent-flow-queue @backendkit-labs/agent-core
Needs a Redis. The flow engine stays in one process; only the steps travel.
One file. A flow whose steps travel through Redis to workers, with the run kept in a Redis journal. The first attempt of the last step fails, like a crashed worker; the second runFlow call, with the same runId, resumes and runs only what was not done. The worker and the orchestrator share one file here so the example is one piece; in production each is its own process.
Start a Redis (any Redis 6+ works; this one is thrown away when stopped):
docker run -d --rm --name flow-redis -p 6379:6379 redis:7-alpine
npm install @backendkit-labs/agent-core @backendkit-labs/agent-flow-queue
npm install -D typescript tsx
Save the program as queue.ts and run it with REDIS_URL=redis://127.0.0.1:6379 npx tsx queue.ts:
import { parseFlow, runFlow } from '@backendkit-labs/agent-core';
import { QueueStepExecutor, RedisRunJournal, createStepWorker } from '@backendkit-labs/agent-flow-queue';
const redis = process.env.REDIS_URL ?? 'redis://127.0.0.1:6379';
const prefix = `demo-${Date.now()}`; // an own namespace, so this demo never touches other queues
const flow = parseFlow(`
flow: close-month
trigger: { type: manual }
steps:
- id: collect-sales
agent: sales
prompt: "Collect the sales of {{payload.month}}"
- id: collect-costs
agent: finance
prompt: "Collect the costs of {{payload.month}}"
- id: report
agent: finance
prompt: "Write the report"
after: [collect-sales, collect-costs]
`);
// WORKER side. In production this is its own process (maybe on another machine), one per kind of work.
// Here it lives in the same file so the example is one piece. It records who ran what.
const handled: string[] = [];
let failReport = true; // the first attempt of "report" dies, like a crashed worker
const workers = createStepWorker({
redis, prefix, agents: ['sales', 'finance'], concurrency: 2,
executor: {
run: async (step, input) => {
if (step.id === 'report' && failReport) throw new Error('worker crashed');
handled.push(step.id);
return { content: `${step.agent} did ${step.id} (${input.prompt})` };
},
},
});
// ORCHESTRATOR side: the flow engine runs here, only the steps travel through Redis.
const executor = new QueueStepExecutor({ redis, prefix, timeoutMs: 30_000 });
const journal = new RedisRunJournal({ redis, prefix });
const options = { executor, journal, payload: { month: '2026-10' }, runId: 'close-2026-10' };
const first = await runFlow(flow, options);
console.log('first run :', first.status, handled);
failReport = false; // the worker is back
const second = await runFlow(flow, options); // same runId: it resumes
console.log('second run:', second.status, handled);
const run = await journal.get('close-2026-10');
console.log(run?.status, Object.entries(run?.steps ?? {}).map(([id, s]) => `${id}:${s.status}`).join(' '));
await workers.close();
await executor.close();
await journal.close();
It prints (the two collect steps run in parallel, so their order may swap):
first run : failed [ 'collect-costs', 'collect-sales' ]
second run: completed [ 'collect-costs', 'collect-sales', 'report' ]
done collect-sales:done collect-costs:done report:done
What happened:
runFlow runs in the orchestrator. For each step, QueueStepExecutor puts a job in the queue <prefix>.<agent> (here sales and finance), and a worker created with createStepWorker takes it, runs its executor, and sends the result back. The two collect steps ran at once, on different queues.report failed on the worker, and the flow ended failed. The journal in Redis kept the two finished steps.runFlow with the same runId resumed. It read the run from Redis, saw the two collect steps done, and sent only report to a worker. handled shows each collect step once.prefix isolates. The demo uses its own prefix, so it cannot touch the queues of anything else in that Redis. Use a fixed prefix per environment (prod, staging) in your program.To turn it into a real deployment, split the file in two and keep the same redis and prefix in both:
createStepWorker part, with the executor that runs your real agent. On shutdown call await workers.close().QueueStepExecutor, the RedisRunJournal and runFlow. If it dies, start it again with the same runId: the run resumes from the journal, and steps that were already running on workers are not sent twice (the job id is the step's idempotency key).input.idempotencyKey inside the worker's executor, because the queue is at least once.// orchestrator process
import { loadFlow, runFlow } from '@backendkit-labs/agent-core';
import { QueueStepExecutor } from '@backendkit-labs/agent-flow-queue';
const executor = new QueueStepExecutor({ redis: process.env.REDIS_URL!, timeoutMs: 15 * 60_000 });
const result = await runFlow(await loadFlow('flows/close-month.yaml'), { executor, payload: { month: '2026-10' } });
await executor.close();
// worker process: one queue `flow.<agent>` each, `concurrency` steps at a time
import { createStepWorker } from '@backendkit-labs/agent-flow-queue';
const workers = createStepWorker({
redis: process.env.REDIS_URL!,
agents: ['sales', 'finance'],
concurrency: 4,
executor: { run: async (step, input) => ({ content: await localAgent(step.agent).run(input.prompt) }) },
});
// on shutdown: await workers.close();
runId:stepId:attempt), so enqueuing the same step twice is one job. A step with an external effect (payment, email) must use input.idempotencyKey in the worker too.attempts is 1 by default; BullMQ retries of the same job keep the same key.timeoutMs (default 900 s) per step; on expiry the step fails and the flow handles it like any failed step.QueueEvents has started reading is never delivered. The executor also looks at the job itself every pollMs (default 1 s; 0 turns it off), so a step that finishes in milliseconds on the first use of a queue does not wait for timeoutMs.prefix (default flow) lets several environments share a Redis.import { RedisRunJournal } from '@backendkit-labs/agent-flow-queue';
const journal = new RedisRunJournal({ redis: process.env.REDIS_URL!, prefix: 'flow' });
await runFlow(flow, { executor, journal, runId: 'close-2026-10', payload }); // run again with the same runId to resume
One Lua script per mutation makes "create only if absent", "append only if it exists" and "take the claim only if free or mine" atomic. The claim expires by Redis TTL, and releasing with an old token never frees a renewed claim. Logs do not expire on their own: delete finished runs with your own retention job.
One writer per run comes from the claim, not from the journal. Appends are not fenced by the claim's token: the RunJournal contract does not say who writes a step. A process whose claim expired (paused past the TTL) can still append until its next renewal finds the claim taken and runFlow stops it with FlowClaimError. Keep claimTtlMs well above the pauses you expect (GC, a stalled host). The conformance battery records this as exclusiveWriter: false; NdjsonRunJournal does detect a second writer, on one host.
The scripts are covered by a contract suite that runs against a real Redis when
localhost:6379answers (REDIS_HOST,REDIS_PORT) and against an in-memory stand-in otherwise.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.