Skip to content

fix(invoke): write result as JSON to stdout, errors to stderr#724

Open
VirtueMe wants to merge 1 commit intomasterfrom
fix-592-invoke-output
Open

fix(invoke): write result as JSON to stdout, errors to stderr#724
VirtueMe wants to merge 1 commit intomasterfrom
fix-592-invoke-output

Conversation

@VirtueMe
Copy link
Copy Markdown
Collaborator

What

Fixes the output of serverless invoke stepf to be machine-readable and correctly routed by stream.

Why

The two fixes are combined in one commit as they are inseparable — routing to stdout requires serialising the value first.

Note: #435 (-n shortcut not mapping to --name) was verified as already fixed by a prior change that added type: 'string' to the options definition. Closed separately.

Closes #436
Closes #592

Test plan

  • New tests for #invoke(): success writes JSON to stdout, failure writes JSON to stderr with exitCode=1, blank line separator goes to stderr
  • npm test — 500 passing

🤖 Generated with Claude Code

- JSON.stringify the execution result so it is machine-readable
  instead of printing [object Object] (#436)
- Route the final result to stdout so it can be piped (#592)
- Route error output and the post-progress blank line to stderr (#592)

Closes #436
Closes #592

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 27, 2026

Open in StackBlitz

npm i https://pkg.pr.new/serverless-operations/serverless-step-functions@724

commit: 6be874f

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.

Change command output format to JSON Getting [object Object] from invoke stepf

1 participant