Skip to content

Outputs

Outputs let one component pass values to components that run later in the graph.

components:
producer:
type: script
outputs:
- name: token
sensitive: true
consumer:
type: script
depends_on:
- producer
env:
TOKEN: "${producer.outputs.token}"

Outputs are named objects.

outputs:
- name: url
- name: token
sensitive: true
- name: optional_value
required: false

Outputs are required by default.

Sensitive outputs are available during the same orch up process that produced them, but they are not persisted in state.

If a later run skips the producer because it is already applied, sensitive outputs from that producer are unavailable. Orch fails clearly rather than inventing or leaking the value.

Adapter-generated operational outputs live under the reserved _meta namespace.

env:
BASE_URL: "http://localhost:${web.outputs._meta.ports.services.web.80}"

Users cannot declare outputs named _meta or beginning with _meta.. Orch keeps these values available for interpolation and state because they are adapter metadata, not user-declared outputs.

Script components can write outputs to either file:

Terminal window
echo "url=http://localhost:8080" >> "$ORCH_OUTPUT_ENV"

or:

Terminal window
cat > "$ORCH_OUTPUT_JSON" <<'JSON'
{
"url": "http://localhost:8080"
}
JSON