refactor(workflow-code-runner): inline Sandbox calls in workflow function#129
Merged
refactor(workflow-code-runner): inline Sandbox calls in workflow function#129
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Refactors the workflow code runner example to remove the redundant sandbox step wrappers and call @vercel/sandbox APIs directly from the workflow, while also avoiding Buffer.from() in the workflow runtime.
Changes:
- Removed
examples/workflow-code-runner/steps/sandbox.ts(wrapper steps forSandbox.create(), execution, and stop). - Inlined sandbox lifecycle + execution logic directly in
examples/workflow-code-runner/workflows/code-runner.ts. - Updated
writeFiles()usage to pass code as astring(noBuffer.from()), aligning with the widenedcontenttype.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| examples/workflow-code-runner/workflows/code-runner.ts | Inlines sandbox create/write/run/stop calls inside the "use workflow" function and passes code to writeFiles() as a string. |
| examples/workflow-code-runner/steps/sandbox.ts | Removes redundant step wrappers around sandbox operations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
da1e701 to
23d7a96
Compare
marc-vercel
approved these changes
Apr 2, 2026
23d7a96 to
67d117c
Compare
ced7247 to
bf96d74
Compare
67d117c to
c8807e5
Compare
bf96d74 to
f6c7212
Compare
c8807e5 to
e7ac714
Compare
QuiiBz
approved these changes
Apr 2, 2026
f6c7212 to
9ba118c
Compare
…tion Sandbox.create() and instance methods (writeFiles, runCommand, stop) all have "use step" built in, so the wrapper functions in steps/sandbox.ts were redundant.
e7ac714 to
aa690ce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
steps/sandbox.ts— the wrapper functions (createSandbox,execute,stopSandbox) were redundant sinceSandbox.create()and all instance methods already have"use step"built in"use workflow"function inworkflows/code-runner.tswriteFiles()instead of wrapping withBuffer.from()(which is unavailable in the workflow runtime)Depends on #130.