Skip to content

feat: Add workflow stage 0 - #759

Open
aXenDeveloper wants to merge 1 commit into
canaryfrom
feat/workflow_0
Open

feat: Add workflow stage 0#759
aXenDeveloper wants to merge 1 commit into
canaryfrom
feat/workflow_0

Conversation

@aXenDeveloper

Copy link
Copy Markdown
Owner

Improving Documentation

Description

What?

Why?

@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vitnode-docs Ready Ready Preview Aug 26, 2026 3:44pm

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 02825c21f9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -0,0 +1,12 @@
export * from "./const";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add a package export for the workflow barrel

Importing the intended public API as @vitnode/core/api/workflows cannot resolve in the published package: the wildcard export maps that subpath to dist/src/api/workflows.js, while this directory barrel is emitted as dist/src/api/workflows/index.js. Add an explicit ./api/workflows entry to packages/vitnode/package.json or place the barrel at the path targeted by the existing wildcard; otherwise consumers cannot use any of the new workflow SDK.

Useful? React with 👍 / 👎.

status: outcome.status,
})
.where(
and(eq(core_queue.id, task.id), eq(core_queue.status, "processing")),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Fence stale queue leases before reclaiming them

When a legitimate handler runs longer than 15 minutes, this update can return its task to pending and allow the same tick to claim it again. The original worker still completes using the unfenced ID-only update in processQueueTasks, so it can clear the replacement worker's reservation and mark the task completed or pending while that replacement is still executing. Compare a lease token such as reservedAt or the claimed attempt in both the recovery and completion updates so an expired worker cannot overwrite a newer claim.

Useful? React with 👍 / 👎.

Comment on lines +16 to +17
const isPlainObject = (value: unknown): value is Record<string, unknown> =>
typeof value === "object" && value !== null && !Array.isArray(value);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject inputs that cannot survive the JSONB round trip

This predicate only excludes scalars and arrays; it accepts parsed values containing non-JSON types. For example, z.object({ runAt: z.date() }) passes here, but PostgreSQL JSONB stores the date as a string, so a later step receives a string even though WorkflowStepContext types runAt as Date; a bigint can instead make persistence fail outright. Validate the entire parsed value as JSON-compatible or explicitly round-trip/re-parse it before accepting the execution.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant