Skip to content

feat: add configurable base url to embedded world#227

Closed
eersnington wants to merge 2 commits intovercel:mainfrom
eersnington:feat/local-world-baseurl-support
Closed

feat: add configurable base url to embedded world#227
eersnington wants to merge 2 commits intovercel:mainfrom
eersnington:feat/local-world-baseurl-support

Conversation

@eersnington
Copy link
Copy Markdown
Contributor

@eersnington eersnington commented Nov 5, 2025

Hey @Schniz, I was wondering if I can introduce changes to the world spec, specifically local world spec to allow users to configure base URL for queue streams.

Here's the reference issue #201 (comment) where a user had --experimental-https flag enabled but could get workflows to start cause the queue requests hard codes "http" as protocol. I think it would massively improve the DX if users can configure the base URL through either a config or Env vars because the current workaround is hacky at best.

The PR is draft and not complete at all ATM (haven't tested too). I want to introduce changes so the following are possible with local world:

  • Call createEmbeddedWorld({}) with no env overrides to use .workflow-data and http://localhost:3000
  • Pin the listener port only: createEmbeddedWorld({ port: 4010 }) -> queue hits http://localhost:4010
  • Ephemeral ports for tests: createEmbeddedWorld({ port: 0 })
  • Supply a full base URL so calls reach a proxy: createEmbeddedWorld({ baseUrl: 'https://example.com/workflow-proxy' }) (path kept, trailing slash trimmed)
  • Or through an Env vars:
WORKFLOW_BASE_URL=https://world.acme.com/workflow
WORKFLOW_EMBEDDED_DATA_DIR=/var/run/workflow
PORT=5000

Signed-off-by: Sree Narayanan <sreeaadhi07@gmail.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Nov 5, 2025

⚠️ No Changeset found

Latest commit: b7840d6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Nov 5, 2025

@eersnington is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@eersnington
Copy link
Copy Markdown
Contributor Author

eersnington commented Nov 5, 2025

⚠️ No Changeset found

Latest commit: 09a465c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

will add this at the end if Gal approves of this idea or if this will interfere with any other plans of his

Copy link
Copy Markdown
Contributor

@vercel vercel Bot left a comment

Choose a reason for hiding this comment

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

Comment thread packages/world-local/src/index.ts
also added sourceURL which might come in handy for better errors

Signed-off-by: Sree Narayanan <sreeaadhi07@gmail.com>
@eersnington
Copy link
Copy Markdown
Contributor Author

@workflow/world-local:build
@workflow/core:test
cache miss, executing 083efc37933e9dd9
 @workflow/core@4.0.1-beta.9 test D:\a\workflow\workflow\packages\core
  WORKFLOW_TARGET_WORLD=embedded vitest run src
 'WORKFLOW_TARGET_WORLD' is not recognized as an internal or external command,
operable program or batch file.


 Looks like the Windows unit tests is failing due to windowisms. iirc, you set an env var in windows with "set"

@eersnington
Copy link
Copy Markdown
Contributor Author

#260

beat me to it

TooTallNate added a commit that referenced this pull request Apr 17, 2026
v6 installs pnpm 11 RC/beta, which has a regression
(pnpm/pnpm#11264, pnpm/action-setup#225/#227/#228) that causes
'ERR_PNPM_BROKEN_LOCKFILE: expected a single document in the stream'
when the project's packageManager pins a 10.x pnpm version. v5 is the
latest stable release before v6 and supports reading the version from
package.json#packageManager.
TooTallNate added a commit that referenced this pull request Apr 17, 2026
#1785)

* ci: upgrade pnpm/action-setup to v6 and read version from package.json

Removes hardcoded pnpm version (10.14.0) from all workflows and instead
reads the version from the packageManager field in package.json, so CI
stays in sync with the version used locally.

* ci: update setup-workflow-dev composite action to use pnpm/action-setup@v6

Also removes the pnpm-version input since the action now reads the
version from package.json#packageManager.

* ci: downgrade pnpm/action-setup to v5

v6 installs pnpm 11 RC/beta, which has a regression
(pnpm/pnpm#11264, pnpm/action-setup#225/#227/#228) that causes
'ERR_PNPM_BROKEN_LOCKFILE: expected a single document in the stream'
when the project's packageManager pins a 10.x pnpm version. v5 is the
latest stable release before v6 and supports reading the version from
package.json#packageManager.
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