Skip to content

Support RunShell's directory property from spec - #1696

Open
cvgaviao wants to merge 1 commit into
open-workflow-specification:mainfrom
cvgaviao:directory
Open

cvgaviao wants to merge 1 commit into
open-workflow-specification:mainfrom
cvgaviao:directory

Conversation

@cvgaviao

Copy link
Copy Markdown

open-workflow-specification/specification#1191

Many thanks for submitting your Pull Request ❤️!

What this PR does / why we need it:

Some shell scripts use the directory where they started (the working directory) to calculate other paths relative to it.
So, we can't always use the directory where the workflow application was started as the script's working directory. If we do, the script will fail.

Java's java.lang.ProcessBuilder has an explicit method to set the working directory: directory(File directory).

Special notes for reviewers:

Additional information (if needed):

Copilot AI lite review requested due to automatic review settings September 18, 2026 22:47
@cvgaviao
cvgaviao requested a review from fjtirado as a code owner September 18, 2026 22:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The schema, runtime implementation, and integration test consistently support the new working-directory property.

Review effort: Lite
Findings: None

What changed in this PR

Adds support for configuring a shell command’s working directory through the workflow schema and ProcessBuilder.

Changes:

  • Adds the shell.directory schema property.
  • Resolves and applies the directory when executing shell commands.
  • Adds a Linux integration test using pwd.
File Description
types/​src/​main/​resources/​schema/​workflow.yaml Defines the shell working-directory property.
impl/​core/​src/​main/​java/​io/​serverlessworkflow/​impl/​executors/​RunShellExecutorBuilder.java Builds a resolver for the directory.
impl/​core/​src/​main/​java/​io/​serverlessworkflow/​impl/​executors/​RunShellExecutor.java Applies the directory to ProcessBuilder.
impl/​test/​src/​test/​java/​io/​serverlessworkflow/​impl/​test/​RunShellExecutorTest.java Tests directory execution behavior.
impl/​test/​src/​test/​resources/​workflows-samples/​run-shell/​pwd-directory.yaml Provides the directory test workflow.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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