Skip to content

Outcomes

Outcomes extract structured results from step artifacts into the pipeline output summary. When a step produces a JSON artifact containing a PR URL, issue link, or deployment URL, outcomes let you surface those values automatically.

yaml
steps:
  - id: create-pr
    persona: craftsman
    exec:
      type: prompt
      source: "Create a pull request"
    output_artifacts:
      - name: result
        path: .wave/output/result.json
        type: json
    outcomes:
      - type: pr
        extract_from: .wave/output/result.json
        json_path: ".pr_url"
        label: "Pull Request"

After the step completes, Wave extracts the value at .pr_url from the JSON artifact and registers it as a PR outcome in the pipeline summary.

Outcome Types

TypeDescriptionExample Value
prPull request URLhttps://github.com/org/repo/pull/42
issueIssue URLhttps://github.com/org/repo/issues/99
urlGeneric URLhttps://example.com/report
deploymentDeployment URLhttps://staging.example.com

Field Reference

FieldRequiredDescription
typeyesOutcome type: pr, issue, url, deployment
extract_fromyesArtifact path relative to workspace
json_pathyesDot notation path to extract the value
json_path_labelnoLabel extraction path for array items (used with [*] in json_path)
labelnoHuman-readable label for the output summary

Array Extraction

Extract multiple values from a JSON array using [*] in the json_path:

yaml
outcomes:
  - type: url
    extract_from: .wave/output/deploy-result.json
    json_path: ".environments[*].url"
    json_path_label: ".name"
    label: "Deployments"

Given this artifact:

json
{
  "environments": [
    { "name": "staging", "url": "https://staging.example.com" },
    { "name": "production", "url": "https://prod.example.com" }
  ]
}

Wave extracts both URLs and uses each item's .name as its display label.

Multiple Outcomes

A single step can declare multiple outcomes to extract different result types:

yaml
outcomes:
  - type: pr
    extract_from: .wave/output/result.json
    json_path: ".pr_url"
    label: "Pull Request"
  - type: issue
    extract_from: .wave/output/result.json
    json_path: ".issue_url"
    label: "Tracking Issue"
  - type: deployment
    extract_from: .wave/output/deploy.json
    json_path: ".deploy_url"
    label: "Preview"

Next Steps

Released under the MIT License.