Skip to content

Add run metadata to workflows#328

Merged
jamescmartinez merged 1 commit intomainfrom
run-metadata
Feb 23, 2026
Merged

Add run metadata to workflows#328
jamescmartinez merged 1 commit intomainfrom
run-metadata

Conversation

@jamescmartinez
Copy link
Copy Markdown
Contributor

this PR adds a new run parameter to the workflow function to provide read-only metadata about the workflow run (id, workflowName, createdAt, startedAt)

Copilot AI review requested due to automatic review settings February 23, 2026 13:23
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 23, 2026

Open in StackBlitz

npm i https://pkg.pr.new/openworkflowdev/openworkflow/@openworkflow/cli@328
npm i https://pkg.pr.new/openworkflowdev/openworkflow/@openworkflow/dashboard@328
npm i https://pkg.pr.new/openworkflowdev/openworkflow@328

commit: 3ae1308

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new run parameter to workflow functions, exposing read-only metadata about the current workflow run. This enhancement provides developers with access to important workflow execution context (id, workflowName, createdAt, startedAt) without breaking existing workflows.

Changes:

  • Added WorkflowRunMetadata type and exported it from the main package
  • Extended WorkflowFunctionParams interface with the new run parameter
  • Implemented frozen metadata object creation in executeWorkflow function
  • Added comprehensive test coverage for metadata exposure, immutability, and replay stability
  • Updated documentation and examples to demonstrate the new parameter

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/openworkflow/index.ts Exports the new WorkflowRunMetadata type
packages/openworkflow/execution.ts Defines WorkflowRunMetadata type, adds run to WorkflowFunctionParams, creates and passes frozen metadata object to workflow functions
packages/openworkflow/execution.test.ts Adds comprehensive tests for metadata exposure, immutability via Object.freeze, and replay stability
packages/docs/docs/workflows.mdx Documents the new run parameter in the workflow function parameters table and example
openworkflow/hello-world.ts Demonstrates practical usage of run.id for logging

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/docs/docs/workflows.mdx
Comment thread packages/docs/docs/workflows.mdx
Comment thread packages/openworkflow/execution.ts
@jamescmartinez jamescmartinez merged commit 1033155 into main Feb 23, 2026
14 checks passed
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.

2 participants