Passing Activity Outputs to Later Activities
Learn how to pass pipeline outputs from one activity as inputs to later activities
This walkthrough demonstrates how to pass data between activities in a release process. You'll learn how to capture pipeline outputs in one activity and use those values as inputs to subsequent activities, enabling dynamic workflows where later steps depend on results from earlier ones.
Use Case
A common requirement in release orchestration is to generate a dynamic value (such as a release version, artifact URL, or configuration ID) in one pipeline and use that value consistently across multiple deployment pipelines. This pattern ensures data consistency and eliminates manual entry errors.
Example scenario:
A "Generate Version" pipeline creates a release version number (e.g.,
v1.2.345)Multiple deployment pipelines need to use that exact version number
The version must flow automatically without manual intervention
Before you begin
Release Orchestration access: Permission to create pipelines, activities, and processes.
Harness expressions: Basic familiarity with expression syntax. Go to Harness variables to review expression fundamentals.
Architecture Overview
The data flow follows this pattern:
Phase 1: Version Generation
Activity: Generate Version
├─ Pipeline executes
├─ Outputs: version=v1.2.345
└─ Activity captures output
│
│ Process Input maps output → input
│
↓
Phase 2: Deployment
(depends-on: version_generation)
Activity: Deploy Application
├─ Input: version=v1.2.345
├─ Pipeline receives version
└─ Deploys using that versionThe phase dependency (depends-on: [version_generation]) ensures Phase 2 waits for Phase 1 to complete before starting. This configuration is set via YAML in the process definition.
Step 1: Create the Source Pipeline (Version Generator)
Create a pipeline that generates a value and exports it as an output variable.
Navigate to Pipelines and click + New Pipeline
Name:
Generate Release VersionAdd a Custom stage named
Version GenerationAdd a Shell Script step named
Generate VersionIn the script, generate your value and export it:
Important: In the step's Output Variables section, add:
Name:
RELEASE_VERSIONType:
StringValue:
RELEASE_VERSION
Save the pipeline
Step 2: Create the Destination Pipeline (Deployment)
Create a pipeline that accepts the version as a runtime input.
Navigate to Pipelines and click + New Pipeline
Name:
Deploy ApplicationBefore adding stages, configure pipeline variables:
Click on Variables (in the right panel or under Advanced)
Add a variable:
Name:
releaseVersionType:
StringValue:
<+input>← Critical: This makes it show in activity mapping
Add a Custom stage named
DeploymentAdd a Shell Script step named
DeployUse the variable in your script:
Save the pipeline
CRITICAL REQUIREMENT
The pipeline variable must have value: <+input> to appear in the activity's Pipeline Input Mapping interface. Without this, you won't be able to map activity inputs to the pipeline variable.
Step 3: Create the Version Generation Activity
Create an activity that captures the pipeline's output.
Navigate to Activity Store and click + New Activity
Activity Overview tab:
Name:
Generate Release VersionType:
PipelineSelect your
Generate Release Versionpipeline
Output Variables tab:
Click + New Output Variable
Name:
RELEASE_VERSIONDescription:
Generated release versionValue:
<+pipeline.stages.version_gen.spec.execution.steps.generate_version.output.outputVariables.RELEASE_VERSION>
Input Variables tab: Leave empty (no inputs needed)
Save the activity
Understanding the Output Expression
The expression path follows this structure:
How to build the expression:
Start with
<+pipeline.stages.Add your stage identifier:
version_genAdd
.spec.execution.steps.Add your step identifier:
generate_versionAdd
.output.outputVariables.Add your output variable name:
RELEASE_VERSION
Step 4: Create the Deployment Activity
Create an activity that accepts the version as input and passes it to the pipeline.
Navigate to Activity Store and click + New Activity
Activity Overview tab:
Name:
Deploy ApplicationType:
PipelineSelect your
Deploy Applicationpipeline
Input Variables tab:
Sub-tab: Input Variables
Click + New Variable
Name:
RELEASE_VERSIONType:
StringDescription:
Release version to deployDefault Value:
v0.0.0
Sub-tab: Pipeline Input Mapping
Select Pipeline Stages:
All StagesYou should see
releaseVersionlisted (from your pipeline)In the Value field, enter:
<+activityInput.RELEASE_VERSION>
Output Variables tab: Leave empty
Save the activity
Step 5: Create the Process with Dependencies
Create a process that orchestrates the execution order.
Navigate to Processes and click + New Process
Name:
Version-Driven Release ProcessAdd Phase 1:
Name:
Version GenerationAdd Activity:
Activity: Select
Generate Release Versionfrom Activity StoreName:
Generate Version
Add Phase 2:
Name:
DeploymentAdd Activity:
Activity: Select
Deploy Applicationfrom Activity StoreName:
Deploy Application
Save the process
Configure phase dependency via YAML:
Switch to YAML editor
Find the
deploymentphaseAdd
depends-on: [version_generation]under the phase configurationSave the process
CRITICAL: PHASE DEPENDENCIES MUST BE SET VIA YAML
The depends-on configuration is essential and currently must be set by editing the process YAML directly. Without it:
Both phases run in parallel
Deployment starts before version generation completes
The output value isn't available yet, so deployment receives the default value
Always ensure dependent phases have depends-on configured correctly in the YAML.
Step 6: Create the Process Input Set
Configure how the version flows from generation to deployment.
Navigate to your process Version-Driven Release Process
Click the Input Store tab (or find Process Inputs section)
Click + New Input Set
Name:
Version-Driven Release InputConfigure phase inputs:
Version Generation phase: Leave as-is (no inputs)
Deployment phase:
Expand the phase
Expand the
Deploy ApplicationactivityFind the
RELEASE_VERSIONinput fieldClick the dropdown → Select "Reference Output"
In the picker:
Select Phase:
Version GenerationSelect Activity:
Generate VersionSelect Output:
RELEASE_VERSION
Click Done
Save the input set
Understanding the Reference Expression
The expression to reference an activity's output:
Components:
phase.version_generation- The phase that contains the source activityactivity.gen_version- The activity that captured the outputoutputs.RELEASE_VERSION- The specific output variable
Step 7: Execute and Verify
Test the complete flow.
Create and Execute a Release
Navigate to Release Groups or Releases
Create a new release:
Process:
Version-Driven Release ProcessInput Set:
Version-Driven Release Input
Start the release execution
Monitor Execution
Version Generation Phase:
Watch the phase execute
Once complete, click on the
Generate VersionactivityNavigate to the Outputs tab
Note the generated version (e.g.,
v1.2.34567)
Deployment Phase:
Verify it shows "Scheduled" status until Version Generation completes
Once Version Generation finishes, Deployment should start automatically
Click on the
Deploy ApplicationactivityCheck the Inputs tab - should show the same version from Version Generation
Click View Pipeline Execution or Execution Details
Check the logs - should show:
Deploying version: v1.2.34567
Success Criteria
Verify these conditions are met:
Version Generation completes and captures an output (e.g.,
v1.2.34567)Deployment waits until Version Generation completes (dependency working)
Deployment receives the exact same version (e.g.,
v1.2.34567)Pipeline logs show the correct version being used
Expression Syntax Reference
Pipeline Output Variables
Capture output from a pipeline step:
Activity Inputs
Reference an activity's input (used in pipeline mapping):
Activity Outputs
Reference output from a previous activity (used in process inputs):
Pipeline Variables
Reference a pipeline-level variable within the pipeline:
Troubleshooting
Issue: "No Data" in Pipeline Input Mapping
Symptom: The Pipeline Input Mapping tab shows "No Data" or doesn't list pipeline variables.
Cause: Pipeline variables not defined or not set to <+input>.
Solution:
Go to the destination pipeline
Add or edit the
variablessection at the pipeline level (not in a stage)Ensure the variable has
value: <+input>Save the pipeline
Return to the activity and refresh the Pipeline Input Mapping tab
Issue: Deployment Receives Default Value
Symptom: Deployment activity receives v0.0.0 instead of the generated version.
Cause 1: Phase dependency missing.
Solution: Edit the process YAML and add depends-on: [version_generation] to the deployment phase.
Cause 2: Incorrect expression in process input.
Solution: Verify the expression path matches your actual phase IDs, activity IDs, and output names. Expression is case-sensitive.
Issue: Both Phases Run Simultaneously
Symptom: Version Generation and Deployment phases start at the same time.
Cause: No dependency configured between phases.
Solution: The deployment phase must have depends-on: [version_generation] in its configuration.
Issue: Expression Shows Unresolved in Deployment
Symptom: Deployment input shows the raw expression (e.g., <+phase.version_generation...>) instead of the actual value.
Cause: Expression was resolved before the source activity completed (usually due to parallel execution).
Solution: Ensure phase dependencies are configured correctly so the source phase completes before the destination phase starts.
Best Practices
Test pipelines individually before integrating them into activities. Run the source pipeline and verify outputs are generated correctly, then run the destination pipeline with a test input value to ensure it accepts and uses inputs properly.
Use consistent variable names across all components. If you call it RELEASE_VERSION in the pipeline output, use RELEASE_VERSION in the activity output, activity input, and process input mapping. This consistency reduces confusion and makes troubleshooting easier.
Verify execution order by checking phase dependencies. When creating processes with data flow between phases, always confirm that dependent phases have depends-on configured in the YAML to prevent parallel execution issues.
Test multiple executions to ensure the flow works reliably. Run the release several times and verify that different values are passed correctly each time, confirming that expressions resolve dynamically rather than caching old values.
Advanced Patterns
Multiple Outputs from One Activity
Chained Outputs
Version Generation → Build → Deploy:
Conditional Execution Based on Outputs
Use conditional execution in activities based on previous outputs.
Related Topics
Last updated
Was this helpful?